ocean-brain 0.7.1 → 0.7.3

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 (36) hide show
  1. package/package.json +1 -1
  2. package/server/client/dist/assets/{Calendar-BuHuea3u.js → Calendar-BqlwdVTC.js} +1 -1
  3. package/server/client/dist/assets/{Callout-B-Y15DKd.js → Callout-BQztyCMl.js} +1 -1
  4. package/server/client/dist/assets/{Graph-BddGuIWA.js → Graph-BMciMgqf.js} +1 -1
  5. package/server/client/dist/assets/{Image-DK0lnaK2.js → Image-DxWhlIDG.js} +1 -1
  6. package/server/client/dist/assets/{Image.es-DWOPKZ3F.js → Image.es-CNBM7KrE.js} +1 -1
  7. package/server/client/dist/assets/{Note-Dl6-yoQO.js → Note-DlOYlFsr.js} +1 -1
  8. package/server/client/dist/assets/{Plus.es-2XIq0eEW.js → Plus.es-Bhd-g5AE.js} +1 -1
  9. package/server/client/dist/assets/{Reminders-06CF__C2.js → Reminders-huKwxqd6.js} +1 -1
  10. package/server/client/dist/assets/{Search-DtLyJR_o.js → Search-BsSLNGNy.js} +1 -1
  11. package/server/client/dist/assets/{SurfaceCard-C7ZAzggM.js → SurfaceCard-D818ic_m.js} +1 -1
  12. package/server/client/dist/assets/{Tag-KGPO2bT9.js → Tag-e0SLJ_ZM.js} +1 -1
  13. package/server/client/dist/assets/{TagNotes-CkmcnqM6.js → TagNotes-BazFumXJ.js} +1 -1
  14. package/server/client/dist/assets/{Trash.es-CerlaxH9.js → Trash.es-vdyjYO7w.js} +1 -1
  15. package/server/client/dist/assets/ViewNotes-Bs9GD1Xm.js +1 -0
  16. package/server/client/dist/assets/ViewSectionTableRenderer-BLGnO1Bi.js +102 -0
  17. package/server/client/dist/assets/Views-7eBt89wS.js +1 -0
  18. package/server/client/dist/assets/{image.api-C6RG15TF.js → image.api-CBdSbIQC.js} +1 -1
  19. package/server/client/dist/assets/{index-Biw4vuiN.css → index-BBypj2WL.css} +1 -1
  20. package/server/client/dist/assets/{index-_FcT3AuV.js → index-BjJlPvLZ.js} +35 -35
  21. package/server/client/dist/assets/{index-CbhzIgIR.js → index-Dg5dH_cy.js} +1 -1
  22. package/server/client/dist/assets/{manage-image-mHebal-S.js → manage-image-DiRFDinY.js} +1 -1
  23. package/server/client/dist/assets/{manage-image-detail-CImm-cQJ.js → manage-image-detail-B6crq-X5.js} +1 -1
  24. package/server/client/dist/assets/{mcp-CHthNSpj.js → mcp-DFrfTamn.js} +1 -1
  25. package/server/client/dist/assets/{note-core-DMZcZ4yV.js → note-core-Z6kqulGB.js} +53 -53
  26. package/server/client/dist/assets/{note-vendor-uuJO2MTD.js → note-vendor-i1M2FSI2.js} +1 -1
  27. package/server/client/dist/assets/{placeholder-BMXsrVZ1.js → placeholder-B-uiiS2o.js} +1 -1
  28. package/server/client/dist/assets/{properties-DRB3IoO1.js → properties-D8v-iyhQ.js} +1 -1
  29. package/server/client/dist/assets/{trash-Dw2FQsut.js → trash-iAbrwiEg.js} +1 -1
  30. package/server/client/dist/assets/{useReminderMutate-C3GYwXa0.js → useReminderMutate-CYUAO2pX.js} +1 -1
  31. package/server/client/dist/index.html +4 -4
  32. package/server/dist/modules/blocknote.js +1 -1
  33. package/server/dist/modules/blocknote.js.map +1 -1
  34. package/server/client/dist/assets/ViewNotes-Khdg4Ynn.js +0 -1
  35. package/server/client/dist/assets/ViewSectionTableRenderer-BMlCUDvj.js +0 -102
  36. package/server/client/dist/assets/Views-BLUk_24_.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-BuHuea3u.js","assets/note-vendor-uuJO2MTD.js","assets/graph-vendor-CUxe67Lr.js","assets/note-core-DMZcZ4yV.js","assets/Callout-B-Y15DKd.js","assets/Views-BLUk_24_.js","assets/ViewSectionTableRenderer-BMlCUDvj.js","assets/SurfaceCard-C7ZAzggM.js","assets/Plus.es-2XIq0eEW.js","assets/Reminders-06CF__C2.js","assets/useReminderMutate-C3GYwXa0.js","assets/Graph-BddGuIWA.js","assets/Search-DtLyJR_o.js","assets/Tag-KGPO2bT9.js","assets/Note-Dl6-yoQO.js","assets/image.api-C6RG15TF.js","assets/TagNotes-CkmcnqM6.js","assets/ViewNotes-Khdg4Ynn.js","assets/index-CbhzIgIR.js","assets/Trash.es-CerlaxH9.js","assets/Image.es-DWOPKZ3F.js","assets/mcp-CHthNSpj.js","assets/trash-Dw2FQsut.js","assets/manage-image-mHebal-S.js","assets/Image-DK0lnaK2.js","assets/manage-image-detail-CImm-cQJ.js","assets/properties-DRB3IoO1.js","assets/placeholder-BMXsrVZ1.js"])))=>i.map(i=>d[i]);
2
- import{j as h,w as Wp,r as $t,R as Xl,a as Ya,c as Gp,u as Yp,o as Qp,s as Xp,f as Jp,b as e1,d as t1,h as n1,e as r1,l as o1,_ as Ze,g as s1}from"./note-vendor-uuJO2MTD.js";import{a as c,R as zo,N as M,g as Ir,r as a1,P as xe}from"./graph-vendor-CUxe67Lr.js";import"./note-core-DMZcZ4yV.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const Qa={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},Jl=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,Xa=(e,t,n=!0)=>{const r=Jl(e);n&&t(r?.matches||!1);const o=s=>{t?.(s.matches)};return r?.addEventListener("change",o),()=>{r?.removeEventListener("change",o)}},i1=(e,t=!0)=>Xa(Qa.DARK,e,t),c1=(e,t,n=!0)=>Xa(Qa.RESPONSIVE(e),t,n),l1={MEDIA_QUERY:Qa,listenThemeChange:i1,listenResponsiveChange:c1,createMediaQuery:Jl,listenMediaQueryChange:Xa};var Ee=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Ee||{});function eu({update:e,notify:t,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:a,shallowPropagate:i};function r(u,f,d){const p=f.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:f.deps;if(m!==void 0&&m.dep===u){m.version=d,f.depsTail=m;return}const v=u.subsTail;if(v!==void 0&&v.version===d&&v.sub===f)return;const g=f.depsTail=u.subsTail={version:d,dep:u,sub:f,prevDep:p,nextDep:m,prevSub:v,nextSub:void 0};m!==void 0&&(m.prevDep=g),p!==void 0?p.nextDep=g:f.deps=g,v!==void 0?v.nextSub=g:u.subs=g}function o(u,f=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,v=u.nextSub,g=u.prevSub;return m!==void 0?m.prevDep=p:f.depsTail=p,p!==void 0?p.nextDep=m:f.deps=m,v!==void 0?v.prevSub=g:d.subsTail=g,g!==void 0?g.nextSub=v:(d.subs=v)===void 0&&n(d),m}function s(u){let f=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&t(p),m&1){const v=p.subs;if(v!==void 0){const g=(u=v).nextSub;g!==void 0&&(d={value:f,prev:d},f=g);continue}}if((u=f)!==void 0){f=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){f=u.nextSub;continue e}break}while(!0)}function a(u,f){let d,p=0,m=!1;e:do{const v=u.dep,g=v.flags;if(f.flags&16)m=!0;else if((g&17)===17){if(e(v)){const y=v.subs;y.nextSub!==void 0&&i(y),m=!0}}else if((g&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=v.deps,f=v,++p;continue}if(!m){const y=u.nextDep;if(y!==void 0){u=y;continue}}for(;p--;){const y=f.subs,b=y.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=y,m){if(e(f)){b&&i(y),f=u.sub;continue}m=!1}else f.flags&=-33;f=u.sub;const x=u.nextDep;if(x!==void 0){u=x;continue e}}return m}while(!0)}function i(u){do{const f=u.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&t(f))}while((u=u.nextSub)!==void 0)}function l(u,f){let d=f.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}let Ja=0,rn=0,mr=0;const kt=[],{link:FC,unlink:tu,propagate:$C,checkDirty:u1,shallowPropagate:HC}=eu({update(e){return e.depsTail!==void 0?p1(e):m1(e)},notify(e){let t=mr,n=t;do if(kt[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(mr=t;n<--t;){const r=kt[n];kt[n++]=kt[t],kt[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ko(e)):y1.call(e)}});function d1(){return Ja}function f1(){++Ja}function h1(){--Ja||v1()}function p1(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Ko(e)}}function m1(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function g1(e){const t=e.flags;if(t&16||t&32&&u1(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Ko(e)}}else e.flags=2}function v1(){try{for(;rn<mr;){const e=kt[rn];kt[rn++]=void 0,g1(e)}}finally{for(;rn<mr;){const e=kt[rn];kt[rn++]=void 0,e.flags|=10}rn=0,mr=0}}function y1(){this.depsTail=void 0,this.flags=0,Ko(this);const e=this.subs;e!==void 0&&tu(e)}function Ko(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=tu(n,e)}function ei(e,t,n){const r=typeof e=="object",o=r?e:void 0;return{next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}const ca=[];let fo=0;const{link:ac,unlink:b1,propagate:x1,checkDirty:nu,shallowPropagate:ic}=eu({update(e){return e._update()},notify(e){ca[la++]=e,e.flags&=~Ee.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ee.Mutable|Ee.Dirty,wo(e))}});let Qr=0,la=0,At;function wo(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=b1(n,e)}function ru(){if(!(d1()>0)){for(;Qr<la;){const e=ca[Qr];ca[Qr++]=void 0,e.notify()}Qr=0,la=0}}function ou(e,t){const n=typeof e=="function",r=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Ee.None:Ee.Mutable,get(){return At!==void 0&&ac(o,At,fo),o._snapshot},subscribe(s){const a=ei(s),i={current:!1},l=w1(()=>{o.get(),i.current?a.next?.(o._snapshot):i.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(s){const a=At,i=Object.is;if(n)At=o,++fo,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=Ee.Mutable|Ee.RecursedCheck);try{const l=o._snapshot,u=typeof s=="function"?s(l):s===void 0&&n?r(l):s;return l===void 0||!i(l,u)?(o._snapshot=u,!0):!1}finally{At=a,n&&(o.flags&=~Ee.RecursedCheck),wo(o)}}};return n?(o.flags=Ee.Mutable|Ee.Dirty,o.get=function(){const s=o.flags;if(s&Ee.Dirty||s&Ee.Pending&&nu(o.deps,o)){if(o._update()){const a=o.subs;a!==void 0&&ic(a)}}else s&Ee.Pending&&(o.flags=s&~Ee.Pending);return At!==void 0&&ac(o,At,fo),o._snapshot}):o.set=function(s){if(o._update(s)){const a=o.subs;a!==void 0&&(x1(a),ic(a),ru())}},o}function w1(e){const t=()=>{const r=At;At=n,++fo,n.depsTail=void 0,n.flags=Ee.Watching|Ee.RecursedCheck;try{return e()}finally{At=r,n.flags&=~Ee.RecursedCheck,wo(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ee.Watching|Ee.RecursedCheck,notify(){const r=this.flags;r&Ee.Dirty||r&Ee.Pending&&nu(this.deps,this)?t():this.flags=Ee.Watching},stop(){this.flags=Ee.None,this.depsTail=void 0,wo(this)}};return t(),n}class E1{constructor(t){this.atom=ou(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ei(t))}}class S1{constructor(t){this.atom=ou(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ei(t))}}function R1(e){return typeof e=="function"?new S1(e):new E1(e)}function C1(e){try{f1(),e()}finally{h1(),ru()}}const Yt="__TSR_index",cc="popstate",lc="beforeunload";function A1(e){let t=e.getLocation();const n=new Set,r=a=>{t=e.getLocation(),n.forEach(i=>i({location:t,action:a}))},o=a=>{e.notifyOnIndexChange??!0?r(a):t=e.getLocation()},s=async({task:a,navigateOpts:i,...l})=>{if(i?.ignoreBlocker??!1){a();return}const f=e.getBlockers?.()??[],d=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&f.length&&d)for(const p of f){const m=Eo(l.path,l.state);if(await p.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,i,l)=>{const u=t.state[Yt];i=uc(u+1,i),s({task:()=>{e.pushState(a,i),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:i})},replace:(a,i,l)=>{const u=t.state[Yt];i=uc(u,i),s({task:()=>{e.replaceState(a,i),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:i})},go:(a,i)=>{s({task:()=>{e.go(a),o({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Yt]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const i=e.getBlockers?.()??[];return e.setBlockers([...i,a]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(u=>u!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function uc(e,t){t||(t={});const n=ti();return{...t,key:n,__TSR_key:n,[Yt]:e}}function T1(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const s=()=>o,a=S=>o=S,i=(S=>S),l=(()=>Eo(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const S=ti();t.history.replaceState({[Yt]:0,key:S,__TSR_key:S},"")}let u=l(),f,d=!1,p=!1,m=!1,v=!1;const g=()=>u;let y,b;const x=()=>{y&&(C._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),C._ignoreSubscribers=!1,y=void 0,b=void 0,f=void 0)},w=(S,N,I)=>{const P=i(N);b||(f=u),u=Eo(N,I),y={href:P,state:I,isPush:y?.isPush||S==="push"},b||(b=Promise.resolve().then(()=>x()))},E=S=>{u=l(),C.notify({type:S})},T=async()=>{if(p){p=!1;return}const S=l(),N=S.state[Yt]-u.state[Yt],I=N===1,P=N===-1,H=!I&&!P||d;d=!1;const z=H?"GO":P?"BACK":"FORWARD",L=H?{type:"GO",index:N}:{type:P?"BACK":"FORWARD"};if(m)m=!1;else{const k=s();if(typeof document<"u"&&k.length){for(const A of k)if(await A.blockerFn({currentLocation:u,nextLocation:S,action:z})){p=!0,t.history.go(1),C.notify(L);return}}}u=l(),C.notify(L)},O=S=>{if(v){v=!1;return}let N=!1;const I=s();if(typeof document<"u"&&I.length)for(const P of I){const H=P.enableBeforeUnload??!0;if(H===!0){N=!0;break}if(typeof H=="function"&&H()===!0){N=!0;break}}if(N)return S.preventDefault(),S.returnValue=""},C=A1({getLocation:g,getLength:()=>t.history.length,pushState:(S,N)=>w("push",S,N),replaceState:(S,N)=>w("replace",S,N),back:S=>(S&&(m=!0),v=!0,t.history.back()),forward:S=>{S&&(m=!0),v=!0,t.history.forward()},go:S=>{d=!0,t.history.go(S)},createHref:S=>i(S),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(lc,O,{capture:!0}),t.removeEventListener(cc,T)},onBlocked:()=>{f&&u!==f&&(u=f)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(lc,O,{capture:!0}),t.addEventListener(cc,T),t.history.pushState=function(...S){const N=n.apply(t.history,S);return C._ignoreSubscribers||E("PUSH"),N},t.history.replaceState=function(...S){const N=r.apply(t.history,S);return C._ignoreSubscribers||E("REPLACE"),N},C}function P1(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Eo(e,t){const n=P1(e),r=n.indexOf("#"),o=n.indexOf("?"),s=ti();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[Yt]:0,key:s,__TSR_key:s}}}function ti(){return(Math.random()+1).toString(36).substring(7)}const M1=!1;function gr(e){let t;return C1(()=>{t=e()}),t}function wr(e){return e[e.length-1]}function _1(e){return typeof e=="function"}function Wt(e,t){return _1(e)?e(t):e}const N1=Object.prototype.hasOwnProperty,dc=Object.prototype.propertyIsEnumerable;function st(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=pc(e)&&pc(r);if(!o&&!(So(e)&&So(r)))return r;const s=o?e:fc(e);if(!s)return r;const a=o?r:fc(r);if(!a)return r;const i=s.length,l=a.length,u=o?new Array(l):{};let f=0;for(let d=0;d<l;d++){const p=o?d:a[d],m=e[p],v=r[p];if(m===v){u[p]=m,(o?d<i:N1.call(e,p))&&f++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){u[p]=v;continue}const g=st(m,v,n+1);u[p]=g,g===m&&f++}return i===l&&f===i?e:u}function fc(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!dc.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!dc.call(e,o))return!1;r.push(o)}return r}function So(e){if(!hc(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!hc(n)||!n.hasOwnProperty("isPrototypeOf"))}function hc(e){return Object.prototype.toString.call(e)==="[object Object]"}function pc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ln(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!ln(e[r],t[r],n))return!1;return!0}if(So(e)&&So(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in t)if((!r||t[a]!==void 0)&&!ln(e[a],t[a],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&o++;let s=0;for(const a in t)if((!r||t[a]!==void 0)&&(s++,s>o||!ln(e[a],t[a],n)))return!1;return o===s}return!1}function Zn(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function O1(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Er(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function I1(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function mc(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return I1(t)}const D1=["http:","https:","mailto:","tel:"];function Ro(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function sr(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=mc(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+mc(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function L1(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var j1="Invariant failed";function Jt(e,t){if(!e)throw new Error(j1)}function Co(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const a=t.get(s);if(a)return o(a),a.value},set(s,a){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const i=t.get(s);if(i)i.value=a,o(i);else{const l={key:s,value:a,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(s,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const Un=0,hn=1,pn=2,Sr=3,on=4,su=5;function k1(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function ni(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=Un,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const i=e.length;return n[0]=pn,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}if(s.charCodeAt(0)===36)return n[0]=hn,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const a=k1(s);if(a){const[i,l]=a,u=s.charCodeAt(i+1);if(u===45){if(i+2<s.length&&s.charCodeAt(i+2)===36){const f=i+3,d=l;if(f<d)return n[0]=Sr,n[1]=t+i,n[2]=t+f,n[3]=t+d,n[4]=t+l+1,n[5]=o,n}}else if(u===36){const f=i+1,d=i+2;return d===l?(n[0]=pn,n[1]=t+i,n[2]=t+f,n[3]=t+d,n[4]=t+l+1,n[5]=e.length,n):(n[0]=hn,n[1]=t+i,n[2]=t+d,n[3]=t+l,n[4]=t+l+1,n[5]=o,n)}}return n[0]=Un,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function Wo(e,t,n,r,o,s,a){a?.(n);let i=r;{const l=n.fullPath??n.from,u=l.length,f=n.options?.caseSensitive??e,d=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;i<u;){const m=ni(l,i,t);let v;const g=i,y=m[5];switch(i=y+1,s++,m[0]){case Un:{const x=l.substring(m[2],m[3]);if(f){const w=o.static?.get(x);if(w)v=w;else{o.static??=new Map;const E=sn(n.fullPath??n.from);E.parent=o,E.depth=s,v=E,o.static.set(x,E)}}else{const w=x.toLowerCase(),E=o.staticInsensitive?.get(w);if(E)v=E;else{o.staticInsensitive??=new Map;const T=sn(n.fullPath??n.from);T.parent=o,T.depth=s,v=T,o.staticInsensitive.set(w,T)}}break}case hn:{const x=l.substring(g,m[1]),w=l.substring(m[4],y),E=f&&!!(x||w),T=x?E?x:x.toLowerCase():void 0,O=w?E?w:w.toLowerCase():void 0,C=!d&&o.dynamic?.find(S=>!S.skipOnParamError&&S.caseSensitive===E&&S.prefix===T&&S.suffix===O);if(C)v=C;else{const S=Ds(hn,n.fullPath??n.from,E,T,O);v=S,S.depth=s,S.parent=o,o.dynamic??=[],o.dynamic.push(S)}break}case Sr:{const x=l.substring(g,m[1]),w=l.substring(m[4],y),E=f&&!!(x||w),T=x?E?x:x.toLowerCase():void 0,O=w?E?w:w.toLowerCase():void 0,C=!d&&o.optional?.find(S=>!S.skipOnParamError&&S.caseSensitive===E&&S.prefix===T&&S.suffix===O);if(C)v=C;else{const S=Ds(Sr,n.fullPath??n.from,E,T,O);v=S,S.parent=o,S.depth=s,o.optional??=[],o.optional.push(S)}break}case pn:{const x=l.substring(g,m[1]),w=l.substring(m[4],y),E=f&&!!(x||w),T=x?E?x:x.toLowerCase():void 0,O=w?E?w:w.toLowerCase():void 0,C=Ds(pn,n.fullPath??n.from,E,T,O);v=C,C.parent=o,C.depth=s,o.wildcard??=[],o.wildcard.push(C)}}o=v}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const m=sn(n.fullPath??n.from);m.kind=su,m.parent=o,s++,m.depth=s,o.pathless??=[],o.pathless.push(m),o=m}const p=(n.path||!n.children)&&!n.isRoot;if(p&&l.endsWith("/")){const m=sn(n.fullPath??n.from);m.kind=on,m.parent=o,s++,m.depth=s,o.index=m,o=m}o.parse=n.options?.params?.parse??null,o.skipOnParamError=d,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,p&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const l of n.children)Wo(e,t,l,i,o,s,a)}function Is(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function zt(e){if(e.pathless)for(const t of e.pathless)zt(t);if(e.static)for(const t of e.static.values())zt(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())zt(t);if(e.dynamic?.length){e.dynamic.sort(Is);for(const t of e.dynamic)zt(t)}if(e.optional?.length){e.optional.sort(Is);for(const t of e.optional)zt(t)}if(e.wildcard?.length){e.wildcard.sort(Is);for(const t of e.wildcard)zt(t)}}function sn(e){return{kind:Un,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Ds(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function F1(e,t){const n=sn("/"),r=new Uint16Array(6);for(const o of e)Wo(!1,r,o,1,n,0);zt(n),t.masksTree=n,t.flatCache=Co(1e3)}function $1(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=ri(e,t.masksTree);return t.flatCache.set(e,r),r}function H1(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let a=o.singleCache.get(s);if(!a){a=sn("/");const i=new Uint16Array(6);Wo(t,i,{from:e},1,a,0),o.singleCache.set(s,a)}return ri(r,a,n)}function B1(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=ri(e,t.segmentTree,n)}catch(a){if(a instanceof URIError)s=null;else throw a}return s&&(s.branch=U1(s.route)),t.matchCache.set(r,s),s}function V1(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Z1(e,t=!1,n){const r=sn(e.fullPath),o=new Uint16Array(6),s={},a={};let i=0;return Wo(t,o,e,1,r,0,u=>{if(n?.(u,i),Jt(!(u.id in s),`Duplicate routes found with id: ${String(u.id)}`),s[u.id]=u,i!==0&&u.path){const f=V1(u.fullPath);(!a[f]||u.fullPath.endsWith("/"))&&(a[f]=u)}i++}),zt(r),{processedTree:{segmentTree:r,singleCache:Co(1e3),matchCache:Co(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:a}}function ri(e,t,n=!1){const r=e.split("/"),o=z1(e,r,t,n);if(!o)return null;const[s]=au(e,r,o);return{route:o.node.route,rawParams:s,parsedParams:o.parsedParams}}function au(e,t,n){const r=q1(n.node);let o=null;const s={};let a=n.extract?.part??0,i=n.extract?.node??0,l=n.extract?.path??0,u=n.extract?.segment??0;for(;i<r.length;a++,i++,l++,u++){const f=r[i];if(f.kind===on)break;if(f.kind===su){u--,a--,l--;continue}const d=t[a],p=l;if(d&&(l+=d.length),f.kind===hn){o??=n.node.fullPath.split("/");const m=o[u],v=f.prefix?.length??0;if(m.charCodeAt(v)===123){const y=f.suffix?.length??0,b=m.substring(v+2,m.length-y-1),x=d.substring(v,d.length-y);s[b]=decodeURIComponent(x)}else{const y=m.substring(1);s[y]=decodeURIComponent(d)}}else if(f.kind===Sr){if(n.skipped&1<<i){a--,l=p-1;continue}o??=n.node.fullPath.split("/");const m=o[u],v=f.prefix?.length??0,g=f.suffix?.length??0,y=m.substring(v+3,m.length-g-1),b=f.suffix||f.prefix?d.substring(v,d.length-g):d;b&&(s[y]=decodeURIComponent(b))}else if(f.kind===pn){const m=f,v=e.substring(p+(m.prefix?.length??0),e.length-(m.suffix?.length??0)),g=decodeURIComponent(v);s["*"]=g,s._splat=g;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:a,node:i,path:l,segment:u}]}function U1(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function q1(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function z1(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!wr(t),s=o&&e!=="/",a=t.length-(o?1:0),i=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,u=null,f=null;for(;i.length;){const d=i.pop(),{node:p,index:m,skipped:v,depth:g,statics:y,dynamics:b,optionals:x}=d;let{extract:w,rawParams:E,parsedParams:T}=d;if(p.skipOnParamError){if(!Ls(e,t,d))continue;E=d.rawParams,w=d.extract,T=d.parsedParams}r&&p.route&&p.kind!==on&&ar(u,d)&&(u=d);const O=m===a;if(O&&(p.route&&!s&&ar(f,d)&&(f=d),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const C=O?void 0:t[m];let S;if(O&&p.index){const N={node:p.index,index:m,skipped:v,depth:g+1,statics:y,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T};let I=!0;if(p.index.skipOnParamError&&(Ls(e,t,N)||(I=!1)),I){if(y===a&&!b&&!x&&!v)return N;ar(f,N)&&(f=N)}}if(p.wildcard&&ar(l,d))for(const N of p.wildcard){const{prefix:I,suffix:P}=N;if(I&&(O||!(N.caseSensitive?C:S??=C.toLowerCase()).startsWith(I)))continue;if(P){if(O)continue;const z=t.slice(m).join("/").slice(-P.length);if((N.caseSensitive?z:z.toLowerCase())!==P)continue}const H={node:N,index:a,skipped:v,depth:g,statics:y,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T};if(!(N.skipOnParamError&&!Ls(e,t,H))){l=H;break}}if(p.optional){const N=v|1<<g,I=g+1;for(let P=p.optional.length-1;P>=0;P--){const H=p.optional[P];i.push({node:H,index:m,skipped:N,depth:I,statics:y,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T})}if(!O)for(let P=p.optional.length-1;P>=0;P--){const H=p.optional[P],{prefix:z,suffix:L}=H;if(z||L){const k=H.caseSensitive?C:S??=C.toLowerCase();if(z&&!k.startsWith(z)||L&&!k.endsWith(L))continue}i.push({node:H,index:m+1,skipped:v,depth:I,statics:y,dynamics:b,optionals:x+1,extract:w,rawParams:E,parsedParams:T})}}if(!O&&p.dynamic&&C)for(let N=p.dynamic.length-1;N>=0;N--){const I=p.dynamic[N],{prefix:P,suffix:H}=I;if(P||H){const z=I.caseSensitive?C:S??=C.toLowerCase();if(P&&!z.startsWith(P)||H&&!z.endsWith(H))continue}i.push({node:I,index:m+1,skipped:v,depth:g+1,statics:y,dynamics:b+1,optionals:x,extract:w,rawParams:E,parsedParams:T})}if(!O&&p.staticInsensitive){const N=p.staticInsensitive.get(S??=C.toLowerCase());N&&i.push({node:N,index:m+1,skipped:v,depth:g+1,statics:y+1,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T})}if(!O&&p.static){const N=p.static.get(C);N&&i.push({node:N,index:m+1,skipped:v,depth:g+1,statics:y+1,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T})}if(p.pathless){const N=g+1;for(let I=p.pathless.length-1;I>=0;I--){const P=p.pathless[I];i.push({node:P,index:m,skipped:v,depth:N,statics:y,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T})}}}if(f&&l)return ar(l,f)?f:l;if(f)return f;if(l)return l;if(r&&u){let d=u.index;for(let m=0;m<u.index;m++)d+=t[m].length;const p=d===e.length?"/":e.slice(d);return u.rawParams??={},u.rawParams["**"]=decodeURIComponent(p),u}return null}function Ls(e,t,n){try{const[r,o]=au(e,t,n);n.rawParams=r,n.extract=o;const s=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,s),!0}catch{return null}}function ar(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===on)>(e.node.kind===on)||t.node.kind===on==(e.node.kind===on)&&t.depth>e.depth))):!0}function ho(e){return oi(e.filter(t=>t!==void 0).join("/"))}function oi(e){return e.replace(/\/{2,}/g,"/")}function iu(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Qt(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function cu(e){return Qt(iu(e))}function Ao(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function K1(e,t,n){return Ao(e,n)===Ao(t,n)}function W1({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let a;if(r){a=o?t:s?e:e+"\0"+t;const d=r.get(a);if(d)return d}let i;if(s)i=e.split("/");else if(o)i=t.split("/");else{for(i=e.split("/");i.length>1&&wr(i)==="";)i.pop();const d=t.split("/");for(let p=0,m=d.length;p<m;p++){const v=d[p];v===""?p?p===m-1&&i.push(v):i=[v]:v===".."?i.pop():v==="."||i.push(v)}}i.length>1&&(wr(i)===""?n==="never"&&i.pop():n==="always"&&i.push(""));let l,u="";for(let d=0;d<i.length;d++){d>0&&(u+="/");const p=i[d];if(!p)continue;l=ni(p,0,l);const m=l[0];if(m===Un){u+=p;continue}const v=l[5],g=p.substring(0,l[1]),y=p.substring(l[4],v),b=p.substring(l[2],l[3]);m===hn?u+=g||y?`${g}{$${b}}${y}`:`$${b}`:m===pn?u+=g||y?`${g}{$}${y}`:"$":u+=`${g}{-$${b}}${y}`}u=oi(u);const f=u||"/";return a&&r&&r.set(a,f),f}function G1(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function js(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>vc(o,n)).join("/"):vc(r,n)}function gc({path:e,params:t,decoder:n,...r}){let o=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const a=e.length;let i=0,l,u="";for(;i<a;){const d=i;l=ni(e,d,l);const p=l[5];if(i=p+1,d===p)continue;const m=l[0];if(m===Un){u+="/"+e.substring(d,p);continue}if(m===pn){const v=t._splat;s._splat=v,s["*"]=v;const g=e.substring(d,l[1]),y=e.substring(l[4],p);if(!v){o=!0,(g||y)&&(u+="/"+g+y);continue}const b=js("_splat",t,n);u+="/"+g+b+y;continue}if(m===hn){const v=e.substring(l[2],l[3]);!o&&!(v in t)&&(o=!0),s[v]=t[v];const g=e.substring(d,l[1]),y=e.substring(l[4],p),b=js(v,t,n)??"undefined";u+="/"+g+b+y;continue}if(m===Sr){const v=e.substring(l[2],l[3]),g=t[v];if(g==null)continue;s[v]=g;const y=e.substring(d,l[1]),b=e.substring(l[4],p),x=js(v,t,n)??"";u+="/"+y+x+b;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:s,interpolatedPath:u||"/",isMissingParams:o}}function vc(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function lu(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function et(e){return!!e?.isNotFound}function Y1(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const ua="tsr-scroll-restoration-v1_3",Q1=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function X1(){const e=Y1();if(!e)return null;const t=e.getItem(ua);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Wt(r,n)||n;try{e.setItem(ua,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Xr=X1(),J1=e=>e.state.__TSR_key||e.href;function em(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let To=!1;function tm({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:o,location:s}){let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(u){console.error(u);return}const i=t||window.history.state?.__TSR_key,l=a[i];To=!0;e:{if(r&&l&&Object.keys(l).length>0){for(const d in l){const p=l[d];if(d==="window")window.scrollTo({top:p.scrollY,left:p.scrollX,behavior:n});else if(d){const m=document.querySelector(d);m&&(m.scrollLeft=p.scrollX,m.scrollTop=p.scrollY)}}break e}const u=(s??window.location).hash.split("#",2)[1];if(u){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const p=document.getElementById(u);p&&p.scrollIntoView(d)}break e}const f={top:0,left:0,behavior:n};if(window.scrollTo(f),o)for(const d of o){if(d==="window")continue;const p=typeof d=="function"?d():document.querySelector(d);p&&p.scrollTo(f)}}To=!1}function nm(e,t){if(!Xr||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Xr))return;e.isScrollRestorationSetup=!0,To=!1;const r=e.options.getScrollRestorationKey||J1;window.history.scrollRestoration="manual";const o=s=>{if(To||!e.isScrollRestoring)return;let a="";if(s.target===document||s.target===window)a="window";else{const l=s.target.getAttribute("data-scroll-restoration-id");l?a=`[data-scroll-restoration-id="${l}"]`:a=em(s.target)}const i=r(e.state.location);Xr.set(l=>{const u=l[i]||={},f=u[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const d=document.querySelector(a);d&&(f.scrollX=d.scrollLeft||0,f.scrollY=d.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",Q1(o,100),!0),e.subscribe("onRendered",s=>{const a=r(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(tm({storageKey:ua,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Xr.set(i=>(i[a]||={},i)))})}function rm(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function om(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function ks(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function sm(e){const t=new URLSearchParams(e),n={};for(const[r,o]of t.entries()){const s=n[r];s==null?n[r]=ks(o):Array.isArray(s)?s.push(ks(o)):n[r]=[s,ks(o)]}return n}const am=cm(JSON.parse),im=lm(JSON.stringify,JSON.parse);function cm(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=sm(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function lm(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const s=om(o,r);return s?`?${s}`:""}}const ft="__root__";function uu(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function at(e){return e instanceof Response&&!!e.options}const da=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Go=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),$n=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let s=0;s<=o;s++){const a=e.matches[s];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},yc=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),o=r>=0?r:0;let s=n?e.matches.findIndex(a=>a.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=o);for(let a=s;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return n?s:o},Gt=(e,t,n)=>{if(!(!at(n)&&!et(n)))throw at(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:at(n)?"redirected":r.status==="pending"?"success":r.status,context:$n(e,t.index),isFetching:!1,error:n})),et(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),at(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},du=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ir=(e,t,n,r)=>{const{id:o,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Gt(e,e.router.getMatch(o),n);try{a.options.onError?.(n)}catch(i){n=i,Gt(e,e.router.getMatch(o),n)}e.updateMatch(o,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!at(n)&&!et(n)&&(e.serialError??=n)},fu=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Go(e,t)&&(n.options.loader||n.options.beforeLoad||pu(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{da(e)},o);r._nonReactive.pendingTimeout=a}},um=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;fu(e,t,n,r);const o=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Gt(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},dm=(e,t,n,r)=>{const o=e.router.getMatch(t),s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Zn(()=>{s?.resolve()});const{paramsError:a,searchError:i}=o;a&&ir(e,n,a,"PARSE_PARAMS"),i&&ir(e,n,i,"VALIDATE_SEARCH"),fu(e,t,r,o);const l=new AbortController;let u=!1;const f=()=>{u||(u=!0,e.updateMatch(t,E=>({...E,isFetching:"beforeLoad",fetchCount:E.fetchCount+1,abortController:l})))},d=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,E=>({...E,isFetching:!1}))};if(!r.options.beforeLoad){gr(()=>{f(),d()});return}o._nonReactive.beforeLoadPromise=Zn();const p={...$n(e,n,!1),...o.__routeContext},{search:m,params:v,cause:g}=o,y=Go(e,t),b={search:m,abortController:l,params:v,preload:y,context:p,location:e.location,navigate:E=>e.router.navigate({...E,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:y?"preload":g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=E=>{if(E===void 0){gr(()=>{f(),d()});return}(at(E)||et(E))&&(f(),ir(e,n,E,"BEFORE_LOAD")),gr(()=>{f(),e.updateMatch(t,T=>({...T,__beforeLoadContext:E})),d()})};let w;try{if(w=r.options.beforeLoad(b),Er(w))return f(),w.catch(E=>{ir(e,n,E,"BEFORE_LOAD")}).then(x)}catch(E){f(),ir(e,n,E,"BEFORE_LOAD")}x(w)},fm=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],s=()=>i(),a=()=>dm(e,n,t,o),i=()=>{if(du(e,n))return;const l=um(e,n,o);return Er(l)?l.then(a):a()};return s()},hm=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([s,a,i])=>{const l=s?.meta,u=s?.links,f=s?.scripts,d=s?.styles;return{meta:l,links:u,headScripts:f,headers:i,scripts:a,styles:d}})},hu=(e,t,n,r,o)=>{const s=t[r-1],{params:a,loaderDeps:i,abortController:l,cause:u}=e.router.getMatch(n),f=$n(e,r),d=Go(e,n);return{params:a,deps:i,preload:!!d,parentMatchPromise:s,abortController:l,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:d?"preload":u,route:o,...e.router.options.additionalContext}},bc=async(e,t,n,r,o)=>{try{const s=e.router.getMatch(n);try{(!(M1??e.router.isServer)||s.ssr===!0)&&Po(o);const a=o.options.loader?.(hu(e,t,n,r,o)),i=o.options.loader&&Er(a);if((i||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,f=>({...f,isFetching:"loader"})),o.options.loader){const f=i?await a:a;Gt(e,e.router.getMatch(n),f),f!==void 0&&e.updateMatch(n,d=>({...d,loaderData:f}))}o._lazyPromise&&await o._lazyPromise;const u=s._nonReactive.minPendingPromise;u&&await u,o._componentsPromise&&await o._componentsPromise,e.updateMatch(n,f=>({...f,error:void 0,context:$n(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let i=a;if(i?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,u=>({...u,status:u.status==="pending"?"success":u.status,isFetching:!1,context:$n(e,r)}));return}const l=s._nonReactive.minPendingPromise;l&&await l,et(a)&&await o.options.notFoundComponent?.preload?.(),Gt(e,e.router.getMatch(n),a);try{o.options.onError?.(a)}catch(u){i=u,Gt(e,e.router.getMatch(n),u)}e.updateMatch(n,u=>({...u,error:i,context:$n(e,r),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Gt(e,a,s)}},pm=async(e,t,n)=>{async function r(d,p,m,v){const g=Date.now()-p.updatedAt,y=d?v.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??e.router.options.defaultStaleTime??0,b=v.options.shouldReload,x=typeof b=="function"?b(hu(e,t,o,n,v)):b,{status:w,invalid:E}=m;a=w==="success"&&(E||(x??g>y)),d&&v.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{try{await bc(e,t,o,n,v);const T=e.router.getMatch(o);T._nonReactive.loaderPromise?.resolve(),T._nonReactive.loadPromise?.resolve(),T._nonReactive.loaderPromise=void 0}catch(T){at(T)&&await e.router.navigate(T.options)}})()):(w!=="success"||a&&e.sync)&&await bc(e,t,o,n,v))}const{id:o,routeId:s}=e.matches[n];let a=!1,i=!1;const l=e.router.looseRoutesById[s];if(!du(e,o)){const d=e.router.getMatch(o),p=Go(e,o);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const m=e.router.getMatch(o),v=m._nonReactive.error||m.error;v&&Gt(e,m,v),m.status==="pending"&&await r(p,d,m,l)}else{const m=p&&!e.router.state.matches.some(g=>g.id===o),v=e.router.getMatch(o);v._nonReactive.loaderPromise=Zn(),m!==v.preload&&e.updateMatch(o,g=>({...g,preload:m})),await r(p,d,v,l)}}const u=e.router.getMatch(o);i||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,i||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const f=i?u.isFetching:!1;return f!==u.isFetching||u.invalid!==!1?(e.updateMatch(o,d=>({...d,isFetching:f,invalid:!1})),e.router.getMatch(o)):u};async function xc(e){const t=e,n=[];t.router.state.matches.some(p=>p._forcePending)&&da(t);let r;for(let p=0;p<t.matches.length;p++){try{const m=fm(t,p);Er(m)&&await m}catch(m){if(at(m))throw m;if(et(m))r=m;else if(!t.preload)throw m;break}if(t.serialError)break}const o=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?yc(t,r):void 0,a=r&&t.preload?0:s!==void 0?Math.min(s+1,o):o;let i,l;for(let p=0;p<a;p++)n.push(pm(t,n,p));try{await Promise.all(n)}catch{const p=await Promise.allSettled(n);for(const m of p){if(m.status!=="rejected")continue;const v=m.reason;if(at(v))throw v;et(v)?i??=v:l??=v}if(l!==void 0)throw l}const u=i??(r&&!t.preload?r:void 0);let f=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!u&&r&&t.preload)return t.matches;if(u){const p=yc(t,u);Jt(p!==void 0);const m=t.matches[p],v=t.router.looseRoutesById[m.routeId],g=t.router.options?.defaultNotFoundComponent;!v.options.notFoundComponent&&g&&(v.options.notFoundComponent=g),u.routeId=m.routeId;const y=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,b=>({...b,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),f=p,await Po(v)}else if(!t.preload){const p=t.matches[0];p.globalNotFound||t.router.getMatch(p.id)?.globalNotFound&&t.updateMatch(p.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const p=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Po(p)}for(let p=0;p<=f;p++){const m=t.matches[p],{id:v,routeId:g}=m,y=t.router.looseRoutesById[g];try{const b=hm(t,v,y);if(b){const x=await b;t.updateMatch(v,w=>({...w,...x}))}}catch(b){console.error(`Error executing head for route ${g}:`,b)}}const d=da(t);if(Er(d)&&await d,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Po(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of mu){const o=e.options[r]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function pu(e){for(const t of mu)if(e.options[t]?.preload)return!0;return!1}const mu=["component","errorComponent","pendingComponent","notFoundComponent"];function mm(e){return{input:({url:t})=>{for(const n of e)t=fa(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=gu(e[n],t);return t}}}function gm(e){const t=cu(e.basepath),n=`/${t}`,r=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===o?a.pathname="/":i.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=ho(["/",t,a.pathname]),a)}}function fa(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function gu(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function un(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,o=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:o,hashChanged:s}}function vm(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class ym{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,a=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=G1(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=T1()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=Co(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=R1(xm(this.latestLocation)),nm(this));let i=!1;const l=this.options.basepath??"/",u=this.options.rewrite;if(s||o!==l||a!==u){this.basepath=l;const p=[],m=cu(l);m&&m!=="/"&&p.push(gm({basepath:l})),u&&p.push(u),this.rewrite=p.length===0?void 0:p.length===1?p[0]:mm(p),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(p=>({...p,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Z1(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&F1(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:l,search:u,hash:f,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const x=this.options.parseSearch(u),w=this.options.stringifySearch(x);return{href:l+w+f,publicHref:d,pathname:sr(l).path,external:!1,searchStr:w,search:st(r?.search,x),hash:sr(f.slice(1)).path,state:st(r?.state,p)}}const m=new URL(d,this.origin),v=fa(this.rewrite,m),g=this.options.parseSearch(v.search),y=this.options.stringifySearch(g);return v.search=y,{href:v.href.replace(v.origin,""),publicHref:d,pathname:sr(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:y,search:st(r?.search,g),hash:sr(v.hash.slice(1)).path,state:st(r?.state,p)}},s=o(n),{__tempLocation:a,__tempKey:i}=s.state;if(a&&(!i||i===this.tempLocationKey)){const l=o(a);return l.state.key=s.state.key,l.state.__TSR_key=s.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>W1({base:n,to:oi(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>wm({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),r=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const r=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);s.from;const l=s.unsafeRelative==="path"?a.pathname:s.from??i.fullPath,u=this.resolvePathWithBase(l,"."),f=i.search,d={...i.params},p=s.to?this.resolvePathWithBase(u,`${s.to}`):this.resolvePathWithBase(u,"."),m=s.params===!1||s.params===null?{}:(s.params??!0)===!0?d:Object.assign(d,Wt(s.params,d)),v=this.getMatchedRoutes(p);let g=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]),Object.keys(m).length>0)for(const P of g){const H=P.options.params?.stringify??P.options.stringifyParams;if(H)try{Object.assign(m,H(m))}catch{}}const b=n.leaveParams?p:sr(gc({path:p,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let x=f;if(n._includeValidateSearch&&this.options.search?.strict){const P={};g.forEach(H=>{if(H.options.validateSearch)try{Object.assign(P,po(H.options.validateSearch,{...P,...x}))}catch{}}),x=P}x=Em({search:x,dest:s,destRoutes:g,_includeValidateSearch:n._includeValidateSearch}),x=st(f,x);const w=this.options.stringifySearch(x),E=s.hash===!0?a.hash:s.hash?Wt(s.hash,a.hash):void 0,T=E?`#${E}`:"";let O=s.state===!0?a.state:s.state?Wt(s.state,a.state):{};O=st(a.state,O);const C=`${b}${w}${T}`;let S,N,I=!1;if(this.rewrite){const P=new URL(C,this.origin),H=gu(this.rewrite,P);S=P.href.replace(P.origin,""),H.origin!==this.origin?(N=H.href,I=!0):N=H.pathname+H.search+H.hash}else S=L1(C),N=S;return{publicHref:N,href:S,pathname:b,search:x,searchStr:w,state:O,hash:E??"",external:I,unmaskOnReload:s.unmaskOnReload}},o=(s={},a)=>{const i=r(s);let l=a?r(a):void 0;if(!l){const u={};if(this.options.routeMasks){const f=$1(i.pathname,this.processedTree);if(f){Object.assign(u,f.rawParams);const{from:d,params:p,...m}=f.route,v=p===!1||p===null?{}:(p??!0)===!0?u:Object.assign(u,Wt(p,u));a={from:n.from,...m,params:v},l=r(a)}}}return l&&(i.maskedLocation=l),i};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{const s=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(f=>{o.state[f]=this.latestLocation.state[f]});const u=ln(o.state,this.latestLocation.state);return l.forEach(f=>{delete o.state[f]}),u},a=Qt(this.latestLocation.href)===Qt(o.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Zn(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:u,...f}=o;l&&(f={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:a,href:i,...l}={})=>{if(i){const d=this.history.location.state.__TSR_index,p=Eo(i,{__TSR_index:n?d:d+1}),m=new URL(p.pathname,this.origin),v=fa(this.rewrite,m);l.to=v.pathname,l.search=this.options.parseSearch(p.search),l.hash=p.hash.slice(1)}const u=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const f=this.commitLocation({...u,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...a})=>{let i=!1;if(o)try{new URL(`${o}`),i=!0}catch{}if(i&&!r&&(r=!0),r){if(n!==void 0||!o){const u=this.buildLocation({to:n,...a});o=o??u.publicHref,s=s??u.publicHref}const l=!i&&s?s:o;if(Ro(l,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const d of f)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...a,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(o=>!n.some(s=>s.id===o.id))}))},this.load=async n=>{let r,o,s;for(s=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,u=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...un({resolvedLocation:u,location:l})}),this.emit({type:"onBeforeLoad",...un({resolvedLocation:u,location:l})}),await xc({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],d=[],p=[],m=[];gr(()=>{this.__store.setState(v=>{const g=v.matches,y=v.pendingMatches||v.matches;return f=g.filter(b=>!y.some(x=>x.id===b.id)),d=g.filter(b=>!y.some(x=>x.routeId===b.routeId)),p=y.filter(b=>!g.some(x=>x.routeId===b.routeId)),m=y.filter(b=>g.some(x=>x.routeId===b.routeId)),{...v,isLoading:!1,loadedAt:Date.now(),matches:y,pendingMatches:void 0,cachedMatches:[...v.cachedMatches,...f.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[d,"onLeave"],[p,"onEnter"],[m,"onStay"]].forEach(([v,g])=>{v.forEach(y=>{this.looseRoutesById[y.routeId].options[g]?.(y)})})})})}})}catch(l){at(l)?(r=l,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):et(l)&&(o=l),this.__store.setState(u=>({...u,statusCode:r?r.status:o?404:u.matches.some(f=>f.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.state.resolvedLocation,i=typeof r.types=="function"?r.types(un({resolvedLocation:a,location:s})):r.types;if(i===!1){n();return}o={update:n,types:i}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(s=>s.id===n)?"pendingMatches":this.state.matches.some(s=>s.id===n)?"matches":this.state.cachedMatches.some(s=>s.id===n)?"cachedMatches":"";o&&(o==="cachedMatches"?this.__store.setState(s=>({...s,cachedMatches:vm(s.cachedMatches.map(a=>a.id===n?r(a):a))})):this.__store.setState(s=>({...s,[o]:s[o]?.map(a=>a.id===n?r(a):a)})))})},this.getMatch=n=>{const r=o=>o.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:o.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(o);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&Ro(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(s=>!r(s))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const s=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=Po,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...s,...this.state.cachedMatches.map(i=>i.id)]);gr(()=>{o.forEach(i=>{a.has(i.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,i]}))})});try{return o=await xc({router:this,matches:o,location:r,preload:!0,updateMatch:(i,l)=>{s.has(i)?o=o.map(u=>u.id===i?l(u):u):this.updateMatch(i,l)}}),o}catch(i){if(at(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:r});et(i)||console.error(i);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const i=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=H1(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!l||n.params&&!ln(l.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?ln(i.search,s.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??im,parseSearch:t.parseSearch??am,protocolAllowlist:t.protocolAllowlist??D1}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:s,parsedParams:a}=r;let{matchedRoutes:i}=r,l=!1;(o?o.path!=="/"&&s["**"]:Qt(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const u=l?Rm(this.options.notFoundMode,i):void 0,f=new Array(i.length),d=new Map(this.state.matches.map(p=>[p.routeId,p]));for(let p=0;p<i.length;p++){const m=i[p],v=f[p-1];let g,y,b;{const L=v?.search??t.search,k=v?._strictSearch??void 0;try{const A=po(m.options.validateSearch,{...L})??void 0;g={...L,...A},y={...k,...A},b=void 0}catch(A){let D=A;if(A instanceof Mo||(D=new Mo(A.message,{cause:A})),n?.throwOnError)throw D;g=L,y={},b=D}}const x=m.options.loaderDeps?.({search:g})??"",w=x?JSON.stringify(x):"",{interpolatedPath:E,usedParams:T}=gc({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),O=m.id+E+w,C=this.getMatch(O),S=d.get(m.id),N=C?._strictParams??T;let I;if(!C)try{wc(m,T,a,N)}catch(L){if(et(L)||at(L)?I=L:I=new bm(L.message,{cause:L}),n?.throwOnError)throw I}Object.assign(s,N);const P=S?"stay":"enter";let H;if(C)H={...C,cause:P,params:S?.params??s,_strictParams:N,search:st(S?S.search:C.search,g),_strictSearch:y};else{const L=m.options.loader||m.options.beforeLoad||m.lazyFn||pu(m)?"pending":"success";H={id:O,ssr:m.options.ssr,index:p,routeId:m.id,params:S?.params??s,_strictParams:N,pathname:E,updatedAt:Date.now(),search:S?st(S.search,g):g,_strictSearch:y,searchError:void 0,status:L,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Zn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:S?st(S.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(H.globalNotFound=u===m.id),H.searchError=b;const z=this.getParentContext(v);H.context={...z,...H.__routeContext,...H.__beforeLoadContext},f[p]=H}for(let p=0;p<f.length;p++){const m=f[p],v=this.looseRoutesById[m.routeId],g=this.getMatch(m.id),y=d.get(m.routeId);if(m.params=y?st(y.params,s):s,!g){const b=f[p-1],x=this.getParentContext(b);if(v.options.context){const w={deps:m.loaderDeps,params:m.params,context:x??{},location:t,navigate:E=>this.navigate({...E,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:f,routeId:v.id};m.__routeContext=v.options.context(w)??void 0}m.context={...x,...m.__routeContext,...m.__beforeLoadContext}}}return f}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:o}=this.getMatchedRoutes(t.pathname),s=wr(n),a={...t.search};for(const f of n)try{Object.assign(a,po(f.options.validateSearch,a))}catch{}const i=wr(this.state.matches),l=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let u;if(l)u=i.params;else{const f={...r};for(const d of n)try{wc(d,r,o??{},f)}catch{}u=f}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:u}}}class Mo extends Error{}class bm extends Error{}function xm(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function po(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Mo("Async validation not supported");if(n.issues)throw new Mo(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function wm({pathname:e,routesById:t,processedTree:n}){const r={},o=Qt(e);let s,a;const i=B1(o,n,!0);return i&&(s=i.route,Object.assign(r,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[ft]],routeParams:r,foundRoute:s,parsedParams:a}}function Em({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Sm(n)(e,t,r??!1)}function Sm(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const s=({search:a,next:i})=>{let l=a;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(l=o.options.preSearchFilters.reduce((f,d)=>d(f),a));const u=i(l);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,d)=>d(f),u):u};t.middlewares.push(s)}if(o.options.validateSearch){const s=({search:a,next:i})=>{const l=i(a);if(!t._includeValidateSearch)return l;try{return{...l,...po(o.options.validateSearch,l)??void 0}}catch{return l}};t.middlewares.push(s)}}const n=({search:o})=>{const s=t.dest;return s.search?s.search===!0?o:Wt(s.search,o):{}};t.middlewares.push(n);const r=(o,s,a)=>{if(o>=a.length)return s;const i=a[o];return i({search:s,next:u=>r(o+1,u,a)})};return function(s,a,i){return t.dest=a,t._includeValidateSearch=i,r(0,s,t.middlewares)}}function Rm(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return ft}function wc(e,t,n,r){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=o(r);Object.assign(r,s)}}const Cm="Error preloading route! ☝️";class vu{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=ft:this.parentRoute||Jt(!1);let s=o?ft:r?.path;s&&s!=="/"&&(s=iu(s));const a=r?.id||s;let i=o?ft:ho([this.parentRoute.id===ft?"":this.parentRoute.id,a]);s===ft&&(s="/"),i!==ft&&(i=ho(["/",i]));const l=i===ft?"/":ho([this.parentRoute.fullPath,s]);this._path=s,this._id=i,this._fullPath=l,this._to=Qt(l)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>uu({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Am{constructor({id:t}){this.notFound=n=>lu({routeId:this.id,...n}),this.redirect=n=>uu({from:this.id,...n}),this.id=t}}class Tm extends vu{constructor(t){super(t)}}const Pm="use",Ec=zo[Pm],Jr=typeof window<"u"?c.useLayoutEffect:c.useEffect;function Fs(e){const t=c.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Mm(e,t,n={},r={}){c.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function _m(e){const t=c.useRef(null);return c.useImperativeHandle(e,()=>t.current,[]),t}function si(e){const t=e.errorComponent??ai;return h.jsx(Nm,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?c.createElement(t,{error:n,reset:r}):e.children})}class Nm extends c.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function ai({error:e}){const[t,n]=c.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function Om({children:e,fallback:t=null}){return yu()?h.jsx(M.Fragment,{children:e}):h.jsx(M.Fragment,{children:t})}function yu(){return M.useSyncExternalStore(Im,()=>!0,()=>!1)}function Im(){return()=>{}}function Dm(e,t){return e===t}function Lm(e,t,n=Dm){const r=c.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:i}=e.subscribe(a);return i},[e]),o=c.useCallback(()=>e?.get(),[e]);return Wp.useSyncExternalStoreWithSelector(r,o,o,t,n)}const bu=c.createContext(null);function Ge(e){const t=c.useContext(bu);return e?.warn,t}function it(e){const t=Ge({warn:e?.router===void 0}),n=e?.router||t,r=c.useRef(void 0);return Lm(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=st(r.current,e.select(o));return r.current=s,s}return e.select(o)}return o})}const Yo=c.createContext(void 0),jm=c.createContext(void 0);function gt(e){const t=c.useContext(e.from?jm:Yo);return it({select:r=>{const o=r.matches.find(s=>e.from?e.from===s.routeId:s.id===t);if(Jt(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Qo(e){return gt({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Xo(e){const{select:t,...n}=e;return gt({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Jo(e){return gt({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function es(e){return gt({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function En(e){const t=Ge();return c.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function km(e,t){const n=Ge(),r=_m(t),{activeProps:o,inactiveProps:s,activeOptions:a,to:i,preload:l,preloadDelay:u,hashScrollIntoView:f,replace:d,startTransition:p,resetScroll:m,viewTransition:v,children:g,target:y,disabled:b,style:x,className:w,onClick:E,onBlur:T,onFocus:O,onMouseEnter:C,onMouseLeave:S,onTouchStart:N,ignoreBlocker:I,params:P,search:H,hash:z,state:L,mask:k,reloadDocument:A,unsafeRelative:D,from:j,_fromLocation:_,...V}=e,K=yu(),Y=it({select:ce=>{const ge=ce.matches[ce.matches.length-1];return{search:ge?.search,hash:ce.location.hash,path:ge?.pathname}},structuralSharing:!0}),B=e.from,q=c.useMemo(()=>({...e,from:B}),[n,Y,B,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),U=c.useMemo(()=>n.buildLocation({...q}),[n,q]),J=U.maskedLocation?U.maskedLocation.publicHref:U.publicHref,$=U.maskedLocation?U.maskedLocation.external:U.external,F=c.useMemo(()=>Zm(J,$,n.history,b),[b,$,J,n.history]),ee=c.useMemo(()=>{if(F?.external)return Ro(F.href,n.protocolAllowlist)?void 0:F.href;if(!Um(i)&&!(typeof i!="string"||i.indexOf(":")===-1))try{return new URL(i),Ro(i,n.protocolAllowlist)?void 0:i}catch{}},[i,F,n.protocolAllowlist]),Z=it({select:ce=>{if(ee)return!1;if(a?.exact){if(!K1(ce.location.pathname,U.pathname,n.basepath))return!1}else{const ge=Ao(ce.location.pathname,n.basepath),Re=Ao(U.pathname,n.basepath);if(!(ge.startsWith(Re)&&(ge.length===Re.length||ge[Re.length]==="/")))return!1}return(a?.includeSearch??!0)&&!ln(ce.location.search,U.search,{partial:!a?.exact,ignoreUndefined:!a?.explicitUndefined})?!1:a?.includeHash?K&&ce.location.hash===U.hash:!0}}),X=Z?Wt(o,{})??Fm:$s,te=Z?$s:Wt(s,{})??$s,ie=[w,X.className,te.className].filter(Boolean).join(" "),ue=(x||X.style||te.style)&&{...x,...X.style,...te.style},[Qe,Fe]=c.useState(!1),qe=c.useRef(!1),ct=e.reloadDocument||ee?!1:l??n.options.defaultPreload,Le=u??n.options.defaultPreloadDelay??0,Ne=c.useCallback(()=>{n.preloadRoute({...q,_builtLocation:U}).catch(ce=>{console.warn(ce),console.warn(Cm)})},[n,q,U]),Zt=c.useCallback(ce=>{ce?.isIntersecting&&Ne()},[Ne]);Mm(r,Zt,Vm,{disabled:!!b||ct!=="viewport"}),c.useEffect(()=>{qe.current||!b&&ct==="render"&&(Ne(),qe.current=!0)},[b,Ne,ct]);const Te=ce=>{const ge=ce.currentTarget.getAttribute("target"),Re=y!==void 0?y:ge;if(!b&&!qm(ce)&&!ce.defaultPrevented&&(!Re||Re==="_self")&&ce.button===0){ce.preventDefault(),$t.flushSync(()=>{Fe(!0)});const ut=n.subscribe("onResolved",()=>{ut(),Fe(!1)});n.navigate({...q,replace:d,resetScroll:m,hashScrollIntoView:f,startTransition:p,viewTransition:v,ignoreBlocker:I})}};if(ee)return{...V,ref:r,href:ee,...g&&{children:g},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...w&&{className:w},...E&&{onClick:E},...T&&{onBlur:T},...O&&{onFocus:O},...C&&{onMouseEnter:C},...S&&{onMouseLeave:S},...N&&{onTouchStart:N}};const lt=ce=>{if(b||ct!=="intent")return;if(!Le){Ne();return}const ge=ce.currentTarget;if(cr.has(ge))return;const Re=setTimeout(()=>{cr.delete(ge),Ne()},Le);cr.set(ge,Re)},An=ce=>{b||ct!=="intent"||Ne()},Tn=ce=>{if(b||!ct||!Le)return;const ge=ce.currentTarget,Re=cr.get(ge);Re&&(clearTimeout(Re),cr.delete(ge))};return{...V,...X,...te,href:F?.href,ref:r,onClick:_n([E,Te]),onBlur:_n([T,Tn]),onFocus:_n([O,lt]),onMouseEnter:_n([C,lt]),onMouseLeave:_n([S,Tn]),onTouchStart:_n([N,An]),disabled:!!b,target:y,...ue&&{style:ue},...ie&&{className:ie},...b&&$m,...Z&&Hm,...K&&Qe&&Bm}}const $s={},Fm={className:"active"},$m={role:"link","aria-disabled":!0},Hm={"data-status":"active","aria-current":"page"},Bm={"data-transitioning":"transitioning"},cr=new WeakMap,Vm={rootMargin:"100px"},_n=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Zm(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Um(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Pt=c.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=km(r,t),a=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:i,...l}=s;return c.createElement("a",l,a)}return c.createElement(n,s,a)});function qm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zm(e){return new Km({id:e})}class Km extends Am{constructor({id:t}){super({id:t}),this.useMatch=n=>gt({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>gt({from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>es({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Jo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Xo({...n,from:this.id,strict:!1}),this.useLoaderData=n=>Qo({...n,from:this.id,strict:!1}),this.useNavigate=()=>{const n=Ge();return En({from:n.routesById[this.id].fullPath})},this.notFound=n=>lu({routeId:this.id,...n}),this.Link=M.forwardRef((n,r)=>{const s=Ge().routesById[this.id].fullPath;return h.jsx(Pt,{ref:r,from:s,...n})})}}let Wm=class extends vu{constructor(t){super(t),this.useMatch=n=>gt({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>gt({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>es({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Jo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Xo({...n,from:this.id}),this.useLoaderData=n=>Qo({...n,from:this.id}),this.useNavigate=()=>En({from:this.fullPath}),this.Link=M.forwardRef((n,r)=>h.jsx(Pt,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function Ie(e){return new Wm(e)}class Gm extends Tm{constructor(t){super(t),this.useMatch=n=>gt({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>gt({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>es({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Jo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Xo({...n,from:this.id}),this.useLoaderData=n=>Qo({...n,from:this.id}),this.useNavigate=()=>En({from:this.fullPath}),this.Link=M.forwardRef((n,r)=>h.jsx(Pt,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Ym(e){return new Gm(e)}function Sc(e){return typeof e=="object"?new Rc(e,{silent:!0}).createRoute(e):new Rc(e,{silent:!0}).createRoute}class Rc{constructor(t,n){this.path=t,this.createRoute=r=>{const o=Ie(r);return o.isRoot=!1,o},this.silent=n?.silent}}class Cc{constructor(t){this.useMatch=n=>gt({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>gt({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>es({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Jo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Xo({...n,from:this.options.id}),this.useLoaderData=n=>Qo({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ge();return En({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Ac(e){return typeof e=="object"?new Cc(e):t=>new Cc({id:e,...t})}function Ue(e,t){let n,r,o,s;const a=()=>(n||(n=e().then(l=>{n=void 0,r=l.default}).catch(l=>{if(o=l,O1(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const u=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(u)||(sessionStorage.setItem(u,"1"),s=!0)}})),n),i=function(u){if(s)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!r)if(Ec)Ec(a());else throw a();return c.createElement(r,u)};return i.preload=a,i}function Qm(){const e=Ge(),t=c.useRef({router:e,mounted:!1}),[n,r]=c.useState(!1),{hasPendingMatches:o,isLoading:s}=it({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(p=>p.status==="pending")}),structuralSharing:!0}),a=Fs(s),i=s||n||o,l=Fs(i),u=s||o,f=Fs(u);return e.startTransition=d=>{r(!0),c.startTransition(()=>{d(),r(!1)})},c.useEffect(()=>{const d=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Qt(e.latestLocation.publicHref)!==Qt(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{d()}},[e,e.history]),Jr(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),Jr(()=>{a&&!s&&e.emit({type:"onLoad",...un(e.state)})},[a,e,s]),Jr(()=>{f&&!u&&e.emit({type:"onBeforeRouteMount",...un(e.state)})},[u,f,e]),Jr(()=>{if(l&&!i){const d=un(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),d.hrefChanged&&rm(e)}},[i,l,e]),null}function Xm(e){const t=it({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(si,{getResetKey:()=>t,onCatch:(n,r)=>{if(et(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(et(n))return e.fallback?.(n);throw n},children:e.children})}function Jm(){return h.jsx("p",{children:"Not Found"})}function jn(e){return h.jsx(h.Fragment,{children:e.children})}function xu(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(Jm,{})}function eg(){return Ge().isScrollRestoring,null}const wu=c.memo(function({matchId:t}){const n=Ge(),r=it({select:g=>{const y=g.matches.findIndex(x=>x.id===t),b=g.matches[y];return Jt(b),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:g.loadedAt,parentRouteId:g.matches[y-1]?.routeId}},structuralSharing:!0}),o=n.routesById[r.routeId],s=o.options.pendingComponent??n.options.defaultPendingComponent,a=s?h.jsx(s,{}):null,i=o.options.errorComponent??n.options.defaultErrorComponent,l=o.options.onCatch??n.options.defaultOnCatch,u=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,f=r.ssr===!1||r.ssr==="data-only",d=(!o.isRoot||o.options.wrapInSuspense||f)&&(o.options.wrapInSuspense??s??(o.options.errorComponent?.preload||f))?c.Suspense:jn,p=i?si:jn,m=u?Xm:jn,v=o.isRoot?o.options.shellComponent??jn:jn;return h.jsxs(v,{children:[h.jsx(Yo.Provider,{value:t,children:h.jsx(d,{fallback:a,children:h.jsx(p,{getResetKey:()=>r.resetKey,errorComponent:i||ai,onCatch:(g,y)=>{if(et(g))throw g;l?.(g,y)},children:h.jsx(m,{fallback:g=>{if(!u||g.routeId&&g.routeId!==r.routeId||!g.routeId&&!o.isRoot)throw g;return c.createElement(u,g)},children:f||r._displayPending?h.jsx(Om,{fallback:a,children:h.jsx(Tc,{matchId:t})}):h.jsx(Tc,{matchId:t})})})})}),r.parentRouteId===ft&&n.options.scrollRestoration?h.jsxs(h.Fragment,{children:[h.jsx(tg,{}),h.jsx(eg,{})]}):null]})});function tg(){const e=Ge(),t=c.useRef(void 0);return h.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...un(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Tc=c.memo(function({matchId:t}){const n=Ge(),{match:r,key:o,routeId:s}=it({select:l=>{const u=l.matches.find(v=>v.id===t),f=u.routeId,p=(n.routesById[f].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:f,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return{key:p?JSON.stringify(p):void 0,routeId:f,match:{id:u.id,status:u.status,error:u.error,invalid:u.invalid,_forcePending:u._forcePending,_displayPending:u._displayPending}}},structuralSharing:!0}),a=n.routesById[s],i=c.useMemo(()=>{const l=a.options.component??n.options.defaultComponent;return l?h.jsx(l,{},o):h.jsx(Eu,{})},[o,a.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const l=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(l){const u=n.getMatch(r.id);if(u&&!u._nonReactive.minPendingPromise){const f=Zn();u._nonReactive.minPendingPromise=f,setTimeout(()=>{f.resolve(),u._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Jt(et(r.error)),xu(n,a,r.error);if(r.status==="redirected")throw Jt(at(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return i}),Eu=c.memo(function(){const t=Ge(),n=c.useContext(Yo),r=it({select:u=>u.matches.find(f=>f.id===n)?.routeId}),o=t.routesById[r],s=it({select:u=>{const d=u.matches.find(p=>p.id===n);return Jt(d),d.globalNotFound}}),a=it({select:u=>{const f=u.matches,d=f.findIndex(p=>p.id===n);return f[d+1]?.id}}),i=t.options.defaultPendingComponent?h.jsx(t.options.defaultPendingComponent,{}):null;if(s)return xu(t,o,void 0);if(!a)return null;const l=h.jsx(wu,{matchId:a});return r===ft?h.jsx(c.Suspense,{fallback:i,children:l}):l});function ng(){const e=Ge(),n=e.routesById[ft].options.pendingComponent??e.options.defaultPendingComponent,r=n?h.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?jn:c.Suspense,s=h.jsxs(o,{fallback:r,children:[h.jsx(Qm,{}),h.jsx(rg,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:s}):s}function rg(){const e=Ge(),t=it({select:o=>o.matches[0]?.id}),n=it({select:o=>o.loadedAt}),r=t?h.jsx(wu,{matchId:t}):null;return h.jsx(Yo.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:h.jsx(si,{getResetKey:()=>n,errorComponent:ai,onCatch:void 0,children:r})})}const og=e=>new sg(e);class sg extends ym{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Sc,globalThis.createLazyFileRoute=Ac):typeof window<"u"&&(window.createFileRoute=Sc,window.createLazyFileRoute=Ac);function ag({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=h.jsx(bu.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:r}):r}function ig({router:e,...t}){return h.jsx(ag,{router:e,...t,children:h.jsx(ng,{})})}function ts(e){return it({select:t=>e?.select?e.select(t.location):t.location})}var Wn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lg=class{#e=cg;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},an=new lg;function ug(e){setTimeout(e,0)}var mn=typeof window>"u"||"Deno"in globalThis;function Ke(){}function dg(e,t){return typeof e=="function"?e(t):e}function ha(e){return typeof e=="number"&&e>=0&&e!==1/0}function Su(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xt(e,t){return typeof e=="function"?e(t):e}function ht(e,t){return typeof e=="function"?e(t):e}function Pc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:a,stale:i}=e;if(a){if(r){if(t.queryHash!==ii(a,t.options))return!1}else if(!Rr(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||o&&o!==t.state.fetchStatus||s&&!s(t))}function Mc(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(gn(t.options.mutationKey)!==gn(s))return!1}else if(!Rr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ii(e,t){return(t?.queryKeyHashFn||gn)(e)}function gn(e){return JSON.stringify(e,(t,n)=>pa(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Rr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Rr(e[n],t[n])):!1}var fg=Object.prototype.hasOwnProperty;function Ru(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=_c(e)&&_c(t);if(!r&&!(pa(e)&&pa(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),i=a.length,l=r?new Array(i):{};let u=0;for(let f=0;f<i;f++){const d=r?f:a[f],p=e[d],m=t[d];if(p===m){l[d]=p,(r?f<s:fg.call(e,d))&&u++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){l[d]=m;continue}const v=Ru(p,m,n+1);l[d]=v,v===p&&u++}return s===i&&u===s?e:l}function _o(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function _c(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pa(e){if(!Nc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Nc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Nc(e){return Object.prototype.toString.call(e)==="[object Object]"}function hg(e){return new Promise(t=>{an.setTimeout(t,e)})}function ma(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ru(e,t):t}function pg(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function mg(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ci=Symbol();function Cu(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ci?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function li(e,t){return typeof e=="function"?e(...t):!!e}function gg(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var vg=class extends Wn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!mn&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ui=new vg;function ga(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var yg=ug;function bg(){let e=[],t=0,n=i=>{i()},r=i=>{i()},o=yg;const s=i=>{t?e.push(i):o(()=>{n(i)})},a=()=>{const i=e;e=[],i.length&&o(()=>{r(()=>{i.forEach(l=>{n(l)})})})};return{batch:i=>{let l;t++;try{l=i()}finally{t--,t||a()}return l},batchCalls:i=>(...l)=>{s(()=>{i(...l)})},schedule:s,setNotifyFunction:i=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{o=i}}}var _e=bg(),xg=class extends Wn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!mn&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},No=new xg;function wg(e){return Math.min(1e3*2**e,3e4)}function Au(e){return(e??"online")==="online"?No.isOnline():!0}var va=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Tu(e){let t=!1,n=0,r;const o=ga(),s=()=>o.status!=="pending",a=g=>{if(!s()){const y=new va(g);p(y),e.onCancel?.(y)}},i=()=>{t=!0},l=()=>{t=!1},u=()=>ui.isFocused()&&(e.networkMode==="always"||No.isOnline())&&e.canRun(),f=()=>Au(e.networkMode)&&e.canRun(),d=g=>{s()||(r?.(),o.resolve(g))},p=g=>{s()||(r?.(),o.reject(g))},m=()=>new Promise(g=>{r=y=>{(s()||u())&&g(y)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),v=()=>{if(s())return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(d).catch(b=>{if(s())return;const x=e.retry??(mn?0:3),w=e.retryDelay??wg,E=typeof w=="function"?w(n,b):w,T=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!T){p(b);return}n++,e.onFail?.(n,b),hg(E).then(()=>u()?void 0:m()).then(()=>{t?p(b):v()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(r?.(),o),cancelRetry:i,continueRetry:l,canStart:f,start:()=>(f()?v():m().then(v),o)}}var Pu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ha(this.gcTime)&&(this.#e=an.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mn?1/0:300*1e3))}clearGcTimeout(){this.#e&&(an.clearTimeout(this.#e),this.#e=void 0)}},Eg=class extends Pu{#e;#t;#n;#o;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Ic(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Ic(this.options);t.data!==void 0&&(this.setState(Oc(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=ma(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Ke).catch(Ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ht(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ci||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Su(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const i=this.observers.find(l=>l.options.queryFn);i&&this.setOptions(i.options)}const n=new AbortController,r=i=>{Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const i=Cu(this.options,t),u=(()=>{const f={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#i=!1,this.options.persister?this.options.persister(i,u,this):i(u)},a=(()=>{const i={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return r(i),i})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=Tu({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:i=>{i instanceof va&&i.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(i,l)=>{this.#s({type:"failed",failureCount:i,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const i=await this.#r.start();if(i===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(i),this.#n.config.onSuccess?.(i,this),this.#n.config.onSettled?.(i,this.state.error,this),i}catch(i){if(i instanceof va){if(i.silent)return this.#r.promise;if(i.revert){if(this.state.data===void 0)throw i;return this.state.data}}throw this.#s({type:"error",error:i}),this.#n.config.onError?.(i,this),this.#n.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Mu(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Oc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),_e.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Mu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Au(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Oc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ic(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var _u=class extends Wn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=ga(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#a;#i;#s;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Dc(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ya(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ya(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ht(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!_o(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Lc(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||ht(this.options.enabled,this.#t)!==ht(t.enabled,this.#t)||Xt(this.options.staleTime,this.#t)!==Xt(t.staleTime,this.#t))&&this.#g();const o=this.#v();r&&(this.#t!==n||ht(this.options.enabled,this.#t)!==ht(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Rg(this,n)&&(this.#o=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ke)),t}#g(){this.#x();const e=Xt(this.options.staleTime,this.#t);if(mn||this.#o.isStale||!ha(e))return;const n=Su(this.#o.dataUpdatedAt,e)+1;this.#l=an.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(mn||ht(this.options.enabled,this.#t)===!1||!ha(this.#c)||this.#c===0)&&(this.#u=an.setInterval(()=>{(this.options.refetchIntervalInBackground||ui.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#l&&(an.clearTimeout(this.#l),this.#l=void 0)}#w(){this.#u&&(an.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#o,s=this.#r,a=this.#a,l=e!==n?e.state:this.#n,{state:u}=e;let f={...u},d=!1,p;if(t._optimisticResults){const S=this.hasListeners(),N=!S&&Dc(e,t),I=S&&Lc(e,n,t,r);(N||I)&&(f={...f,...Mu(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:g}=f;p=f.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&g==="pending"){let S;o?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(S=o.data,y=!0):S=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,S!==void 0&&(g="success",p=ma(o?.data,S,t),d=!0)}if(t.select&&p!==void 0&&!y)if(o&&p===s?.data&&t.select===this.#m)p=this.#f;else try{this.#m=t.select,p=t.select(p),p=ma(o?.data,p,t),this.#f=p,this.#s=null}catch(S){this.#s=S}this.#s&&(m=this.#s,p=this.#f,v=Date.now(),g="error");const b=f.fetchStatus==="fetching",x=g==="pending",w=g==="error",E=x&&b,T=p!==void 0,C={status:g,fetchStatus:f.fetchStatus,isPending:x,isSuccess:g==="success",isError:w,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:w&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&T,isStale:di(e,t),refetch:this.refetch,promise:this.#i,isEnabled:ht(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const S=C.data!==void 0,N=C.status==="error"&&!S,I=z=>{N?z.reject(C.error):S&&z.resolve(C.data)},P=()=>{const z=this.#i=C.promise=ga();I(z)},H=this.#i;switch(H.status){case"pending":e.queryHash===n.queryHash&&I(H);break;case"fulfilled":(N||C.data!==H.value)&&P();break;case"rejected":(!N||C.error!==H.reason)&&P();break}}return C}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),_o(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#p.size)return!0;const s=new Set(o??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#o).some(a=>{const i=a;return this.#o[i]!==e[i]&&s.has(i)})};this.#S({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){_e.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Sg(e,t){return ht(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Dc(e,t){return Sg(e,t)||e.state.data!==void 0&&ya(e,t,t.refetchOnMount)}function ya(e,t,n){if(ht(t.enabled,e)!==!1&&Xt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&di(e,t)}return!1}function Lc(e,t,n,r){return(e!==t||ht(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&di(e,n)}function di(e,t){return ht(t.enabled,e)!==!1&&e.isStaleByTime(Xt(t.staleTime,e))}function Rg(e,t){return!_o(e.getCurrentResult(),t)}function jc(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let i={pages:[],pageParams:[]},l=0;const u=async()=>{let f=!1;const d=v=>{gg(v,()=>t.signal,()=>f=!0)},p=Cu(t.options,t.fetchOptions),m=async(v,g,y)=>{if(f)return Promise.reject();if(g==null&&v.pages.length)return Promise.resolve(v);const x=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return d(O),O})(),w=await p(x),{maxPages:E}=t.options,T=y?mg:pg;return{pages:T(v.pages,w,E),pageParams:T(v.pageParams,g,E)}};if(o&&s.length){const v=o==="backward",g=v?Cg:kc,y={pages:s,pageParams:a},b=g(r,y);i=await m(y,b,v)}else{const v=e??s.length;do{const g=l===0?a[0]??r.initialPageParam:kc(r,i);if(l>0&&g==null)break;i=await m(i,g),l++}while(l<v)}return i};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function kc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Cg(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ag=class extends Pu{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Nu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=Tu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,a)=>{this.#r({type:"failed",failureCount:s,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#o.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:o})}const s=await this.#o.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),_e.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Nu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tg=class extends Wn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new Ag({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=eo(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=eo(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=eo(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=eo(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){_e.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Mc(t,n))}findAll(e={}){return this.getAll().filter(t=>Mc(e,t))}notify(e){_e.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return _e.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ke))))}};function eo(e){return e.options.scope?.id}var Pg=class extends Wn{#e;#t=void 0;#n;#o;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),_o(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&gn(n.mutationKey)!==gn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#o=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??Nu();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){_e.batch(()=>{if(this.#o&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,n,r,o)}catch(s){Promise.reject(s)}try{this.#o.onSettled?.(t.data,null,n,r,o)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,n,r,o)}catch(s){Promise.reject(s)}try{this.#o.onSettled?.(void 0,t.error,n,r,o)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Mg=class extends Wn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??ii(r,t);let s=this.get(o);return s||(s=new Eg({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){_e.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Pc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Pc(e,n)):t}notify(e){_e.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_e.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_e.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_g=class{#e;#t;#n;#o;#r;#a;#i;#s;constructor(e={}){this.#e=e.queryCache||new Mg,this.#t=e.mutationCache||new Tg,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=ui.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=No.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,a=dg(t,s);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _e.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;_e.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return _e.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=_e.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ke).catch(Ke)}invalidateQueries(e,t={}){return _e.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=_e.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ke)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ke)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Xt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ke).catch(Ke)}fetchInfiniteQuery(e){return e.behavior=jc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ke).catch(Ke)}ensureInfiniteQueryData(e){return e.behavior=jc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return No.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(gn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Rr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(gn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Rr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ii(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ci&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ou=c.createContext(void 0),Gn=e=>{const t=c.useContext(Ou);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ng=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(Ou.Provider,{value:e,children:t})),Iu=c.createContext(!1),Og=()=>c.useContext(Iu);Iu.Provider;function Du(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Lu=c.createContext(Du()),Ig=()=>c.useContext(Lu),Dg=({children:e})=>{const[t]=c.useState(()=>Du());return h.jsx(Lu.Provider,{value:t,children:typeof e=="function"?e(t):e})},Lg=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?li(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},jg=e=>{c.useEffect(()=>{e.clearReset()},[e])},kg=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||li(n,[e.error,r])),Fg=(e,t)=>t.state.data===void 0,$g=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Hg=(e,t)=>e.isLoading&&e.isFetching&&!t,Bg=(e,t)=>e?.suspense&&t.isPending,Fc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ju(e,t,n){const r=Og(),o=Ig(),s=Gn(),a=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const i=s.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",$g(a),Lg(a,o,i),jg(o);const l=!s.getQueryCache().get(a.queryHash),[u]=c.useState(()=>new t(s,a)),f=u.getOptimisticResult(a),d=!r&&e.subscribed!==!1;if(c.useSyncExternalStore(c.useCallback(p=>{const m=d?u.subscribe(_e.batchCalls(p)):Ke;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c.useEffect(()=>{u.setOptions(a)},[a,u]),Bg(a,f))throw Fc(a,u,o);if(kg({result:f,errorResetBoundary:o,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,f),a.experimental_prefetchInRender&&!mn&&Hg(f,r)&&(l?Fc(a,u,o):i?.promise)?.catch(Ke).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?f:u.trackResult(f)}function Vg(e,t){return ju(e,_u)}function ku(e,t){return ju({...e,enabled:!0,suspense:!0,throwOnError:Fg,placeholderData:void 0},_u)}function Zg(e,t){const n=Gn(),[r]=c.useState(()=>new Pg(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);const o=c.useSyncExternalStore(c.useCallback(a=>r.subscribe(_e.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=c.useCallback((a,i)=>{r.mutate(a,i).catch(Ke)},[r]);if(o.error&&li(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var Hs={confirmLabel:"OK",dismissible:!0},$c={confirmLabel:"Continue",cancelLabel:"Cancel",tone:"default",dismissible:!0},Ug=e=>typeof e=="string"?{title:e,...Hs}:{...Hs,...e,dismissible:e.dismissible??Hs.dismissible},qg=e=>typeof e=="string"?{title:e,...$c}:{...$c,...e,dismissible:e.dismissible??e.tone!=="danger"},zg=()=>{let e={current:null};const t=new Set,n=()=>{t.forEach(l=>l())},r=l=>{e=l,n()},o=()=>e,s=()=>{const l=e.current;!l||l.kind!=="alert"||(r({current:null}),l.resolver())},a=l=>{const u=e.current;!u||u.kind!=="confirm"||(r({current:null}),u.resolver(l))},i=()=>{const l=e.current;if(l){if(l.kind==="confirm"){a(!1);return}s()}};return{subscribe:l=>(t.add(l),()=>{t.delete(l)}),getSnapshot:o,alert:l=>{const u=Ug(l);return i(),new Promise(f=>{r({current:{kind:"alert",options:u,resolver:f}})})},confirm:l=>{const u=qg(l);return i(),new Promise(f=>{r({current:{kind:"confirm",options:u,resolver:f}})})},resolveAlert:s,resolveConfirm:a,dismiss:i,reset:()=>{i()}}},Fu=c.createContext(null),Kg=()=>{const e=c.useRef();return e.current||(e.current=zg()),e.current},Wg=({children:e,components:t})=>{const n=Kg(),r=c.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);c.useEffect(()=>()=>{n.reset()},[n]);const o=n,s=r.current;return h.jsxs(Fu.Provider,{value:o,children:[e,s?.kind==="alert"&&h.jsx(t.Alert,{open:!0,options:s.options,onClose:n.resolveAlert}),s?.kind==="confirm"&&h.jsx(t.Confirm,{open:!0,options:s.options,onCancel:()=>n.resolveConfirm(!1),onConfirm:()=>n.resolveConfirm(!0)})]})},Gg=()=>{const e=c.useContext(Fu);if(!e)throw new Error("useModal must be used within ModalProvider");return e};function Yg(e,t){const n=c.createContext(t),r=s=>{const{children:a,...i}=s,l=c.useMemo(()=>i,Object.values(i));return h.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(s){const a=c.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Nt(e,t=[]){let n=[];function r(s,a){const i=c.createContext(a),l=n.length;n=[...n,a];const u=d=>{const{scope:p,children:m,...v}=d,g=p?.[e]?.[l]||i,y=c.useMemo(()=>v,Object.values(v));return h.jsx(g.Provider,{value:y,children:m})};u.displayName=s+"Provider";function f(d,p){const m=p?.[e]?.[l]||i,v=c.useContext(m);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const o=()=>{const s=n.map(a=>c.createContext(a));return function(i){const l=i?.[e]||s;return c.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Qg(o,...t)]}function Qg(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...i,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Hc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Dr(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Hc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Hc(e[o],null)}}}}function le(...e){return c.useCallback(Dr(...e),e)}function W(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Ve=globalThis?.document?c.useLayoutEffect:()=>{},Xg=zo[" useId ".trim().toString()]||(()=>{}),Jg=0;function Tt(e){const[t,n]=c.useState(Xg());return Ve(()=>{n(r=>r??String(Jg++))},[e]),t?`radix-${t}`:""}var e2=zo[" useInsertionEffect ".trim().toString()]||Ve;function Bt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=t2({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==i&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,r])}const u=c.useCallback(f=>{if(i){const d=n2(f)?f(e):f;d!==e&&a.current?.(d)}else s(f)},[i,e,s,a]);return[l,u]}function t2({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),s=c.useRef(t);return e2(()=>{s.current=t},[t]),c.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function n2(e){return typeof e=="function"}function qn(e){const t=r2(e),n=c.forwardRef((r,o)=>{const{children:s,...a}=r,i=c.Children.toArray(s),l=i.find(o2);if(l){const u=l.props.children,f=i.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return h.jsx(t,{...a,ref:o,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return h.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function r2(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const a=a2(o),i=s2(s,o.props);return o.type!==c.Fragment&&(i.ref=r?Dr(r,a):a),c.cloneElement(o,i)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $u=Symbol("radix.slottable");function Hu(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=$u,t}function o2(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$u}function s2(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function a2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var i2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],re=i2.reduce((e,t)=>{const n=qn(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bu(e,t){e&&$t.flushSync(()=>e.dispatchEvent(t))}function Mt(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function c2(e,t=globalThis?.document){const n=Mt(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var l2="DismissableLayer",ba="dismissableLayer.update",u2="dismissableLayer.pointerDownOutside",d2="dismissableLayer.focusOutside",Bc,Vu=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lr=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...l}=e,u=c.useContext(Vu),[f,d]=c.useState(null),p=f?.ownerDocument??globalThis?.document,[,m]=c.useState({}),v=le(t,C=>d(C)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(y),x=f?g.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,E=x>=b,T=p2(C=>{const S=C.target,N=[...u.branches].some(I=>I.contains(S));!E||N||(o?.(C),a?.(C),C.defaultPrevented||i?.())},p),O=m2(C=>{const S=C.target;[...u.branches].some(I=>I.contains(S))||(s?.(C),a?.(C),C.defaultPrevented||i?.())},p);return c2(C=>{x===u.layers.size-1&&(r?.(C),!C.defaultPrevented&&i&&(C.preventDefault(),i()))},p),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Bc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Vc(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Bc)}},[f,p,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Vc())},[f,u]),c.useEffect(()=>{const C=()=>m({});return document.addEventListener(ba,C),()=>document.removeEventListener(ba,C)},[]),h.jsx(re.div,{...l,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,O.onFocusCapture),onBlurCapture:W(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,T.onPointerDownCapture)})});Lr.displayName=l2;var f2="DismissableLayerBranch",h2=c.forwardRef((e,t)=>{const n=c.useContext(Vu),r=c.useRef(null),o=le(t,r);return c.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),h.jsx(re.div,{...e,ref:o})});h2.displayName=f2;function p2(e,t=globalThis?.document){const n=Mt(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){Zu(u2,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function m2(e,t=globalThis?.document){const n=Mt(e),r=c.useRef(!1);return c.useEffect(()=>{const o=s=>{s.target&&!r.current&&Zu(d2,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vc(){const e=new CustomEvent(ba);document.dispatchEvent(e)}function Zu(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Bu(o,s):o.dispatchEvent(s)}var Bs="focusScope.autoFocusOnMount",Vs="focusScope.autoFocusOnUnmount",Zc={bubbles:!1,cancelable:!0},g2="FocusScope",ns=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,l]=c.useState(null),u=Mt(o),f=Mt(s),d=c.useRef(null),p=le(t,g=>l(g)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let g=function(w){if(m.paused||!i)return;const E=w.target;i.contains(E)?d.current=E:qt(d.current,{select:!0})},y=function(w){if(m.paused||!i)return;const E=w.relatedTarget;E!==null&&(i.contains(E)||qt(d.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&qt(i)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const x=new MutationObserver(b);return i&&x.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),x.disconnect()}}},[r,i,m.paused]),c.useEffect(()=>{if(i){qc.add(m);const g=document.activeElement;if(!i.contains(g)){const b=new CustomEvent(Bs,Zc);i.addEventListener(Bs,u),i.dispatchEvent(b),b.defaultPrevented||(v2(E2(Uu(i)),{select:!0}),document.activeElement===g&&qt(i))}return()=>{i.removeEventListener(Bs,u),setTimeout(()=>{const b=new CustomEvent(Vs,Zc);i.addEventListener(Vs,f),i.dispatchEvent(b),b.defaultPrevented||qt(g??document.body,{select:!0}),i.removeEventListener(Vs,f),qc.remove(m)},0)}}},[i,u,f,m]);const v=c.useCallback(g=>{if(!n&&!r||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(y&&b){const x=g.currentTarget,[w,E]=y2(x);w&&E?!g.shiftKey&&b===E?(g.preventDefault(),n&&qt(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),n&&qt(E,{select:!0})):b===x&&g.preventDefault()}},[n,r,m.paused]);return h.jsx(re.div,{tabIndex:-1,...a,ref:p,onKeyDown:v})});ns.displayName=g2;function v2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qt(r,{select:t}),document.activeElement!==n)return}function y2(e){const t=Uu(e),n=Uc(t,e),r=Uc(t.reverse(),e);return[n,r]}function Uu(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Uc(e,t){for(const n of e)if(!b2(n,{upTo:t}))return n}function b2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function x2(e){return e instanceof HTMLInputElement&&"select"in e}function qt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&x2(e)&&t&&e.select()}}var qc=w2();function w2(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=zc(e,t),e.unshift(t)},remove(t){e=zc(e,t),e[0]?.resume()}}}function zc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function E2(e){return e.filter(t=>t.tagName!=="A")}var S2="Portal",jr=c.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=c.useState(!1);Ve(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?Xl.createPortal(h.jsx(re.div,{...r,ref:t}),a):null});jr.displayName=S2;function R2(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var Ot=e=>{const{present:t,children:n}=e,r=C2(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),s=le(r.ref,A2(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:s}):null};Ot.displayName="Presence";function C2(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),s=c.useRef("none"),a=e?"mounted":"unmounted",[i,l]=R2(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=to(r.current);s.current=i==="mounted"?u:"none"},[i]),Ve(()=>{const u=r.current,f=o.current;if(f!==e){const p=s.current,m=to(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ve(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=m=>{const g=to(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=m=>{m.target===t&&(s.current=to(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function to(e){return e?.animationName||"none"}function A2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zs=0;function fi(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Kc()),document.body.insertAdjacentElement("beforeend",e[1]??Kc()),Zs++,()=>{Zs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zs--}},[])}function Kc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var T2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Nn=new WeakMap,no=new WeakMap,ro={},Us=0,qu=function(e){return e&&(e.host||qu(e.parentNode))},P2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qu(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},M2=function(e,t,n,r){var o=P2(t,Array.isArray(e)?e:[e]);ro[n]||(ro[n]=new WeakMap);var s=ro[n],a=[],i=new Set,l=new Set(o),u=function(d){!d||i.has(d)||(i.add(d),u(d.parentNode))};o.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(i.has(p))f(p);else try{var m=p.getAttribute(r),v=m!==null&&m!=="false",g=(Nn.get(p)||0)+1,y=(s.get(p)||0)+1;Nn.set(p,g),s.set(p,y),a.push(p),g===1&&v&&no.set(p,!0),y===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return f(t),i.clear(),Us++,function(){a.forEach(function(d){var p=Nn.get(d)-1,m=s.get(d)-1;Nn.set(d,p),s.set(d,m),p||(no.has(d)||d.removeAttribute(r),no.delete(d)),m||d.removeAttribute(n)}),Us--,Us||(Nn=new WeakMap,Nn=new WeakMap,no=new WeakMap,ro={})}},hi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=T2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),M2(r,o,n,"aria-hidden")):function(){return null}},rs="Dialog",[zu,Ku]=Nt(rs),[_2,Et]=zu(rs),Wu=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=c.useRef(null),l=c.useRef(null),[u,f]=Bt({prop:r,defaultProp:o??!1,onChange:s,caller:rs});return h.jsx(_2,{scope:t,triggerRef:i,contentRef:l,contentId:Tt(),titleId:Tt(),descriptionId:Tt(),open:u,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};Wu.displayName=rs;var Gu="DialogTrigger",Yu=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(Gu,n),s=le(t,o.triggerRef);return h.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gi(o.open),...r,ref:s,onClick:W(e.onClick,o.onOpenToggle)})});Yu.displayName=Gu;var pi="DialogPortal",[N2,Qu]=zu(pi,{forceMount:void 0}),Xu=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Et(pi,t);return h.jsx(N2,{scope:t,forceMount:n,children:c.Children.map(r,a=>h.jsx(Ot,{present:n||s.open,children:h.jsx(jr,{asChild:!0,container:o,children:a})}))})};Xu.displayName=pi;var Oo="DialogOverlay",Ju=c.forwardRef((e,t)=>{const n=Qu(Oo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Et(Oo,e.__scopeDialog);return s.modal?h.jsx(Ot,{present:r||s.open,children:h.jsx(I2,{...o,ref:t})}):null});Ju.displayName=Oo;var O2=qn("DialogOverlay.RemoveScroll"),I2=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(Oo,n);return h.jsx(Ya,{as:O2,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(re.div,{"data-state":gi(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vn="DialogContent",ed=c.forwardRef((e,t)=>{const n=Qu(vn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Et(vn,e.__scopeDialog);return h.jsx(Ot,{present:r||s.open,children:s.modal?h.jsx(D2,{...o,ref:t}):h.jsx(L2,{...o,ref:t})})});ed.displayName=vn;var D2=c.forwardRef((e,t)=>{const n=Et(vn,e.__scopeDialog),r=c.useRef(null),o=le(t,n.contentRef,r);return c.useEffect(()=>{const s=r.current;if(s)return hi(s)},[]),h.jsx(td,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:W(e.onFocusOutside,s=>s.preventDefault())})}),L2=c.forwardRef((e,t)=>{const n=Et(vn,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return h.jsx(td,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),td=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=Et(vn,n),l=c.useRef(null),u=le(t,l);return fi(),h.jsxs(h.Fragment,{children:[h.jsx(ns,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:h.jsx(Lr,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":gi(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(k2,{titleId:i.titleId}),h.jsx($2,{contentRef:l,descriptionId:i.descriptionId})]})]})}),mi="DialogTitle",nd=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(mi,n);return h.jsx(re.h2,{id:o.titleId,...r,ref:t})});nd.displayName=mi;var rd="DialogDescription",od=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(rd,n);return h.jsx(re.p,{id:o.descriptionId,...r,ref:t})});od.displayName=rd;var sd="DialogClose",ad=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(sd,n);return h.jsx(re.button,{type:"button",...r,ref:t,onClick:W(e.onClick,()=>o.onOpenChange(!1))})});ad.displayName=sd;function gi(e){return e?"open":"closed"}var id="DialogTitleWarning",[j2,cd]=Yg(id,{contentName:vn,titleName:mi,docsSlug:"dialog"}),k2=({titleId:e})=>{const t=cd(id),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-BqlwdVTC.js","assets/note-vendor-i1M2FSI2.js","assets/graph-vendor-CUxe67Lr.js","assets/note-core-Z6kqulGB.js","assets/Callout-BQztyCMl.js","assets/Views-7eBt89wS.js","assets/ViewSectionTableRenderer-BLGnO1Bi.js","assets/SurfaceCard-D818ic_m.js","assets/Plus.es-Bhd-g5AE.js","assets/Reminders-huKwxqd6.js","assets/useReminderMutate-CYUAO2pX.js","assets/Graph-BMciMgqf.js","assets/Search-BsSLNGNy.js","assets/Tag-e0SLJ_ZM.js","assets/Note-DlOYlFsr.js","assets/image.api-CBdSbIQC.js","assets/TagNotes-BazFumXJ.js","assets/ViewNotes-Bs9GD1Xm.js","assets/index-Dg5dH_cy.js","assets/Trash.es-vdyjYO7w.js","assets/Image.es-CNBM7KrE.js","assets/mcp-DFrfTamn.js","assets/trash-iAbrwiEg.js","assets/manage-image-DiRFDinY.js","assets/Image-DxWhlIDG.js","assets/manage-image-detail-B6crq-X5.js","assets/properties-D8v-iyhQ.js","assets/placeholder-B-uiiS2o.js"])))=>i.map(i=>d[i]);
2
+ import{j as h,w as Wp,r as $t,R as Xl,a as Ya,c as Gp,u as Yp,o as Qp,s as Xp,f as Jp,b as e1,d as t1,h as n1,e as r1,l as o1,_ as Ze,g as s1}from"./note-vendor-i1M2FSI2.js";import{a as c,R as zo,N as M,g as Ir,r as a1,P as xe}from"./graph-vendor-CUxe67Lr.js";import"./note-core-Z6kqulGB.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const Qa={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},Jl=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,Xa=(e,t,n=!0)=>{const r=Jl(e);n&&t(r?.matches||!1);const o=s=>{t?.(s.matches)};return r?.addEventListener("change",o),()=>{r?.removeEventListener("change",o)}},i1=(e,t=!0)=>Xa(Qa.DARK,e,t),c1=(e,t,n=!0)=>Xa(Qa.RESPONSIVE(e),t,n),l1={MEDIA_QUERY:Qa,listenThemeChange:i1,listenResponsiveChange:c1,createMediaQuery:Jl,listenMediaQueryChange:Xa};var Ee=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Ee||{});function eu({update:e,notify:t,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:a,shallowPropagate:i};function r(u,f,d){const p=f.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:f.deps;if(m!==void 0&&m.dep===u){m.version=d,f.depsTail=m;return}const v=u.subsTail;if(v!==void 0&&v.version===d&&v.sub===f)return;const g=f.depsTail=u.subsTail={version:d,dep:u,sub:f,prevDep:p,nextDep:m,prevSub:v,nextSub:void 0};m!==void 0&&(m.prevDep=g),p!==void 0?p.nextDep=g:f.deps=g,v!==void 0?v.nextSub=g:u.subs=g}function o(u,f=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,v=u.nextSub,g=u.prevSub;return m!==void 0?m.prevDep=p:f.depsTail=p,p!==void 0?p.nextDep=m:f.deps=m,v!==void 0?v.prevSub=g:d.subsTail=g,g!==void 0?g.nextSub=v:(d.subs=v)===void 0&&n(d),m}function s(u){let f=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&t(p),m&1){const v=p.subs;if(v!==void 0){const g=(u=v).nextSub;g!==void 0&&(d={value:f,prev:d},f=g);continue}}if((u=f)!==void 0){f=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){f=u.nextSub;continue e}break}while(!0)}function a(u,f){let d,p=0,m=!1;e:do{const v=u.dep,g=v.flags;if(f.flags&16)m=!0;else if((g&17)===17){if(e(v)){const y=v.subs;y.nextSub!==void 0&&i(y),m=!0}}else if((g&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=v.deps,f=v,++p;continue}if(!m){const y=u.nextDep;if(y!==void 0){u=y;continue}}for(;p--;){const y=f.subs,b=y.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=y,m){if(e(f)){b&&i(y),f=u.sub;continue}m=!1}else f.flags&=-33;f=u.sub;const x=u.nextDep;if(x!==void 0){u=x;continue e}}return m}while(!0)}function i(u){do{const f=u.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&t(f))}while((u=u.nextSub)!==void 0)}function l(u,f){let d=f.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}let Ja=0,rn=0,mr=0;const kt=[],{link:$C,unlink:tu,propagate:HC,checkDirty:u1,shallowPropagate:BC}=eu({update(e){return e.depsTail!==void 0?p1(e):m1(e)},notify(e){let t=mr,n=t;do if(kt[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(mr=t;n<--t;){const r=kt[n];kt[n++]=kt[t],kt[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ko(e)):y1.call(e)}});function d1(){return Ja}function f1(){++Ja}function h1(){--Ja||v1()}function p1(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Ko(e)}}function m1(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function g1(e){const t=e.flags;if(t&16||t&32&&u1(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Ko(e)}}else e.flags=2}function v1(){try{for(;rn<mr;){const e=kt[rn];kt[rn++]=void 0,g1(e)}}finally{for(;rn<mr;){const e=kt[rn];kt[rn++]=void 0,e.flags|=10}rn=0,mr=0}}function y1(){this.depsTail=void 0,this.flags=0,Ko(this);const e=this.subs;e!==void 0&&tu(e)}function Ko(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=tu(n,e)}function ei(e,t,n){const r=typeof e=="object",o=r?e:void 0;return{next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}const ca=[];let fo=0;const{link:ac,unlink:b1,propagate:x1,checkDirty:nu,shallowPropagate:ic}=eu({update(e){return e._update()},notify(e){ca[la++]=e,e.flags&=~Ee.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ee.Mutable|Ee.Dirty,wo(e))}});let Qr=0,la=0,At;function wo(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=b1(n,e)}function ru(){if(!(d1()>0)){for(;Qr<la;){const e=ca[Qr];ca[Qr++]=void 0,e.notify()}Qr=0,la=0}}function ou(e,t){const n=typeof e=="function",r=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Ee.None:Ee.Mutable,get(){return At!==void 0&&ac(o,At,fo),o._snapshot},subscribe(s){const a=ei(s),i={current:!1},l=w1(()=>{o.get(),i.current?a.next?.(o._snapshot):i.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(s){const a=At,i=Object.is;if(n)At=o,++fo,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=Ee.Mutable|Ee.RecursedCheck);try{const l=o._snapshot,u=typeof s=="function"?s(l):s===void 0&&n?r(l):s;return l===void 0||!i(l,u)?(o._snapshot=u,!0):!1}finally{At=a,n&&(o.flags&=~Ee.RecursedCheck),wo(o)}}};return n?(o.flags=Ee.Mutable|Ee.Dirty,o.get=function(){const s=o.flags;if(s&Ee.Dirty||s&Ee.Pending&&nu(o.deps,o)){if(o._update()){const a=o.subs;a!==void 0&&ic(a)}}else s&Ee.Pending&&(o.flags=s&~Ee.Pending);return At!==void 0&&ac(o,At,fo),o._snapshot}):o.set=function(s){if(o._update(s)){const a=o.subs;a!==void 0&&(x1(a),ic(a),ru())}},o}function w1(e){const t=()=>{const r=At;At=n,++fo,n.depsTail=void 0,n.flags=Ee.Watching|Ee.RecursedCheck;try{return e()}finally{At=r,n.flags&=~Ee.RecursedCheck,wo(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ee.Watching|Ee.RecursedCheck,notify(){const r=this.flags;r&Ee.Dirty||r&Ee.Pending&&nu(this.deps,this)?t():this.flags=Ee.Watching},stop(){this.flags=Ee.None,this.depsTail=void 0,wo(this)}};return t(),n}class E1{constructor(t){this.atom=ou(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ei(t))}}class S1{constructor(t){this.atom=ou(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ei(t))}}function R1(e){return typeof e=="function"?new S1(e):new E1(e)}function C1(e){try{f1(),e()}finally{h1(),ru()}}const Yt="__TSR_index",cc="popstate",lc="beforeunload";function A1(e){let t=e.getLocation();const n=new Set,r=a=>{t=e.getLocation(),n.forEach(i=>i({location:t,action:a}))},o=a=>{e.notifyOnIndexChange??!0?r(a):t=e.getLocation()},s=async({task:a,navigateOpts:i,...l})=>{if(i?.ignoreBlocker??!1){a();return}const f=e.getBlockers?.()??[],d=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&f.length&&d)for(const p of f){const m=Eo(l.path,l.state);if(await p.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,i,l)=>{const u=t.state[Yt];i=uc(u+1,i),s({task:()=>{e.pushState(a,i),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:i})},replace:(a,i,l)=>{const u=t.state[Yt];i=uc(u,i),s({task:()=>{e.replaceState(a,i),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:i})},go:(a,i)=>{s({task:()=>{e.go(a),o({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Yt]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const i=e.getBlockers?.()??[];return e.setBlockers([...i,a]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(u=>u!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function uc(e,t){t||(t={});const n=ti();return{...t,key:n,__TSR_key:n,[Yt]:e}}function T1(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const s=()=>o,a=S=>o=S,i=(S=>S),l=(()=>Eo(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const S=ti();t.history.replaceState({[Yt]:0,key:S,__TSR_key:S},"")}let u=l(),f,d=!1,p=!1,m=!1,v=!1;const g=()=>u;let y,b;const x=()=>{y&&(C._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),C._ignoreSubscribers=!1,y=void 0,b=void 0,f=void 0)},w=(S,N,I)=>{const P=i(N);b||(f=u),u=Eo(N,I),y={href:P,state:I,isPush:y?.isPush||S==="push"},b||(b=Promise.resolve().then(()=>x()))},E=S=>{u=l(),C.notify({type:S})},T=async()=>{if(p){p=!1;return}const S=l(),N=S.state[Yt]-u.state[Yt],I=N===1,P=N===-1,H=!I&&!P||d;d=!1;const z=H?"GO":P?"BACK":"FORWARD",L=H?{type:"GO",index:N}:{type:P?"BACK":"FORWARD"};if(m)m=!1;else{const k=s();if(typeof document<"u"&&k.length){for(const A of k)if(await A.blockerFn({currentLocation:u,nextLocation:S,action:z})){p=!0,t.history.go(1),C.notify(L);return}}}u=l(),C.notify(L)},O=S=>{if(v){v=!1;return}let N=!1;const I=s();if(typeof document<"u"&&I.length)for(const P of I){const H=P.enableBeforeUnload??!0;if(H===!0){N=!0;break}if(typeof H=="function"&&H()===!0){N=!0;break}}if(N)return S.preventDefault(),S.returnValue=""},C=A1({getLocation:g,getLength:()=>t.history.length,pushState:(S,N)=>w("push",S,N),replaceState:(S,N)=>w("replace",S,N),back:S=>(S&&(m=!0),v=!0,t.history.back()),forward:S=>{S&&(m=!0),v=!0,t.history.forward()},go:S=>{d=!0,t.history.go(S)},createHref:S=>i(S),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(lc,O,{capture:!0}),t.removeEventListener(cc,T)},onBlocked:()=>{f&&u!==f&&(u=f)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(lc,O,{capture:!0}),t.addEventListener(cc,T),t.history.pushState=function(...S){const N=n.apply(t.history,S);return C._ignoreSubscribers||E("PUSH"),N},t.history.replaceState=function(...S){const N=r.apply(t.history,S);return C._ignoreSubscribers||E("REPLACE"),N},C}function P1(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Eo(e,t){const n=P1(e),r=n.indexOf("#"),o=n.indexOf("?"),s=ti();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[Yt]:0,key:s,__TSR_key:s}}}function ti(){return(Math.random()+1).toString(36).substring(7)}const M1=!1;function gr(e){let t;return C1(()=>{t=e()}),t}function wr(e){return e[e.length-1]}function _1(e){return typeof e=="function"}function Wt(e,t){return _1(e)?e(t):e}const N1=Object.prototype.hasOwnProperty,dc=Object.prototype.propertyIsEnumerable;function st(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=pc(e)&&pc(r);if(!o&&!(So(e)&&So(r)))return r;const s=o?e:fc(e);if(!s)return r;const a=o?r:fc(r);if(!a)return r;const i=s.length,l=a.length,u=o?new Array(l):{};let f=0;for(let d=0;d<l;d++){const p=o?d:a[d],m=e[p],v=r[p];if(m===v){u[p]=m,(o?d<i:N1.call(e,p))&&f++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){u[p]=v;continue}const g=st(m,v,n+1);u[p]=g,g===m&&f++}return i===l&&f===i?e:u}function fc(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!dc.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!dc.call(e,o))return!1;r.push(o)}return r}function So(e){if(!hc(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!hc(n)||!n.hasOwnProperty("isPrototypeOf"))}function hc(e){return Object.prototype.toString.call(e)==="[object Object]"}function pc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ln(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!ln(e[r],t[r],n))return!1;return!0}if(So(e)&&So(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in t)if((!r||t[a]!==void 0)&&!ln(e[a],t[a],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&o++;let s=0;for(const a in t)if((!r||t[a]!==void 0)&&(s++,s>o||!ln(e[a],t[a],n)))return!1;return o===s}return!1}function Zn(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function O1(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Er(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function I1(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function mc(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return I1(t)}const D1=["http:","https:","mailto:","tel:"];function Ro(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function sr(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=mc(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+mc(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function L1(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var j1="Invariant failed";function Jt(e,t){if(!e)throw new Error(j1)}function Co(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const a=t.get(s);if(a)return o(a),a.value},set(s,a){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const i=t.get(s);if(i)i.value=a,o(i);else{const l={key:s,value:a,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(s,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const Un=0,hn=1,pn=2,Sr=3,on=4,su=5;function k1(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function ni(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=Un,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const i=e.length;return n[0]=pn,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}if(s.charCodeAt(0)===36)return n[0]=hn,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const a=k1(s);if(a){const[i,l]=a,u=s.charCodeAt(i+1);if(u===45){if(i+2<s.length&&s.charCodeAt(i+2)===36){const f=i+3,d=l;if(f<d)return n[0]=Sr,n[1]=t+i,n[2]=t+f,n[3]=t+d,n[4]=t+l+1,n[5]=o,n}}else if(u===36){const f=i+1,d=i+2;return d===l?(n[0]=pn,n[1]=t+i,n[2]=t+f,n[3]=t+d,n[4]=t+l+1,n[5]=e.length,n):(n[0]=hn,n[1]=t+i,n[2]=t+d,n[3]=t+l,n[4]=t+l+1,n[5]=o,n)}}return n[0]=Un,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function Wo(e,t,n,r,o,s,a){a?.(n);let i=r;{const l=n.fullPath??n.from,u=l.length,f=n.options?.caseSensitive??e,d=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;i<u;){const m=ni(l,i,t);let v;const g=i,y=m[5];switch(i=y+1,s++,m[0]){case Un:{const x=l.substring(m[2],m[3]);if(f){const w=o.static?.get(x);if(w)v=w;else{o.static??=new Map;const E=sn(n.fullPath??n.from);E.parent=o,E.depth=s,v=E,o.static.set(x,E)}}else{const w=x.toLowerCase(),E=o.staticInsensitive?.get(w);if(E)v=E;else{o.staticInsensitive??=new Map;const T=sn(n.fullPath??n.from);T.parent=o,T.depth=s,v=T,o.staticInsensitive.set(w,T)}}break}case hn:{const x=l.substring(g,m[1]),w=l.substring(m[4],y),E=f&&!!(x||w),T=x?E?x:x.toLowerCase():void 0,O=w?E?w:w.toLowerCase():void 0,C=!d&&o.dynamic?.find(S=>!S.skipOnParamError&&S.caseSensitive===E&&S.prefix===T&&S.suffix===O);if(C)v=C;else{const S=Ds(hn,n.fullPath??n.from,E,T,O);v=S,S.depth=s,S.parent=o,o.dynamic??=[],o.dynamic.push(S)}break}case Sr:{const x=l.substring(g,m[1]),w=l.substring(m[4],y),E=f&&!!(x||w),T=x?E?x:x.toLowerCase():void 0,O=w?E?w:w.toLowerCase():void 0,C=!d&&o.optional?.find(S=>!S.skipOnParamError&&S.caseSensitive===E&&S.prefix===T&&S.suffix===O);if(C)v=C;else{const S=Ds(Sr,n.fullPath??n.from,E,T,O);v=S,S.parent=o,S.depth=s,o.optional??=[],o.optional.push(S)}break}case pn:{const x=l.substring(g,m[1]),w=l.substring(m[4],y),E=f&&!!(x||w),T=x?E?x:x.toLowerCase():void 0,O=w?E?w:w.toLowerCase():void 0,C=Ds(pn,n.fullPath??n.from,E,T,O);v=C,C.parent=o,C.depth=s,o.wildcard??=[],o.wildcard.push(C)}}o=v}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const m=sn(n.fullPath??n.from);m.kind=su,m.parent=o,s++,m.depth=s,o.pathless??=[],o.pathless.push(m),o=m}const p=(n.path||!n.children)&&!n.isRoot;if(p&&l.endsWith("/")){const m=sn(n.fullPath??n.from);m.kind=on,m.parent=o,s++,m.depth=s,o.index=m,o=m}o.parse=n.options?.params?.parse??null,o.skipOnParamError=d,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,p&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const l of n.children)Wo(e,t,l,i,o,s,a)}function Is(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function zt(e){if(e.pathless)for(const t of e.pathless)zt(t);if(e.static)for(const t of e.static.values())zt(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())zt(t);if(e.dynamic?.length){e.dynamic.sort(Is);for(const t of e.dynamic)zt(t)}if(e.optional?.length){e.optional.sort(Is);for(const t of e.optional)zt(t)}if(e.wildcard?.length){e.wildcard.sort(Is);for(const t of e.wildcard)zt(t)}}function sn(e){return{kind:Un,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Ds(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function F1(e,t){const n=sn("/"),r=new Uint16Array(6);for(const o of e)Wo(!1,r,o,1,n,0);zt(n),t.masksTree=n,t.flatCache=Co(1e3)}function $1(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=ri(e,t.masksTree);return t.flatCache.set(e,r),r}function H1(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let a=o.singleCache.get(s);if(!a){a=sn("/");const i=new Uint16Array(6);Wo(t,i,{from:e},1,a,0),o.singleCache.set(s,a)}return ri(r,a,n)}function B1(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=ri(e,t.segmentTree,n)}catch(a){if(a instanceof URIError)s=null;else throw a}return s&&(s.branch=U1(s.route)),t.matchCache.set(r,s),s}function V1(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Z1(e,t=!1,n){const r=sn(e.fullPath),o=new Uint16Array(6),s={},a={};let i=0;return Wo(t,o,e,1,r,0,u=>{if(n?.(u,i),Jt(!(u.id in s),`Duplicate routes found with id: ${String(u.id)}`),s[u.id]=u,i!==0&&u.path){const f=V1(u.fullPath);(!a[f]||u.fullPath.endsWith("/"))&&(a[f]=u)}i++}),zt(r),{processedTree:{segmentTree:r,singleCache:Co(1e3),matchCache:Co(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:a}}function ri(e,t,n=!1){const r=e.split("/"),o=z1(e,r,t,n);if(!o)return null;const[s]=au(e,r,o);return{route:o.node.route,rawParams:s,parsedParams:o.parsedParams}}function au(e,t,n){const r=q1(n.node);let o=null;const s={};let a=n.extract?.part??0,i=n.extract?.node??0,l=n.extract?.path??0,u=n.extract?.segment??0;for(;i<r.length;a++,i++,l++,u++){const f=r[i];if(f.kind===on)break;if(f.kind===su){u--,a--,l--;continue}const d=t[a],p=l;if(d&&(l+=d.length),f.kind===hn){o??=n.node.fullPath.split("/");const m=o[u],v=f.prefix?.length??0;if(m.charCodeAt(v)===123){const y=f.suffix?.length??0,b=m.substring(v+2,m.length-y-1),x=d.substring(v,d.length-y);s[b]=decodeURIComponent(x)}else{const y=m.substring(1);s[y]=decodeURIComponent(d)}}else if(f.kind===Sr){if(n.skipped&1<<i){a--,l=p-1;continue}o??=n.node.fullPath.split("/");const m=o[u],v=f.prefix?.length??0,g=f.suffix?.length??0,y=m.substring(v+3,m.length-g-1),b=f.suffix||f.prefix?d.substring(v,d.length-g):d;b&&(s[y]=decodeURIComponent(b))}else if(f.kind===pn){const m=f,v=e.substring(p+(m.prefix?.length??0),e.length-(m.suffix?.length??0)),g=decodeURIComponent(v);s["*"]=g,s._splat=g;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:a,node:i,path:l,segment:u}]}function U1(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function q1(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function z1(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!wr(t),s=o&&e!=="/",a=t.length-(o?1:0),i=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,u=null,f=null;for(;i.length;){const d=i.pop(),{node:p,index:m,skipped:v,depth:g,statics:y,dynamics:b,optionals:x}=d;let{extract:w,rawParams:E,parsedParams:T}=d;if(p.skipOnParamError){if(!Ls(e,t,d))continue;E=d.rawParams,w=d.extract,T=d.parsedParams}r&&p.route&&p.kind!==on&&ar(u,d)&&(u=d);const O=m===a;if(O&&(p.route&&!s&&ar(f,d)&&(f=d),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const C=O?void 0:t[m];let S;if(O&&p.index){const N={node:p.index,index:m,skipped:v,depth:g+1,statics:y,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T};let I=!0;if(p.index.skipOnParamError&&(Ls(e,t,N)||(I=!1)),I){if(y===a&&!b&&!x&&!v)return N;ar(f,N)&&(f=N)}}if(p.wildcard&&ar(l,d))for(const N of p.wildcard){const{prefix:I,suffix:P}=N;if(I&&(O||!(N.caseSensitive?C:S??=C.toLowerCase()).startsWith(I)))continue;if(P){if(O)continue;const z=t.slice(m).join("/").slice(-P.length);if((N.caseSensitive?z:z.toLowerCase())!==P)continue}const H={node:N,index:a,skipped:v,depth:g,statics:y,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T};if(!(N.skipOnParamError&&!Ls(e,t,H))){l=H;break}}if(p.optional){const N=v|1<<g,I=g+1;for(let P=p.optional.length-1;P>=0;P--){const H=p.optional[P];i.push({node:H,index:m,skipped:N,depth:I,statics:y,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T})}if(!O)for(let P=p.optional.length-1;P>=0;P--){const H=p.optional[P],{prefix:z,suffix:L}=H;if(z||L){const k=H.caseSensitive?C:S??=C.toLowerCase();if(z&&!k.startsWith(z)||L&&!k.endsWith(L))continue}i.push({node:H,index:m+1,skipped:v,depth:I,statics:y,dynamics:b,optionals:x+1,extract:w,rawParams:E,parsedParams:T})}}if(!O&&p.dynamic&&C)for(let N=p.dynamic.length-1;N>=0;N--){const I=p.dynamic[N],{prefix:P,suffix:H}=I;if(P||H){const z=I.caseSensitive?C:S??=C.toLowerCase();if(P&&!z.startsWith(P)||H&&!z.endsWith(H))continue}i.push({node:I,index:m+1,skipped:v,depth:g+1,statics:y,dynamics:b+1,optionals:x,extract:w,rawParams:E,parsedParams:T})}if(!O&&p.staticInsensitive){const N=p.staticInsensitive.get(S??=C.toLowerCase());N&&i.push({node:N,index:m+1,skipped:v,depth:g+1,statics:y+1,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T})}if(!O&&p.static){const N=p.static.get(C);N&&i.push({node:N,index:m+1,skipped:v,depth:g+1,statics:y+1,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T})}if(p.pathless){const N=g+1;for(let I=p.pathless.length-1;I>=0;I--){const P=p.pathless[I];i.push({node:P,index:m,skipped:v,depth:N,statics:y,dynamics:b,optionals:x,extract:w,rawParams:E,parsedParams:T})}}}if(f&&l)return ar(l,f)?f:l;if(f)return f;if(l)return l;if(r&&u){let d=u.index;for(let m=0;m<u.index;m++)d+=t[m].length;const p=d===e.length?"/":e.slice(d);return u.rawParams??={},u.rawParams["**"]=decodeURIComponent(p),u}return null}function Ls(e,t,n){try{const[r,o]=au(e,t,n);n.rawParams=r,n.extract=o;const s=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,s),!0}catch{return null}}function ar(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===on)>(e.node.kind===on)||t.node.kind===on==(e.node.kind===on)&&t.depth>e.depth))):!0}function ho(e){return oi(e.filter(t=>t!==void 0).join("/"))}function oi(e){return e.replace(/\/{2,}/g,"/")}function iu(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Qt(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function cu(e){return Qt(iu(e))}function Ao(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function K1(e,t,n){return Ao(e,n)===Ao(t,n)}function W1({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let a;if(r){a=o?t:s?e:e+"\0"+t;const d=r.get(a);if(d)return d}let i;if(s)i=e.split("/");else if(o)i=t.split("/");else{for(i=e.split("/");i.length>1&&wr(i)==="";)i.pop();const d=t.split("/");for(let p=0,m=d.length;p<m;p++){const v=d[p];v===""?p?p===m-1&&i.push(v):i=[v]:v===".."?i.pop():v==="."||i.push(v)}}i.length>1&&(wr(i)===""?n==="never"&&i.pop():n==="always"&&i.push(""));let l,u="";for(let d=0;d<i.length;d++){d>0&&(u+="/");const p=i[d];if(!p)continue;l=ni(p,0,l);const m=l[0];if(m===Un){u+=p;continue}const v=l[5],g=p.substring(0,l[1]),y=p.substring(l[4],v),b=p.substring(l[2],l[3]);m===hn?u+=g||y?`${g}{$${b}}${y}`:`$${b}`:m===pn?u+=g||y?`${g}{$}${y}`:"$":u+=`${g}{-$${b}}${y}`}u=oi(u);const f=u||"/";return a&&r&&r.set(a,f),f}function G1(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function js(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>vc(o,n)).join("/"):vc(r,n)}function gc({path:e,params:t,decoder:n,...r}){let o=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const a=e.length;let i=0,l,u="";for(;i<a;){const d=i;l=ni(e,d,l);const p=l[5];if(i=p+1,d===p)continue;const m=l[0];if(m===Un){u+="/"+e.substring(d,p);continue}if(m===pn){const v=t._splat;s._splat=v,s["*"]=v;const g=e.substring(d,l[1]),y=e.substring(l[4],p);if(!v){o=!0,(g||y)&&(u+="/"+g+y);continue}const b=js("_splat",t,n);u+="/"+g+b+y;continue}if(m===hn){const v=e.substring(l[2],l[3]);!o&&!(v in t)&&(o=!0),s[v]=t[v];const g=e.substring(d,l[1]),y=e.substring(l[4],p),b=js(v,t,n)??"undefined";u+="/"+g+b+y;continue}if(m===Sr){const v=e.substring(l[2],l[3]),g=t[v];if(g==null)continue;s[v]=g;const y=e.substring(d,l[1]),b=e.substring(l[4],p),x=js(v,t,n)??"";u+="/"+y+x+b;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:s,interpolatedPath:u||"/",isMissingParams:o}}function vc(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function lu(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function et(e){return!!e?.isNotFound}function Y1(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const ua="tsr-scroll-restoration-v1_3",Q1=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function X1(){const e=Y1();if(!e)return null;const t=e.getItem(ua);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Wt(r,n)||n;try{e.setItem(ua,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Xr=X1(),J1=e=>e.state.__TSR_key||e.href;function em(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let To=!1;function tm({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:o,location:s}){let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(u){console.error(u);return}const i=t||window.history.state?.__TSR_key,l=a[i];To=!0;e:{if(r&&l&&Object.keys(l).length>0){for(const d in l){const p=l[d];if(d==="window")window.scrollTo({top:p.scrollY,left:p.scrollX,behavior:n});else if(d){const m=document.querySelector(d);m&&(m.scrollLeft=p.scrollX,m.scrollTop=p.scrollY)}}break e}const u=(s??window.location).hash.split("#",2)[1];if(u){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const p=document.getElementById(u);p&&p.scrollIntoView(d)}break e}const f={top:0,left:0,behavior:n};if(window.scrollTo(f),o)for(const d of o){if(d==="window")continue;const p=typeof d=="function"?d():document.querySelector(d);p&&p.scrollTo(f)}}To=!1}function nm(e,t){if(!Xr||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Xr))return;e.isScrollRestorationSetup=!0,To=!1;const r=e.options.getScrollRestorationKey||J1;window.history.scrollRestoration="manual";const o=s=>{if(To||!e.isScrollRestoring)return;let a="";if(s.target===document||s.target===window)a="window";else{const l=s.target.getAttribute("data-scroll-restoration-id");l?a=`[data-scroll-restoration-id="${l}"]`:a=em(s.target)}const i=r(e.state.location);Xr.set(l=>{const u=l[i]||={},f=u[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const d=document.querySelector(a);d&&(f.scrollX=d.scrollLeft||0,f.scrollY=d.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",Q1(o,100),!0),e.subscribe("onRendered",s=>{const a=r(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(tm({storageKey:ua,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Xr.set(i=>(i[a]||={},i)))})}function rm(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function om(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function ks(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function sm(e){const t=new URLSearchParams(e),n={};for(const[r,o]of t.entries()){const s=n[r];s==null?n[r]=ks(o):Array.isArray(s)?s.push(ks(o)):n[r]=[s,ks(o)]}return n}const am=cm(JSON.parse),im=lm(JSON.stringify,JSON.parse);function cm(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=sm(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function lm(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const s=om(o,r);return s?`?${s}`:""}}const ft="__root__";function uu(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function at(e){return e instanceof Response&&!!e.options}const da=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Go=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),$n=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let s=0;s<=o;s++){const a=e.matches[s];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},yc=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),o=r>=0?r:0;let s=n?e.matches.findIndex(a=>a.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=o);for(let a=s;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return n?s:o},Gt=(e,t,n)=>{if(!(!at(n)&&!et(n)))throw at(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:at(n)?"redirected":r.status==="pending"?"success":r.status,context:$n(e,t.index),isFetching:!1,error:n})),et(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),at(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},du=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ir=(e,t,n,r)=>{const{id:o,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Gt(e,e.router.getMatch(o),n);try{a.options.onError?.(n)}catch(i){n=i,Gt(e,e.router.getMatch(o),n)}e.updateMatch(o,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!at(n)&&!et(n)&&(e.serialError??=n)},fu=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Go(e,t)&&(n.options.loader||n.options.beforeLoad||pu(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{da(e)},o);r._nonReactive.pendingTimeout=a}},um=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;fu(e,t,n,r);const o=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Gt(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},dm=(e,t,n,r)=>{const o=e.router.getMatch(t),s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Zn(()=>{s?.resolve()});const{paramsError:a,searchError:i}=o;a&&ir(e,n,a,"PARSE_PARAMS"),i&&ir(e,n,i,"VALIDATE_SEARCH"),fu(e,t,r,o);const l=new AbortController;let u=!1;const f=()=>{u||(u=!0,e.updateMatch(t,E=>({...E,isFetching:"beforeLoad",fetchCount:E.fetchCount+1,abortController:l})))},d=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,E=>({...E,isFetching:!1}))};if(!r.options.beforeLoad){gr(()=>{f(),d()});return}o._nonReactive.beforeLoadPromise=Zn();const p={...$n(e,n,!1),...o.__routeContext},{search:m,params:v,cause:g}=o,y=Go(e,t),b={search:m,abortController:l,params:v,preload:y,context:p,location:e.location,navigate:E=>e.router.navigate({...E,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:y?"preload":g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=E=>{if(E===void 0){gr(()=>{f(),d()});return}(at(E)||et(E))&&(f(),ir(e,n,E,"BEFORE_LOAD")),gr(()=>{f(),e.updateMatch(t,T=>({...T,__beforeLoadContext:E})),d()})};let w;try{if(w=r.options.beforeLoad(b),Er(w))return f(),w.catch(E=>{ir(e,n,E,"BEFORE_LOAD")}).then(x)}catch(E){f(),ir(e,n,E,"BEFORE_LOAD")}x(w)},fm=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],s=()=>i(),a=()=>dm(e,n,t,o),i=()=>{if(du(e,n))return;const l=um(e,n,o);return Er(l)?l.then(a):a()};return s()},hm=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([s,a,i])=>{const l=s?.meta,u=s?.links,f=s?.scripts,d=s?.styles;return{meta:l,links:u,headScripts:f,headers:i,scripts:a,styles:d}})},hu=(e,t,n,r,o)=>{const s=t[r-1],{params:a,loaderDeps:i,abortController:l,cause:u}=e.router.getMatch(n),f=$n(e,r),d=Go(e,n);return{params:a,deps:i,preload:!!d,parentMatchPromise:s,abortController:l,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:d?"preload":u,route:o,...e.router.options.additionalContext}},bc=async(e,t,n,r,o)=>{try{const s=e.router.getMatch(n);try{(!(M1??e.router.isServer)||s.ssr===!0)&&Po(o);const a=o.options.loader?.(hu(e,t,n,r,o)),i=o.options.loader&&Er(a);if((i||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,f=>({...f,isFetching:"loader"})),o.options.loader){const f=i?await a:a;Gt(e,e.router.getMatch(n),f),f!==void 0&&e.updateMatch(n,d=>({...d,loaderData:f}))}o._lazyPromise&&await o._lazyPromise;const u=s._nonReactive.minPendingPromise;u&&await u,o._componentsPromise&&await o._componentsPromise,e.updateMatch(n,f=>({...f,error:void 0,context:$n(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let i=a;if(i?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,u=>({...u,status:u.status==="pending"?"success":u.status,isFetching:!1,context:$n(e,r)}));return}const l=s._nonReactive.minPendingPromise;l&&await l,et(a)&&await o.options.notFoundComponent?.preload?.(),Gt(e,e.router.getMatch(n),a);try{o.options.onError?.(a)}catch(u){i=u,Gt(e,e.router.getMatch(n),u)}e.updateMatch(n,u=>({...u,error:i,context:$n(e,r),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Gt(e,a,s)}},pm=async(e,t,n)=>{async function r(d,p,m,v){const g=Date.now()-p.updatedAt,y=d?v.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??e.router.options.defaultStaleTime??0,b=v.options.shouldReload,x=typeof b=="function"?b(hu(e,t,o,n,v)):b,{status:w,invalid:E}=m;a=w==="success"&&(E||(x??g>y)),d&&v.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{try{await bc(e,t,o,n,v);const T=e.router.getMatch(o);T._nonReactive.loaderPromise?.resolve(),T._nonReactive.loadPromise?.resolve(),T._nonReactive.loaderPromise=void 0}catch(T){at(T)&&await e.router.navigate(T.options)}})()):(w!=="success"||a&&e.sync)&&await bc(e,t,o,n,v))}const{id:o,routeId:s}=e.matches[n];let a=!1,i=!1;const l=e.router.looseRoutesById[s];if(!du(e,o)){const d=e.router.getMatch(o),p=Go(e,o);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const m=e.router.getMatch(o),v=m._nonReactive.error||m.error;v&&Gt(e,m,v),m.status==="pending"&&await r(p,d,m,l)}else{const m=p&&!e.router.state.matches.some(g=>g.id===o),v=e.router.getMatch(o);v._nonReactive.loaderPromise=Zn(),m!==v.preload&&e.updateMatch(o,g=>({...g,preload:m})),await r(p,d,v,l)}}const u=e.router.getMatch(o);i||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,i||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const f=i?u.isFetching:!1;return f!==u.isFetching||u.invalid!==!1?(e.updateMatch(o,d=>({...d,isFetching:f,invalid:!1})),e.router.getMatch(o)):u};async function xc(e){const t=e,n=[];t.router.state.matches.some(p=>p._forcePending)&&da(t);let r;for(let p=0;p<t.matches.length;p++){try{const m=fm(t,p);Er(m)&&await m}catch(m){if(at(m))throw m;if(et(m))r=m;else if(!t.preload)throw m;break}if(t.serialError)break}const o=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?yc(t,r):void 0,a=r&&t.preload?0:s!==void 0?Math.min(s+1,o):o;let i,l;for(let p=0;p<a;p++)n.push(pm(t,n,p));try{await Promise.all(n)}catch{const p=await Promise.allSettled(n);for(const m of p){if(m.status!=="rejected")continue;const v=m.reason;if(at(v))throw v;et(v)?i??=v:l??=v}if(l!==void 0)throw l}const u=i??(r&&!t.preload?r:void 0);let f=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!u&&r&&t.preload)return t.matches;if(u){const p=yc(t,u);Jt(p!==void 0);const m=t.matches[p],v=t.router.looseRoutesById[m.routeId],g=t.router.options?.defaultNotFoundComponent;!v.options.notFoundComponent&&g&&(v.options.notFoundComponent=g),u.routeId=m.routeId;const y=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,b=>({...b,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),f=p,await Po(v)}else if(!t.preload){const p=t.matches[0];p.globalNotFound||t.router.getMatch(p.id)?.globalNotFound&&t.updateMatch(p.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const p=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Po(p)}for(let p=0;p<=f;p++){const m=t.matches[p],{id:v,routeId:g}=m,y=t.router.looseRoutesById[g];try{const b=hm(t,v,y);if(b){const x=await b;t.updateMatch(v,w=>({...w,...x}))}}catch(b){console.error(`Error executing head for route ${g}:`,b)}}const d=da(t);if(Er(d)&&await d,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Po(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of mu){const o=e.options[r]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function pu(e){for(const t of mu)if(e.options[t]?.preload)return!0;return!1}const mu=["component","errorComponent","pendingComponent","notFoundComponent"];function mm(e){return{input:({url:t})=>{for(const n of e)t=fa(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=gu(e[n],t);return t}}}function gm(e){const t=cu(e.basepath),n=`/${t}`,r=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===o?a.pathname="/":i.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=ho(["/",t,a.pathname]),a)}}function fa(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function gu(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function un(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,o=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:o,hashChanged:s}}function vm(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class ym{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,a=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=G1(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=T1()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=Co(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=R1(xm(this.latestLocation)),nm(this));let i=!1;const l=this.options.basepath??"/",u=this.options.rewrite;if(s||o!==l||a!==u){this.basepath=l;const p=[],m=cu(l);m&&m!=="/"&&p.push(gm({basepath:l})),u&&p.push(u),this.rewrite=p.length===0?void 0:p.length===1?p[0]:mm(p),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(p=>({...p,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Z1(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&F1(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:l,search:u,hash:f,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const x=this.options.parseSearch(u),w=this.options.stringifySearch(x);return{href:l+w+f,publicHref:d,pathname:sr(l).path,external:!1,searchStr:w,search:st(r?.search,x),hash:sr(f.slice(1)).path,state:st(r?.state,p)}}const m=new URL(d,this.origin),v=fa(this.rewrite,m),g=this.options.parseSearch(v.search),y=this.options.stringifySearch(g);return v.search=y,{href:v.href.replace(v.origin,""),publicHref:d,pathname:sr(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:y,search:st(r?.search,g),hash:sr(v.hash.slice(1)).path,state:st(r?.state,p)}},s=o(n),{__tempLocation:a,__tempKey:i}=s.state;if(a&&(!i||i===this.tempLocationKey)){const l=o(a);return l.state.key=s.state.key,l.state.__TSR_key=s.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>W1({base:n,to:oi(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>wm({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),r=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const r=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);s.from;const l=s.unsafeRelative==="path"?a.pathname:s.from??i.fullPath,u=this.resolvePathWithBase(l,"."),f=i.search,d={...i.params},p=s.to?this.resolvePathWithBase(u,`${s.to}`):this.resolvePathWithBase(u,"."),m=s.params===!1||s.params===null?{}:(s.params??!0)===!0?d:Object.assign(d,Wt(s.params,d)),v=this.getMatchedRoutes(p);let g=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]),Object.keys(m).length>0)for(const P of g){const H=P.options.params?.stringify??P.options.stringifyParams;if(H)try{Object.assign(m,H(m))}catch{}}const b=n.leaveParams?p:sr(gc({path:p,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let x=f;if(n._includeValidateSearch&&this.options.search?.strict){const P={};g.forEach(H=>{if(H.options.validateSearch)try{Object.assign(P,po(H.options.validateSearch,{...P,...x}))}catch{}}),x=P}x=Em({search:x,dest:s,destRoutes:g,_includeValidateSearch:n._includeValidateSearch}),x=st(f,x);const w=this.options.stringifySearch(x),E=s.hash===!0?a.hash:s.hash?Wt(s.hash,a.hash):void 0,T=E?`#${E}`:"";let O=s.state===!0?a.state:s.state?Wt(s.state,a.state):{};O=st(a.state,O);const C=`${b}${w}${T}`;let S,N,I=!1;if(this.rewrite){const P=new URL(C,this.origin),H=gu(this.rewrite,P);S=P.href.replace(P.origin,""),H.origin!==this.origin?(N=H.href,I=!0):N=H.pathname+H.search+H.hash}else S=L1(C),N=S;return{publicHref:N,href:S,pathname:b,search:x,searchStr:w,state:O,hash:E??"",external:I,unmaskOnReload:s.unmaskOnReload}},o=(s={},a)=>{const i=r(s);let l=a?r(a):void 0;if(!l){const u={};if(this.options.routeMasks){const f=$1(i.pathname,this.processedTree);if(f){Object.assign(u,f.rawParams);const{from:d,params:p,...m}=f.route,v=p===!1||p===null?{}:(p??!0)===!0?u:Object.assign(u,Wt(p,u));a={from:n.from,...m,params:v},l=r(a)}}}return l&&(i.maskedLocation=l),i};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{const s=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(f=>{o.state[f]=this.latestLocation.state[f]});const u=ln(o.state,this.latestLocation.state);return l.forEach(f=>{delete o.state[f]}),u},a=Qt(this.latestLocation.href)===Qt(o.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Zn(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:u,...f}=o;l&&(f={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:a,href:i,...l}={})=>{if(i){const d=this.history.location.state.__TSR_index,p=Eo(i,{__TSR_index:n?d:d+1}),m=new URL(p.pathname,this.origin),v=fa(this.rewrite,m);l.to=v.pathname,l.search=this.options.parseSearch(p.search),l.hash=p.hash.slice(1)}const u=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const f=this.commitLocation({...u,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...a})=>{let i=!1;if(o)try{new URL(`${o}`),i=!0}catch{}if(i&&!r&&(r=!0),r){if(n!==void 0||!o){const u=this.buildLocation({to:n,...a});o=o??u.publicHref,s=s??u.publicHref}const l=!i&&s?s:o;if(Ro(l,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const d of f)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...a,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(o=>!n.some(s=>s.id===o.id))}))},this.load=async n=>{let r,o,s;for(s=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,u=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...un({resolvedLocation:u,location:l})}),this.emit({type:"onBeforeLoad",...un({resolvedLocation:u,location:l})}),await xc({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],d=[],p=[],m=[];gr(()=>{this.__store.setState(v=>{const g=v.matches,y=v.pendingMatches||v.matches;return f=g.filter(b=>!y.some(x=>x.id===b.id)),d=g.filter(b=>!y.some(x=>x.routeId===b.routeId)),p=y.filter(b=>!g.some(x=>x.routeId===b.routeId)),m=y.filter(b=>g.some(x=>x.routeId===b.routeId)),{...v,isLoading:!1,loadedAt:Date.now(),matches:y,pendingMatches:void 0,cachedMatches:[...v.cachedMatches,...f.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[d,"onLeave"],[p,"onEnter"],[m,"onStay"]].forEach(([v,g])=>{v.forEach(y=>{this.looseRoutesById[y.routeId].options[g]?.(y)})})})})}})}catch(l){at(l)?(r=l,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):et(l)&&(o=l),this.__store.setState(u=>({...u,statusCode:r?r.status:o?404:u.matches.some(f=>f.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.state.resolvedLocation,i=typeof r.types=="function"?r.types(un({resolvedLocation:a,location:s})):r.types;if(i===!1){n();return}o={update:n,types:i}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(s=>s.id===n)?"pendingMatches":this.state.matches.some(s=>s.id===n)?"matches":this.state.cachedMatches.some(s=>s.id===n)?"cachedMatches":"";o&&(o==="cachedMatches"?this.__store.setState(s=>({...s,cachedMatches:vm(s.cachedMatches.map(a=>a.id===n?r(a):a))})):this.__store.setState(s=>({...s,[o]:s[o]?.map(a=>a.id===n?r(a):a)})))})},this.getMatch=n=>{const r=o=>o.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:o.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(o);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&Ro(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(s=>!r(s))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const s=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=Po,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...s,...this.state.cachedMatches.map(i=>i.id)]);gr(()=>{o.forEach(i=>{a.has(i.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,i]}))})});try{return o=await xc({router:this,matches:o,location:r,preload:!0,updateMatch:(i,l)=>{s.has(i)?o=o.map(u=>u.id===i?l(u):u):this.updateMatch(i,l)}}),o}catch(i){if(at(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:r});et(i)||console.error(i);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const i=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=H1(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!l||n.params&&!ln(l.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?ln(i.search,s.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??im,parseSearch:t.parseSearch??am,protocolAllowlist:t.protocolAllowlist??D1}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:s,parsedParams:a}=r;let{matchedRoutes:i}=r,l=!1;(o?o.path!=="/"&&s["**"]:Qt(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const u=l?Rm(this.options.notFoundMode,i):void 0,f=new Array(i.length),d=new Map(this.state.matches.map(p=>[p.routeId,p]));for(let p=0;p<i.length;p++){const m=i[p],v=f[p-1];let g,y,b;{const L=v?.search??t.search,k=v?._strictSearch??void 0;try{const A=po(m.options.validateSearch,{...L})??void 0;g={...L,...A},y={...k,...A},b=void 0}catch(A){let D=A;if(A instanceof Mo||(D=new Mo(A.message,{cause:A})),n?.throwOnError)throw D;g=L,y={},b=D}}const x=m.options.loaderDeps?.({search:g})??"",w=x?JSON.stringify(x):"",{interpolatedPath:E,usedParams:T}=gc({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),O=m.id+E+w,C=this.getMatch(O),S=d.get(m.id),N=C?._strictParams??T;let I;if(!C)try{wc(m,T,a,N)}catch(L){if(et(L)||at(L)?I=L:I=new bm(L.message,{cause:L}),n?.throwOnError)throw I}Object.assign(s,N);const P=S?"stay":"enter";let H;if(C)H={...C,cause:P,params:S?.params??s,_strictParams:N,search:st(S?S.search:C.search,g),_strictSearch:y};else{const L=m.options.loader||m.options.beforeLoad||m.lazyFn||pu(m)?"pending":"success";H={id:O,ssr:m.options.ssr,index:p,routeId:m.id,params:S?.params??s,_strictParams:N,pathname:E,updatedAt:Date.now(),search:S?st(S.search,g):g,_strictSearch:y,searchError:void 0,status:L,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Zn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:S?st(S.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(H.globalNotFound=u===m.id),H.searchError=b;const z=this.getParentContext(v);H.context={...z,...H.__routeContext,...H.__beforeLoadContext},f[p]=H}for(let p=0;p<f.length;p++){const m=f[p],v=this.looseRoutesById[m.routeId],g=this.getMatch(m.id),y=d.get(m.routeId);if(m.params=y?st(y.params,s):s,!g){const b=f[p-1],x=this.getParentContext(b);if(v.options.context){const w={deps:m.loaderDeps,params:m.params,context:x??{},location:t,navigate:E=>this.navigate({...E,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:f,routeId:v.id};m.__routeContext=v.options.context(w)??void 0}m.context={...x,...m.__routeContext,...m.__beforeLoadContext}}}return f}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:o}=this.getMatchedRoutes(t.pathname),s=wr(n),a={...t.search};for(const f of n)try{Object.assign(a,po(f.options.validateSearch,a))}catch{}const i=wr(this.state.matches),l=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let u;if(l)u=i.params;else{const f={...r};for(const d of n)try{wc(d,r,o??{},f)}catch{}u=f}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:u}}}class Mo extends Error{}class bm extends Error{}function xm(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function po(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Mo("Async validation not supported");if(n.issues)throw new Mo(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function wm({pathname:e,routesById:t,processedTree:n}){const r={},o=Qt(e);let s,a;const i=B1(o,n,!0);return i&&(s=i.route,Object.assign(r,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[ft]],routeParams:r,foundRoute:s,parsedParams:a}}function Em({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Sm(n)(e,t,r??!1)}function Sm(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const s=({search:a,next:i})=>{let l=a;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(l=o.options.preSearchFilters.reduce((f,d)=>d(f),a));const u=i(l);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,d)=>d(f),u):u};t.middlewares.push(s)}if(o.options.validateSearch){const s=({search:a,next:i})=>{const l=i(a);if(!t._includeValidateSearch)return l;try{return{...l,...po(o.options.validateSearch,l)??void 0}}catch{return l}};t.middlewares.push(s)}}const n=({search:o})=>{const s=t.dest;return s.search?s.search===!0?o:Wt(s.search,o):{}};t.middlewares.push(n);const r=(o,s,a)=>{if(o>=a.length)return s;const i=a[o];return i({search:s,next:u=>r(o+1,u,a)})};return function(s,a,i){return t.dest=a,t._includeValidateSearch=i,r(0,s,t.middlewares)}}function Rm(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return ft}function wc(e,t,n,r){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=o(r);Object.assign(r,s)}}const Cm="Error preloading route! ☝️";class vu{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=ft:this.parentRoute||Jt(!1);let s=o?ft:r?.path;s&&s!=="/"&&(s=iu(s));const a=r?.id||s;let i=o?ft:ho([this.parentRoute.id===ft?"":this.parentRoute.id,a]);s===ft&&(s="/"),i!==ft&&(i=ho(["/",i]));const l=i===ft?"/":ho([this.parentRoute.fullPath,s]);this._path=s,this._id=i,this._fullPath=l,this._to=Qt(l)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>uu({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Am{constructor({id:t}){this.notFound=n=>lu({routeId:this.id,...n}),this.redirect=n=>uu({from:this.id,...n}),this.id=t}}class Tm extends vu{constructor(t){super(t)}}const Pm="use",Ec=zo[Pm],Jr=typeof window<"u"?c.useLayoutEffect:c.useEffect;function Fs(e){const t=c.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Mm(e,t,n={},r={}){c.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function _m(e){const t=c.useRef(null);return c.useImperativeHandle(e,()=>t.current,[]),t}function si(e){const t=e.errorComponent??ai;return h.jsx(Nm,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?c.createElement(t,{error:n,reset:r}):e.children})}class Nm extends c.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function ai({error:e}){const[t,n]=c.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function Om({children:e,fallback:t=null}){return yu()?h.jsx(M.Fragment,{children:e}):h.jsx(M.Fragment,{children:t})}function yu(){return M.useSyncExternalStore(Im,()=>!0,()=>!1)}function Im(){return()=>{}}function Dm(e,t){return e===t}function Lm(e,t,n=Dm){const r=c.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:i}=e.subscribe(a);return i},[e]),o=c.useCallback(()=>e?.get(),[e]);return Wp.useSyncExternalStoreWithSelector(r,o,o,t,n)}const bu=c.createContext(null);function Ge(e){const t=c.useContext(bu);return e?.warn,t}function it(e){const t=Ge({warn:e?.router===void 0}),n=e?.router||t,r=c.useRef(void 0);return Lm(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=st(r.current,e.select(o));return r.current=s,s}return e.select(o)}return o})}const Yo=c.createContext(void 0),jm=c.createContext(void 0);function gt(e){const t=c.useContext(e.from?jm:Yo);return it({select:r=>{const o=r.matches.find(s=>e.from?e.from===s.routeId:s.id===t);if(Jt(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Qo(e){return gt({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Xo(e){const{select:t,...n}=e;return gt({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Jo(e){return gt({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function es(e){return gt({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function En(e){const t=Ge();return c.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function km(e,t){const n=Ge(),r=_m(t),{activeProps:o,inactiveProps:s,activeOptions:a,to:i,preload:l,preloadDelay:u,hashScrollIntoView:f,replace:d,startTransition:p,resetScroll:m,viewTransition:v,children:g,target:y,disabled:b,style:x,className:w,onClick:E,onBlur:T,onFocus:O,onMouseEnter:C,onMouseLeave:S,onTouchStart:N,ignoreBlocker:I,params:P,search:H,hash:z,state:L,mask:k,reloadDocument:A,unsafeRelative:D,from:j,_fromLocation:_,...V}=e,K=yu(),Y=it({select:ce=>{const ge=ce.matches[ce.matches.length-1];return{search:ge?.search,hash:ce.location.hash,path:ge?.pathname}},structuralSharing:!0}),B=e.from,q=c.useMemo(()=>({...e,from:B}),[n,Y,B,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),U=c.useMemo(()=>n.buildLocation({...q}),[n,q]),J=U.maskedLocation?U.maskedLocation.publicHref:U.publicHref,$=U.maskedLocation?U.maskedLocation.external:U.external,F=c.useMemo(()=>Zm(J,$,n.history,b),[b,$,J,n.history]),ee=c.useMemo(()=>{if(F?.external)return Ro(F.href,n.protocolAllowlist)?void 0:F.href;if(!Um(i)&&!(typeof i!="string"||i.indexOf(":")===-1))try{return new URL(i),Ro(i,n.protocolAllowlist)?void 0:i}catch{}},[i,F,n.protocolAllowlist]),Z=it({select:ce=>{if(ee)return!1;if(a?.exact){if(!K1(ce.location.pathname,U.pathname,n.basepath))return!1}else{const ge=Ao(ce.location.pathname,n.basepath),Re=Ao(U.pathname,n.basepath);if(!(ge.startsWith(Re)&&(ge.length===Re.length||ge[Re.length]==="/")))return!1}return(a?.includeSearch??!0)&&!ln(ce.location.search,U.search,{partial:!a?.exact,ignoreUndefined:!a?.explicitUndefined})?!1:a?.includeHash?K&&ce.location.hash===U.hash:!0}}),X=Z?Wt(o,{})??Fm:$s,te=Z?$s:Wt(s,{})??$s,ie=[w,X.className,te.className].filter(Boolean).join(" "),ue=(x||X.style||te.style)&&{...x,...X.style,...te.style},[Qe,Fe]=c.useState(!1),qe=c.useRef(!1),ct=e.reloadDocument||ee?!1:l??n.options.defaultPreload,Le=u??n.options.defaultPreloadDelay??0,Ne=c.useCallback(()=>{n.preloadRoute({...q,_builtLocation:U}).catch(ce=>{console.warn(ce),console.warn(Cm)})},[n,q,U]),Zt=c.useCallback(ce=>{ce?.isIntersecting&&Ne()},[Ne]);Mm(r,Zt,Vm,{disabled:!!b||ct!=="viewport"}),c.useEffect(()=>{qe.current||!b&&ct==="render"&&(Ne(),qe.current=!0)},[b,Ne,ct]);const Te=ce=>{const ge=ce.currentTarget.getAttribute("target"),Re=y!==void 0?y:ge;if(!b&&!qm(ce)&&!ce.defaultPrevented&&(!Re||Re==="_self")&&ce.button===0){ce.preventDefault(),$t.flushSync(()=>{Fe(!0)});const ut=n.subscribe("onResolved",()=>{ut(),Fe(!1)});n.navigate({...q,replace:d,resetScroll:m,hashScrollIntoView:f,startTransition:p,viewTransition:v,ignoreBlocker:I})}};if(ee)return{...V,ref:r,href:ee,...g&&{children:g},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...w&&{className:w},...E&&{onClick:E},...T&&{onBlur:T},...O&&{onFocus:O},...C&&{onMouseEnter:C},...S&&{onMouseLeave:S},...N&&{onTouchStart:N}};const lt=ce=>{if(b||ct!=="intent")return;if(!Le){Ne();return}const ge=ce.currentTarget;if(cr.has(ge))return;const Re=setTimeout(()=>{cr.delete(ge),Ne()},Le);cr.set(ge,Re)},An=ce=>{b||ct!=="intent"||Ne()},Tn=ce=>{if(b||!ct||!Le)return;const ge=ce.currentTarget,Re=cr.get(ge);Re&&(clearTimeout(Re),cr.delete(ge))};return{...V,...X,...te,href:F?.href,ref:r,onClick:_n([E,Te]),onBlur:_n([T,Tn]),onFocus:_n([O,lt]),onMouseEnter:_n([C,lt]),onMouseLeave:_n([S,Tn]),onTouchStart:_n([N,An]),disabled:!!b,target:y,...ue&&{style:ue},...ie&&{className:ie},...b&&$m,...Z&&Hm,...K&&Qe&&Bm}}const $s={},Fm={className:"active"},$m={role:"link","aria-disabled":!0},Hm={"data-status":"active","aria-current":"page"},Bm={"data-transitioning":"transitioning"},cr=new WeakMap,Vm={rootMargin:"100px"},_n=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Zm(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Um(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Pt=c.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=km(r,t),a=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:i,...l}=s;return c.createElement("a",l,a)}return c.createElement(n,s,a)});function qm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zm(e){return new Km({id:e})}class Km extends Am{constructor({id:t}){super({id:t}),this.useMatch=n=>gt({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>gt({from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>es({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Jo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Xo({...n,from:this.id,strict:!1}),this.useLoaderData=n=>Qo({...n,from:this.id,strict:!1}),this.useNavigate=()=>{const n=Ge();return En({from:n.routesById[this.id].fullPath})},this.notFound=n=>lu({routeId:this.id,...n}),this.Link=M.forwardRef((n,r)=>{const s=Ge().routesById[this.id].fullPath;return h.jsx(Pt,{ref:r,from:s,...n})})}}let Wm=class extends vu{constructor(t){super(t),this.useMatch=n=>gt({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>gt({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>es({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Jo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Xo({...n,from:this.id}),this.useLoaderData=n=>Qo({...n,from:this.id}),this.useNavigate=()=>En({from:this.fullPath}),this.Link=M.forwardRef((n,r)=>h.jsx(Pt,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function Ie(e){return new Wm(e)}class Gm extends Tm{constructor(t){super(t),this.useMatch=n=>gt({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>gt({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>es({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Jo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Xo({...n,from:this.id}),this.useLoaderData=n=>Qo({...n,from:this.id}),this.useNavigate=()=>En({from:this.fullPath}),this.Link=M.forwardRef((n,r)=>h.jsx(Pt,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Ym(e){return new Gm(e)}function Sc(e){return typeof e=="object"?new Rc(e,{silent:!0}).createRoute(e):new Rc(e,{silent:!0}).createRoute}class Rc{constructor(t,n){this.path=t,this.createRoute=r=>{const o=Ie(r);return o.isRoot=!1,o},this.silent=n?.silent}}class Cc{constructor(t){this.useMatch=n=>gt({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>gt({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>es({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Jo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Xo({...n,from:this.options.id}),this.useLoaderData=n=>Qo({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ge();return En({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Ac(e){return typeof e=="object"?new Cc(e):t=>new Cc({id:e,...t})}function Ue(e,t){let n,r,o,s;const a=()=>(n||(n=e().then(l=>{n=void 0,r=l.default}).catch(l=>{if(o=l,O1(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const u=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(u)||(sessionStorage.setItem(u,"1"),s=!0)}})),n),i=function(u){if(s)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!r)if(Ec)Ec(a());else throw a();return c.createElement(r,u)};return i.preload=a,i}function Qm(){const e=Ge(),t=c.useRef({router:e,mounted:!1}),[n,r]=c.useState(!1),{hasPendingMatches:o,isLoading:s}=it({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(p=>p.status==="pending")}),structuralSharing:!0}),a=Fs(s),i=s||n||o,l=Fs(i),u=s||o,f=Fs(u);return e.startTransition=d=>{r(!0),c.startTransition(()=>{d(),r(!1)})},c.useEffect(()=>{const d=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Qt(e.latestLocation.publicHref)!==Qt(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{d()}},[e,e.history]),Jr(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),Jr(()=>{a&&!s&&e.emit({type:"onLoad",...un(e.state)})},[a,e,s]),Jr(()=>{f&&!u&&e.emit({type:"onBeforeRouteMount",...un(e.state)})},[u,f,e]),Jr(()=>{if(l&&!i){const d=un(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),d.hrefChanged&&rm(e)}},[i,l,e]),null}function Xm(e){const t=it({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(si,{getResetKey:()=>t,onCatch:(n,r)=>{if(et(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(et(n))return e.fallback?.(n);throw n},children:e.children})}function Jm(){return h.jsx("p",{children:"Not Found"})}function jn(e){return h.jsx(h.Fragment,{children:e.children})}function xu(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(Jm,{})}function eg(){return Ge().isScrollRestoring,null}const wu=c.memo(function({matchId:t}){const n=Ge(),r=it({select:g=>{const y=g.matches.findIndex(x=>x.id===t),b=g.matches[y];return Jt(b),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:g.loadedAt,parentRouteId:g.matches[y-1]?.routeId}},structuralSharing:!0}),o=n.routesById[r.routeId],s=o.options.pendingComponent??n.options.defaultPendingComponent,a=s?h.jsx(s,{}):null,i=o.options.errorComponent??n.options.defaultErrorComponent,l=o.options.onCatch??n.options.defaultOnCatch,u=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,f=r.ssr===!1||r.ssr==="data-only",d=(!o.isRoot||o.options.wrapInSuspense||f)&&(o.options.wrapInSuspense??s??(o.options.errorComponent?.preload||f))?c.Suspense:jn,p=i?si:jn,m=u?Xm:jn,v=o.isRoot?o.options.shellComponent??jn:jn;return h.jsxs(v,{children:[h.jsx(Yo.Provider,{value:t,children:h.jsx(d,{fallback:a,children:h.jsx(p,{getResetKey:()=>r.resetKey,errorComponent:i||ai,onCatch:(g,y)=>{if(et(g))throw g;l?.(g,y)},children:h.jsx(m,{fallback:g=>{if(!u||g.routeId&&g.routeId!==r.routeId||!g.routeId&&!o.isRoot)throw g;return c.createElement(u,g)},children:f||r._displayPending?h.jsx(Om,{fallback:a,children:h.jsx(Tc,{matchId:t})}):h.jsx(Tc,{matchId:t})})})})}),r.parentRouteId===ft&&n.options.scrollRestoration?h.jsxs(h.Fragment,{children:[h.jsx(tg,{}),h.jsx(eg,{})]}):null]})});function tg(){const e=Ge(),t=c.useRef(void 0);return h.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...un(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Tc=c.memo(function({matchId:t}){const n=Ge(),{match:r,key:o,routeId:s}=it({select:l=>{const u=l.matches.find(v=>v.id===t),f=u.routeId,p=(n.routesById[f].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:f,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return{key:p?JSON.stringify(p):void 0,routeId:f,match:{id:u.id,status:u.status,error:u.error,invalid:u.invalid,_forcePending:u._forcePending,_displayPending:u._displayPending}}},structuralSharing:!0}),a=n.routesById[s],i=c.useMemo(()=>{const l=a.options.component??n.options.defaultComponent;return l?h.jsx(l,{},o):h.jsx(Eu,{})},[o,a.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const l=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(l){const u=n.getMatch(r.id);if(u&&!u._nonReactive.minPendingPromise){const f=Zn();u._nonReactive.minPendingPromise=f,setTimeout(()=>{f.resolve(),u._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Jt(et(r.error)),xu(n,a,r.error);if(r.status==="redirected")throw Jt(at(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return i}),Eu=c.memo(function(){const t=Ge(),n=c.useContext(Yo),r=it({select:u=>u.matches.find(f=>f.id===n)?.routeId}),o=t.routesById[r],s=it({select:u=>{const d=u.matches.find(p=>p.id===n);return Jt(d),d.globalNotFound}}),a=it({select:u=>{const f=u.matches,d=f.findIndex(p=>p.id===n);return f[d+1]?.id}}),i=t.options.defaultPendingComponent?h.jsx(t.options.defaultPendingComponent,{}):null;if(s)return xu(t,o,void 0);if(!a)return null;const l=h.jsx(wu,{matchId:a});return r===ft?h.jsx(c.Suspense,{fallback:i,children:l}):l});function ng(){const e=Ge(),n=e.routesById[ft].options.pendingComponent??e.options.defaultPendingComponent,r=n?h.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?jn:c.Suspense,s=h.jsxs(o,{fallback:r,children:[h.jsx(Qm,{}),h.jsx(rg,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:s}):s}function rg(){const e=Ge(),t=it({select:o=>o.matches[0]?.id}),n=it({select:o=>o.loadedAt}),r=t?h.jsx(wu,{matchId:t}):null;return h.jsx(Yo.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:h.jsx(si,{getResetKey:()=>n,errorComponent:ai,onCatch:void 0,children:r})})}const og=e=>new sg(e);class sg extends ym{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Sc,globalThis.createLazyFileRoute=Ac):typeof window<"u"&&(window.createFileRoute=Sc,window.createLazyFileRoute=Ac);function ag({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=h.jsx(bu.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:r}):r}function ig({router:e,...t}){return h.jsx(ag,{router:e,...t,children:h.jsx(ng,{})})}function ts(e){return it({select:t=>e?.select?e.select(t.location):t.location})}var Wn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lg=class{#e=cg;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},an=new lg;function ug(e){setTimeout(e,0)}var mn=typeof window>"u"||"Deno"in globalThis;function Ke(){}function dg(e,t){return typeof e=="function"?e(t):e}function ha(e){return typeof e=="number"&&e>=0&&e!==1/0}function Su(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xt(e,t){return typeof e=="function"?e(t):e}function ht(e,t){return typeof e=="function"?e(t):e}function Pc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:a,stale:i}=e;if(a){if(r){if(t.queryHash!==ii(a,t.options))return!1}else if(!Rr(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||o&&o!==t.state.fetchStatus||s&&!s(t))}function Mc(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(gn(t.options.mutationKey)!==gn(s))return!1}else if(!Rr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ii(e,t){return(t?.queryKeyHashFn||gn)(e)}function gn(e){return JSON.stringify(e,(t,n)=>pa(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Rr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Rr(e[n],t[n])):!1}var fg=Object.prototype.hasOwnProperty;function Ru(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=_c(e)&&_c(t);if(!r&&!(pa(e)&&pa(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),i=a.length,l=r?new Array(i):{};let u=0;for(let f=0;f<i;f++){const d=r?f:a[f],p=e[d],m=t[d];if(p===m){l[d]=p,(r?f<s:fg.call(e,d))&&u++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){l[d]=m;continue}const v=Ru(p,m,n+1);l[d]=v,v===p&&u++}return s===i&&u===s?e:l}function _o(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function _c(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pa(e){if(!Nc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Nc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Nc(e){return Object.prototype.toString.call(e)==="[object Object]"}function hg(e){return new Promise(t=>{an.setTimeout(t,e)})}function ma(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ru(e,t):t}function pg(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function mg(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ci=Symbol();function Cu(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ci?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function li(e,t){return typeof e=="function"?e(...t):!!e}function gg(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var vg=class extends Wn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!mn&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ui=new vg;function ga(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var yg=ug;function bg(){let e=[],t=0,n=i=>{i()},r=i=>{i()},o=yg;const s=i=>{t?e.push(i):o(()=>{n(i)})},a=()=>{const i=e;e=[],i.length&&o(()=>{r(()=>{i.forEach(l=>{n(l)})})})};return{batch:i=>{let l;t++;try{l=i()}finally{t--,t||a()}return l},batchCalls:i=>(...l)=>{s(()=>{i(...l)})},schedule:s,setNotifyFunction:i=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{o=i}}}var _e=bg(),xg=class extends Wn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!mn&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},No=new xg;function wg(e){return Math.min(1e3*2**e,3e4)}function Au(e){return(e??"online")==="online"?No.isOnline():!0}var va=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Tu(e){let t=!1,n=0,r;const o=ga(),s=()=>o.status!=="pending",a=g=>{if(!s()){const y=new va(g);p(y),e.onCancel?.(y)}},i=()=>{t=!0},l=()=>{t=!1},u=()=>ui.isFocused()&&(e.networkMode==="always"||No.isOnline())&&e.canRun(),f=()=>Au(e.networkMode)&&e.canRun(),d=g=>{s()||(r?.(),o.resolve(g))},p=g=>{s()||(r?.(),o.reject(g))},m=()=>new Promise(g=>{r=y=>{(s()||u())&&g(y)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),v=()=>{if(s())return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(d).catch(b=>{if(s())return;const x=e.retry??(mn?0:3),w=e.retryDelay??wg,E=typeof w=="function"?w(n,b):w,T=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!T){p(b);return}n++,e.onFail?.(n,b),hg(E).then(()=>u()?void 0:m()).then(()=>{t?p(b):v()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(r?.(),o),cancelRetry:i,continueRetry:l,canStart:f,start:()=>(f()?v():m().then(v),o)}}var Pu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ha(this.gcTime)&&(this.#e=an.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mn?1/0:300*1e3))}clearGcTimeout(){this.#e&&(an.clearTimeout(this.#e),this.#e=void 0)}},Eg=class extends Pu{#e;#t;#n;#o;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Ic(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Ic(this.options);t.data!==void 0&&(this.setState(Oc(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=ma(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Ke).catch(Ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ht(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ci||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Su(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const i=this.observers.find(l=>l.options.queryFn);i&&this.setOptions(i.options)}const n=new AbortController,r=i=>{Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const i=Cu(this.options,t),u=(()=>{const f={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#i=!1,this.options.persister?this.options.persister(i,u,this):i(u)},a=(()=>{const i={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return r(i),i})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=Tu({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:i=>{i instanceof va&&i.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(i,l)=>{this.#s({type:"failed",failureCount:i,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const i=await this.#r.start();if(i===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(i),this.#n.config.onSuccess?.(i,this),this.#n.config.onSettled?.(i,this.state.error,this),i}catch(i){if(i instanceof va){if(i.silent)return this.#r.promise;if(i.revert){if(this.state.data===void 0)throw i;return this.state.data}}throw this.#s({type:"error",error:i}),this.#n.config.onError?.(i,this),this.#n.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Mu(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Oc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),_e.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Mu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Au(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Oc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ic(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var _u=class extends Wn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=ga(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#a;#i;#s;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Dc(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ya(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ya(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ht(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!_o(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Lc(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||ht(this.options.enabled,this.#t)!==ht(t.enabled,this.#t)||Xt(this.options.staleTime,this.#t)!==Xt(t.staleTime,this.#t))&&this.#g();const o=this.#v();r&&(this.#t!==n||ht(this.options.enabled,this.#t)!==ht(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Rg(this,n)&&(this.#o=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ke)),t}#g(){this.#x();const e=Xt(this.options.staleTime,this.#t);if(mn||this.#o.isStale||!ha(e))return;const n=Su(this.#o.dataUpdatedAt,e)+1;this.#l=an.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(mn||ht(this.options.enabled,this.#t)===!1||!ha(this.#c)||this.#c===0)&&(this.#u=an.setInterval(()=>{(this.options.refetchIntervalInBackground||ui.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#l&&(an.clearTimeout(this.#l),this.#l=void 0)}#w(){this.#u&&(an.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#o,s=this.#r,a=this.#a,l=e!==n?e.state:this.#n,{state:u}=e;let f={...u},d=!1,p;if(t._optimisticResults){const S=this.hasListeners(),N=!S&&Dc(e,t),I=S&&Lc(e,n,t,r);(N||I)&&(f={...f,...Mu(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:g}=f;p=f.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&g==="pending"){let S;o?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(S=o.data,y=!0):S=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,S!==void 0&&(g="success",p=ma(o?.data,S,t),d=!0)}if(t.select&&p!==void 0&&!y)if(o&&p===s?.data&&t.select===this.#m)p=this.#f;else try{this.#m=t.select,p=t.select(p),p=ma(o?.data,p,t),this.#f=p,this.#s=null}catch(S){this.#s=S}this.#s&&(m=this.#s,p=this.#f,v=Date.now(),g="error");const b=f.fetchStatus==="fetching",x=g==="pending",w=g==="error",E=x&&b,T=p!==void 0,C={status:g,fetchStatus:f.fetchStatus,isPending:x,isSuccess:g==="success",isError:w,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:w&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&T,isStale:di(e,t),refetch:this.refetch,promise:this.#i,isEnabled:ht(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const S=C.data!==void 0,N=C.status==="error"&&!S,I=z=>{N?z.reject(C.error):S&&z.resolve(C.data)},P=()=>{const z=this.#i=C.promise=ga();I(z)},H=this.#i;switch(H.status){case"pending":e.queryHash===n.queryHash&&I(H);break;case"fulfilled":(N||C.data!==H.value)&&P();break;case"rejected":(!N||C.error!==H.reason)&&P();break}}return C}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),_o(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#p.size)return!0;const s=new Set(o??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#o).some(a=>{const i=a;return this.#o[i]!==e[i]&&s.has(i)})};this.#S({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){_e.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Sg(e,t){return ht(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Dc(e,t){return Sg(e,t)||e.state.data!==void 0&&ya(e,t,t.refetchOnMount)}function ya(e,t,n){if(ht(t.enabled,e)!==!1&&Xt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&di(e,t)}return!1}function Lc(e,t,n,r){return(e!==t||ht(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&di(e,n)}function di(e,t){return ht(t.enabled,e)!==!1&&e.isStaleByTime(Xt(t.staleTime,e))}function Rg(e,t){return!_o(e.getCurrentResult(),t)}function jc(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let i={pages:[],pageParams:[]},l=0;const u=async()=>{let f=!1;const d=v=>{gg(v,()=>t.signal,()=>f=!0)},p=Cu(t.options,t.fetchOptions),m=async(v,g,y)=>{if(f)return Promise.reject();if(g==null&&v.pages.length)return Promise.resolve(v);const x=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return d(O),O})(),w=await p(x),{maxPages:E}=t.options,T=y?mg:pg;return{pages:T(v.pages,w,E),pageParams:T(v.pageParams,g,E)}};if(o&&s.length){const v=o==="backward",g=v?Cg:kc,y={pages:s,pageParams:a},b=g(r,y);i=await m(y,b,v)}else{const v=e??s.length;do{const g=l===0?a[0]??r.initialPageParam:kc(r,i);if(l>0&&g==null)break;i=await m(i,g),l++}while(l<v)}return i};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function kc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Cg(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ag=class extends Pu{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Nu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=Tu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,a)=>{this.#r({type:"failed",failureCount:s,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#o.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:o})}const s=await this.#o.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),_e.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Nu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tg=class extends Wn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new Ag({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=eo(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=eo(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=eo(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=eo(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){_e.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Mc(t,n))}findAll(e={}){return this.getAll().filter(t=>Mc(e,t))}notify(e){_e.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return _e.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ke))))}};function eo(e){return e.options.scope?.id}var Pg=class extends Wn{#e;#t=void 0;#n;#o;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),_o(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&gn(n.mutationKey)!==gn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#o=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??Nu();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){_e.batch(()=>{if(this.#o&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,n,r,o)}catch(s){Promise.reject(s)}try{this.#o.onSettled?.(t.data,null,n,r,o)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,n,r,o)}catch(s){Promise.reject(s)}try{this.#o.onSettled?.(void 0,t.error,n,r,o)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Mg=class extends Wn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??ii(r,t);let s=this.get(o);return s||(s=new Eg({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){_e.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Pc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Pc(e,n)):t}notify(e){_e.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_e.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_e.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_g=class{#e;#t;#n;#o;#r;#a;#i;#s;constructor(e={}){this.#e=e.queryCache||new Mg,this.#t=e.mutationCache||new Tg,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=ui.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=No.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,a=dg(t,s);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _e.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;_e.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return _e.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=_e.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ke).catch(Ke)}invalidateQueries(e,t={}){return _e.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=_e.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ke)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ke)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Xt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ke).catch(Ke)}fetchInfiniteQuery(e){return e.behavior=jc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ke).catch(Ke)}ensureInfiniteQueryData(e){return e.behavior=jc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return No.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(gn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Rr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(gn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Rr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ii(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ci&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ou=c.createContext(void 0),Gn=e=>{const t=c.useContext(Ou);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ng=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(Ou.Provider,{value:e,children:t})),Iu=c.createContext(!1),Og=()=>c.useContext(Iu);Iu.Provider;function Du(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Lu=c.createContext(Du()),Ig=()=>c.useContext(Lu),Dg=({children:e})=>{const[t]=c.useState(()=>Du());return h.jsx(Lu.Provider,{value:t,children:typeof e=="function"?e(t):e})},Lg=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?li(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},jg=e=>{c.useEffect(()=>{e.clearReset()},[e])},kg=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||li(n,[e.error,r])),Fg=(e,t)=>t.state.data===void 0,$g=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Hg=(e,t)=>e.isLoading&&e.isFetching&&!t,Bg=(e,t)=>e?.suspense&&t.isPending,Fc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ju(e,t,n){const r=Og(),o=Ig(),s=Gn(),a=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const i=s.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",$g(a),Lg(a,o,i),jg(o);const l=!s.getQueryCache().get(a.queryHash),[u]=c.useState(()=>new t(s,a)),f=u.getOptimisticResult(a),d=!r&&e.subscribed!==!1;if(c.useSyncExternalStore(c.useCallback(p=>{const m=d?u.subscribe(_e.batchCalls(p)):Ke;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c.useEffect(()=>{u.setOptions(a)},[a,u]),Bg(a,f))throw Fc(a,u,o);if(kg({result:f,errorResetBoundary:o,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,f),a.experimental_prefetchInRender&&!mn&&Hg(f,r)&&(l?Fc(a,u,o):i?.promise)?.catch(Ke).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?f:u.trackResult(f)}function Vg(e,t){return ju(e,_u)}function ku(e,t){return ju({...e,enabled:!0,suspense:!0,throwOnError:Fg,placeholderData:void 0},_u)}function Zg(e,t){const n=Gn(),[r]=c.useState(()=>new Pg(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);const o=c.useSyncExternalStore(c.useCallback(a=>r.subscribe(_e.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=c.useCallback((a,i)=>{r.mutate(a,i).catch(Ke)},[r]);if(o.error&&li(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var Hs={confirmLabel:"OK",dismissible:!0},$c={confirmLabel:"Continue",cancelLabel:"Cancel",tone:"default",dismissible:!0},Ug=e=>typeof e=="string"?{title:e,...Hs}:{...Hs,...e,dismissible:e.dismissible??Hs.dismissible},qg=e=>typeof e=="string"?{title:e,...$c}:{...$c,...e,dismissible:e.dismissible??e.tone!=="danger"},zg=()=>{let e={current:null};const t=new Set,n=()=>{t.forEach(l=>l())},r=l=>{e=l,n()},o=()=>e,s=()=>{const l=e.current;!l||l.kind!=="alert"||(r({current:null}),l.resolver())},a=l=>{const u=e.current;!u||u.kind!=="confirm"||(r({current:null}),u.resolver(l))},i=()=>{const l=e.current;if(l){if(l.kind==="confirm"){a(!1);return}s()}};return{subscribe:l=>(t.add(l),()=>{t.delete(l)}),getSnapshot:o,alert:l=>{const u=Ug(l);return i(),new Promise(f=>{r({current:{kind:"alert",options:u,resolver:f}})})},confirm:l=>{const u=qg(l);return i(),new Promise(f=>{r({current:{kind:"confirm",options:u,resolver:f}})})},resolveAlert:s,resolveConfirm:a,dismiss:i,reset:()=>{i()}}},Fu=c.createContext(null),Kg=()=>{const e=c.useRef();return e.current||(e.current=zg()),e.current},Wg=({children:e,components:t})=>{const n=Kg(),r=c.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);c.useEffect(()=>()=>{n.reset()},[n]);const o=n,s=r.current;return h.jsxs(Fu.Provider,{value:o,children:[e,s?.kind==="alert"&&h.jsx(t.Alert,{open:!0,options:s.options,onClose:n.resolveAlert}),s?.kind==="confirm"&&h.jsx(t.Confirm,{open:!0,options:s.options,onCancel:()=>n.resolveConfirm(!1),onConfirm:()=>n.resolveConfirm(!0)})]})},Gg=()=>{const e=c.useContext(Fu);if(!e)throw new Error("useModal must be used within ModalProvider");return e};function Yg(e,t){const n=c.createContext(t),r=s=>{const{children:a,...i}=s,l=c.useMemo(()=>i,Object.values(i));return h.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(s){const a=c.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Nt(e,t=[]){let n=[];function r(s,a){const i=c.createContext(a),l=n.length;n=[...n,a];const u=d=>{const{scope:p,children:m,...v}=d,g=p?.[e]?.[l]||i,y=c.useMemo(()=>v,Object.values(v));return h.jsx(g.Provider,{value:y,children:m})};u.displayName=s+"Provider";function f(d,p){const m=p?.[e]?.[l]||i,v=c.useContext(m);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const o=()=>{const s=n.map(a=>c.createContext(a));return function(i){const l=i?.[e]||s;return c.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Qg(o,...t)]}function Qg(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...i,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Hc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Dr(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Hc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Hc(e[o],null)}}}}function le(...e){return c.useCallback(Dr(...e),e)}function W(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Ve=globalThis?.document?c.useLayoutEffect:()=>{},Xg=zo[" useId ".trim().toString()]||(()=>{}),Jg=0;function Tt(e){const[t,n]=c.useState(Xg());return Ve(()=>{n(r=>r??String(Jg++))},[e]),t?`radix-${t}`:""}var e2=zo[" useInsertionEffect ".trim().toString()]||Ve;function Bt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=t2({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==i&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,r])}const u=c.useCallback(f=>{if(i){const d=n2(f)?f(e):f;d!==e&&a.current?.(d)}else s(f)},[i,e,s,a]);return[l,u]}function t2({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),s=c.useRef(t);return e2(()=>{s.current=t},[t]),c.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function n2(e){return typeof e=="function"}function qn(e){const t=r2(e),n=c.forwardRef((r,o)=>{const{children:s,...a}=r,i=c.Children.toArray(s),l=i.find(o2);if(l){const u=l.props.children,f=i.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return h.jsx(t,{...a,ref:o,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return h.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function r2(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const a=a2(o),i=s2(s,o.props);return o.type!==c.Fragment&&(i.ref=r?Dr(r,a):a),c.cloneElement(o,i)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $u=Symbol("radix.slottable");function Hu(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=$u,t}function o2(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$u}function s2(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function a2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var i2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],re=i2.reduce((e,t)=>{const n=qn(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bu(e,t){e&&$t.flushSync(()=>e.dispatchEvent(t))}function Mt(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function c2(e,t=globalThis?.document){const n=Mt(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var l2="DismissableLayer",ba="dismissableLayer.update",u2="dismissableLayer.pointerDownOutside",d2="dismissableLayer.focusOutside",Bc,Vu=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lr=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...l}=e,u=c.useContext(Vu),[f,d]=c.useState(null),p=f?.ownerDocument??globalThis?.document,[,m]=c.useState({}),v=le(t,C=>d(C)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(y),x=f?g.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,E=x>=b,T=p2(C=>{const S=C.target,N=[...u.branches].some(I=>I.contains(S));!E||N||(o?.(C),a?.(C),C.defaultPrevented||i?.())},p),O=m2(C=>{const S=C.target;[...u.branches].some(I=>I.contains(S))||(s?.(C),a?.(C),C.defaultPrevented||i?.())},p);return c2(C=>{x===u.layers.size-1&&(r?.(C),!C.defaultPrevented&&i&&(C.preventDefault(),i()))},p),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Bc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Vc(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Bc)}},[f,p,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Vc())},[f,u]),c.useEffect(()=>{const C=()=>m({});return document.addEventListener(ba,C),()=>document.removeEventListener(ba,C)},[]),h.jsx(re.div,{...l,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,O.onFocusCapture),onBlurCapture:W(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,T.onPointerDownCapture)})});Lr.displayName=l2;var f2="DismissableLayerBranch",h2=c.forwardRef((e,t)=>{const n=c.useContext(Vu),r=c.useRef(null),o=le(t,r);return c.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),h.jsx(re.div,{...e,ref:o})});h2.displayName=f2;function p2(e,t=globalThis?.document){const n=Mt(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){Zu(u2,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function m2(e,t=globalThis?.document){const n=Mt(e),r=c.useRef(!1);return c.useEffect(()=>{const o=s=>{s.target&&!r.current&&Zu(d2,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vc(){const e=new CustomEvent(ba);document.dispatchEvent(e)}function Zu(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Bu(o,s):o.dispatchEvent(s)}var Bs="focusScope.autoFocusOnMount",Vs="focusScope.autoFocusOnUnmount",Zc={bubbles:!1,cancelable:!0},g2="FocusScope",ns=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,l]=c.useState(null),u=Mt(o),f=Mt(s),d=c.useRef(null),p=le(t,g=>l(g)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let g=function(w){if(m.paused||!i)return;const E=w.target;i.contains(E)?d.current=E:qt(d.current,{select:!0})},y=function(w){if(m.paused||!i)return;const E=w.relatedTarget;E!==null&&(i.contains(E)||qt(d.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&qt(i)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const x=new MutationObserver(b);return i&&x.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),x.disconnect()}}},[r,i,m.paused]),c.useEffect(()=>{if(i){qc.add(m);const g=document.activeElement;if(!i.contains(g)){const b=new CustomEvent(Bs,Zc);i.addEventListener(Bs,u),i.dispatchEvent(b),b.defaultPrevented||(v2(E2(Uu(i)),{select:!0}),document.activeElement===g&&qt(i))}return()=>{i.removeEventListener(Bs,u),setTimeout(()=>{const b=new CustomEvent(Vs,Zc);i.addEventListener(Vs,f),i.dispatchEvent(b),b.defaultPrevented||qt(g??document.body,{select:!0}),i.removeEventListener(Vs,f),qc.remove(m)},0)}}},[i,u,f,m]);const v=c.useCallback(g=>{if(!n&&!r||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(y&&b){const x=g.currentTarget,[w,E]=y2(x);w&&E?!g.shiftKey&&b===E?(g.preventDefault(),n&&qt(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),n&&qt(E,{select:!0})):b===x&&g.preventDefault()}},[n,r,m.paused]);return h.jsx(re.div,{tabIndex:-1,...a,ref:p,onKeyDown:v})});ns.displayName=g2;function v2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qt(r,{select:t}),document.activeElement!==n)return}function y2(e){const t=Uu(e),n=Uc(t,e),r=Uc(t.reverse(),e);return[n,r]}function Uu(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Uc(e,t){for(const n of e)if(!b2(n,{upTo:t}))return n}function b2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function x2(e){return e instanceof HTMLInputElement&&"select"in e}function qt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&x2(e)&&t&&e.select()}}var qc=w2();function w2(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=zc(e,t),e.unshift(t)},remove(t){e=zc(e,t),e[0]?.resume()}}}function zc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function E2(e){return e.filter(t=>t.tagName!=="A")}var S2="Portal",jr=c.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=c.useState(!1);Ve(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?Xl.createPortal(h.jsx(re.div,{...r,ref:t}),a):null});jr.displayName=S2;function R2(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var Ot=e=>{const{present:t,children:n}=e,r=C2(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),s=le(r.ref,A2(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:s}):null};Ot.displayName="Presence";function C2(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),s=c.useRef("none"),a=e?"mounted":"unmounted",[i,l]=R2(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=to(r.current);s.current=i==="mounted"?u:"none"},[i]),Ve(()=>{const u=r.current,f=o.current;if(f!==e){const p=s.current,m=to(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ve(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=m=>{const g=to(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=m=>{m.target===t&&(s.current=to(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function to(e){return e?.animationName||"none"}function A2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zs=0;function fi(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Kc()),document.body.insertAdjacentElement("beforeend",e[1]??Kc()),Zs++,()=>{Zs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zs--}},[])}function Kc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var T2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Nn=new WeakMap,no=new WeakMap,ro={},Us=0,qu=function(e){return e&&(e.host||qu(e.parentNode))},P2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qu(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},M2=function(e,t,n,r){var o=P2(t,Array.isArray(e)?e:[e]);ro[n]||(ro[n]=new WeakMap);var s=ro[n],a=[],i=new Set,l=new Set(o),u=function(d){!d||i.has(d)||(i.add(d),u(d.parentNode))};o.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(i.has(p))f(p);else try{var m=p.getAttribute(r),v=m!==null&&m!=="false",g=(Nn.get(p)||0)+1,y=(s.get(p)||0)+1;Nn.set(p,g),s.set(p,y),a.push(p),g===1&&v&&no.set(p,!0),y===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return f(t),i.clear(),Us++,function(){a.forEach(function(d){var p=Nn.get(d)-1,m=s.get(d)-1;Nn.set(d,p),s.set(d,m),p||(no.has(d)||d.removeAttribute(r),no.delete(d)),m||d.removeAttribute(n)}),Us--,Us||(Nn=new WeakMap,Nn=new WeakMap,no=new WeakMap,ro={})}},hi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=T2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),M2(r,o,n,"aria-hidden")):function(){return null}},rs="Dialog",[zu,Ku]=Nt(rs),[_2,Et]=zu(rs),Wu=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=c.useRef(null),l=c.useRef(null),[u,f]=Bt({prop:r,defaultProp:o??!1,onChange:s,caller:rs});return h.jsx(_2,{scope:t,triggerRef:i,contentRef:l,contentId:Tt(),titleId:Tt(),descriptionId:Tt(),open:u,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};Wu.displayName=rs;var Gu="DialogTrigger",Yu=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(Gu,n),s=le(t,o.triggerRef);return h.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gi(o.open),...r,ref:s,onClick:W(e.onClick,o.onOpenToggle)})});Yu.displayName=Gu;var pi="DialogPortal",[N2,Qu]=zu(pi,{forceMount:void 0}),Xu=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Et(pi,t);return h.jsx(N2,{scope:t,forceMount:n,children:c.Children.map(r,a=>h.jsx(Ot,{present:n||s.open,children:h.jsx(jr,{asChild:!0,container:o,children:a})}))})};Xu.displayName=pi;var Oo="DialogOverlay",Ju=c.forwardRef((e,t)=>{const n=Qu(Oo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Et(Oo,e.__scopeDialog);return s.modal?h.jsx(Ot,{present:r||s.open,children:h.jsx(I2,{...o,ref:t})}):null});Ju.displayName=Oo;var O2=qn("DialogOverlay.RemoveScroll"),I2=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(Oo,n);return h.jsx(Ya,{as:O2,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(re.div,{"data-state":gi(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vn="DialogContent",ed=c.forwardRef((e,t)=>{const n=Qu(vn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Et(vn,e.__scopeDialog);return h.jsx(Ot,{present:r||s.open,children:s.modal?h.jsx(D2,{...o,ref:t}):h.jsx(L2,{...o,ref:t})})});ed.displayName=vn;var D2=c.forwardRef((e,t)=>{const n=Et(vn,e.__scopeDialog),r=c.useRef(null),o=le(t,n.contentRef,r);return c.useEffect(()=>{const s=r.current;if(s)return hi(s)},[]),h.jsx(td,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:W(e.onFocusOutside,s=>s.preventDefault())})}),L2=c.forwardRef((e,t)=>{const n=Et(vn,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return h.jsx(td,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),td=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=Et(vn,n),l=c.useRef(null),u=le(t,l);return fi(),h.jsxs(h.Fragment,{children:[h.jsx(ns,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:h.jsx(Lr,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":gi(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(k2,{titleId:i.titleId}),h.jsx($2,{contentRef:l,descriptionId:i.descriptionId})]})]})}),mi="DialogTitle",nd=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(mi,n);return h.jsx(re.h2,{id:o.titleId,...r,ref:t})});nd.displayName=mi;var rd="DialogDescription",od=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(rd,n);return h.jsx(re.p,{id:o.descriptionId,...r,ref:t})});od.displayName=rd;var sd="DialogClose",ad=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Et(sd,n);return h.jsx(re.button,{type:"button",...r,ref:t,onClick:W(e.onClick,()=>o.onOpenChange(!1))})});ad.displayName=sd;function gi(e){return e?"open":"closed"}var id="DialogTitleWarning",[j2,cd]=Yg(id,{contentName:vn,titleName:mi,docsSlug:"dialog"}),k2=({titleId:e})=>{const t=cd(id),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
3
3
 
4
4
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
5
5
 
@@ -17,26 +17,26 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
17
17
  `);return a===-1?"":o.stack.slice(a+1)})();try{if(!r.stack)r.stack=s;else if(s){const a=s.indexOf(`
18
18
  `),i=a===-1?-1:s.indexOf(`
19
19
  `,a+1),l=i===-1?"":s.slice(i+1);String(r.stack).endsWith(l)||(r.stack+=`
20
- `+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=yn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&vo.assertOptions(r,{silentJSONParsing:dt.transitional(dt.boolean),forcedJSONParsing:dt.transitional(dt.boolean),clarifyTimeoutError:dt.transitional(dt.boolean),legacyInterceptorReqResOrdering:dt.transitional(dt.boolean)},!1),o!=null&&(R.isFunction(o)?n.paramsSerializer={serialize:o}:vo.assertOptions(o,{encode:dt.function,serialize:dt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),vo.assertOptions(n,{baseUrl:dt.spelling("baseURL"),withXsrfToken:dt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&R.merge(s.common,s[n.method]);s&&R.forEach(["delete","get","head","post","put","patch","query","common"],v=>{delete s[v]}),n.headers=We.concat(a,s);const i=[];let l=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(n)===!1)return;l=l&&g.synchronous;const y=n.transitional||Ri;y&&y.legacyInterceptorReqResOrdering?i.unshift(g.fulfilled,g.rejected):i.push(g.fulfilled,g.rejected)});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let f,d=0,p;if(!l){const v=[dl.bind(this),void 0];for(v.unshift(...i),v.push(...u),p=v.length,f=Promise.resolve(n);d<p;)f=f.then(v[d++],v[d++]);return f}p=i.length;let m=n;for(;d<p;){const v=i[d++],g=i[d++];try{m=v(m)}catch(y){g.call(this,y);break}}try{f=dl.call(this,m)}catch(v){return Promise.reject(v)}for(d=0,p=u.length;d<p;)f=f.then(u[d++],u[d++]);return f}getUri(t){t=yn(this.defaults,t);const n=Rf(t.baseURL,t.url,t.allowAbsoluteUrls);return xf(n,t.params,t.paramsSerializer)}};R.forEach(["delete","get","head","options"],function(t){dn.prototype[t]=function(n,r){return this.request(yn(r||{},{method:t,url:n,data:(r||{}).data}))}});R.forEach(["post","put","patch","query"],function(t){function n(r){return function(s,a,i){return this.request(yn(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}dn.prototype[t]=n(),t!=="query"&&(dn.prototype[t+"Form"]=n(!0))});let R8=class Pf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(i=>{r.subscribe(i),s=i}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s,a,i){r.reason||(r.reason=new Br(s,a,i),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Pf(function(o){t=o}),cancel:t}}};function C8(e){return function(n){return e.apply(null,n)}}function A8(e){return R.isObject(e)&&e.isAxiosError===!0}const Ca={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ca).forEach(([e,t])=>{Ca[t]=e});function Mf(e){const t=new dn(e),n=lf(dn.prototype.request,t);return R.extend(n,dn.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Mf(yn(e,o))},n}const ye=Mf(Hr);ye.Axios=dn;ye.CanceledError=Br;ye.CancelToken=R8;ye.isCancel=Ef;ye.VERSION=Ai;ye.toFormData=cs;ye.AxiosError=G;ye.Cancel=ye.CanceledError;ye.all=function(t){return Promise.all(t)};ye.spread=C8;ye.isAxiosError=A8;ye.mergeConfig=yn;ye.AxiosHeaders=We;ye.formToJSON=e=>wf(R.isHTMLForm(e)?new FormData(e):e);ye.getAdapter=Tf.getAdapter;ye.HttpStatusCode=Ca;ye.default=ye;const{Axios:zC,AxiosError:KC,CanceledError:WC,isCancel:GC,CancelToken:YC,VERSION:QC,all:XC,Cancel:JC,isAxiosError:e5,spread:t5,toFormData:n5,AxiosHeaders:r5,HttpStatusCode:o5,formToJSON:s5,getAdapter:a5,mergeConfig:i5,create:c5}=ye,Pi="/login",T8="/api/auth/";let hl,pl=!1;const P8=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${Pi}?next=${encodeURIComponent(t)}`},M8=e=>{if(!ye.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(T8)&&t!==Pi},_8=e=>!!(e.authRequired&&!e.authenticated),_f=(e=window.location)=>{pl||e.pathname===Pi||(pl=!0,e.assign(P8(e)))},N8=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return;const n=await t.json();_8(n)&&_f()},O8=()=>{hl===void 0&&(hl=ye.interceptors.response.use(e=>e,e=>(M8(e)&&_f(),Promise.reject(e))))},I8=e=>!e||e.length===0?null:[...new Set(e)].sort(),D8=e=>!e||e.length===0?[]:[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort(),L8=e=>!e||e.length===0?null:[...new Set(e)].sort(),ve={notes:{all:()=>["notes"],listAll:()=>["notes","list"],list:(e={})=>["notes","list",{limit:e.limit??25,offset:e.offset??0,query:e.query??"",sortBy:e.sortBy??null,sortOrder:e.sortOrder??null,pinnedFirst:e.pinnedFirst??null,fields:I8(e.fields)}],tagListAll:()=>["notes","tag-list"],tagList:(e={})=>["notes","tag-list",{limit:e.limit??25,offset:e.offset??0,query:e.query??""}],tagNameListAll:()=>["notes","tag-name-list"],tagNameList:e=>["notes","tag-name-list",{limit:e.limit??25,offset:e.offset??0,mode:e.mode??"and",tagNames:D8(e.tagNames)}],detail:e=>["notes","detail",{id:e}],snapshots:(e,t=10)=>["notes","snapshots",{id:e,limit:t}],snapshotDetail:e=>["notes","snapshot-detail",{id:e}],trashAll:()=>["notes","trash"],trash:(e={})=>["notes","trash",{limit:e.limit??25,offset:e.offset??0}],trashDetail:e=>["notes","trash","detail",{id:e}],pinned:()=>["notes","pinned"],backReferencesAll:()=>["notes","back-references"],backReferences:e=>["notes","back-references",{noteId:e}],graph:()=>["notes","graph"],propertyKeysAll:()=>["notes","property-keys"],propertyKeys:(e={})=>["notes","property-keys",{query:e.query??"",limit:e.limit??50,offset:e.offset??0}]},tags:{all:()=>["tags"],list:(e={})=>["tags","list",{limit:e.limit??50,offset:e.offset??0,query:e.query??""}]},images:{all:()=>["images"],listAll:()=>["images","list"],list:(e={})=>["images","list",{limit:e.limit??50,offset:e.offset??0}],detail:e=>["images","detail",{id:e}],notes:e=>["images","notes",{id:e}]},reminders:{all:()=>["reminders"],note:(e,t={})=>["reminders","note",e,{limit:t.limit??10,offset:t.offset??0}],noteAllPages:e=>["reminders","note",e],upcoming:(e={})=>["reminders","upcoming",{limit:e.limit??10,offset:e.offset??0}],upcomingAllPages:()=>["reminders","upcoming"],inDateRangeAll:()=>["reminders","in-date-range"],inDateRange:(e,t)=>["reminders","in-date-range",{year:e,month:t}]},placeholders:{all:()=>["placeholders"],listAll:()=>["placeholders","list"],list:(e={})=>["placeholders","list",{limit:e.limit??25,offset:e.offset??0,query:e.query??"",fields:L8(e.fields)}]},calendar:{all:()=>["calendar"],notesInDateRange:(e,t)=>["calendar","notes-in-date-range",{year:e,month:t}]},views:{all:()=>["views"],workspace:()=>["views","workspace"],section:e=>["views","section",{id:e}],sectionNotesAll:()=>["views","section-notes"],sectionNotes:(e,t={})=>["views","section-notes",{id:e,limit:t.limit??25,offset:t.offset??0}]},ui:{heroBanner:()=>["ui","hero-banner"]}},Aa=[{queryKey:ve.notes.listAll(),exact:!1},{queryKey:ve.notes.tagListAll(),exact:!1},{queryKey:ve.notes.tagNameListAll(),exact:!1},{queryKey:ve.notes.pinned(),exact:!0},{queryKey:ve.notes.backReferencesAll(),exact:!1},{queryKey:ve.notes.graph(),exact:!0},{queryKey:ve.views.sectionNotesAll(),exact:!1},{queryKey:ve.tags.all(),exact:!1}],Nf={queryKey:ve.notes.propertyKeysAll(),exact:!1},j8=[...Aa,Nf,{queryKey:ve.notes.trashAll(),exact:!1},{queryKey:ve.reminders.all(),exact:!1},{queryKey:ve.images.all(),exact:!1},{queryKey:ve.calendar.all(),exact:!1}],Qs=async(e,t)=>{await Promise.all(t.map(n=>e.invalidateQueries(n)))},k8=async(e,t)=>{switch(t.type){case"mcp.note.created":case"web.note.updated":await Qs(e,Aa);return;case"mcp.note.updated":await Qs(e,[...Aa,Nf]);return;case"mcp.note.deleted":await Qs(e,j8);return}},F8=["mcp.note.created","mcp.note.updated","mcp.note.deleted"],$8=["web.note.updated"],H8=[...F8,...$8],Ta=new Set,B8="ocean-brain:web-note-events",Of="ocean-brain:web-note-event",ur=new Set;let ml=!1,Pa=null;const If=e=>typeof e=="object"&&e!==null,V8=e=>!If(e)||e.source!=="mcp"||typeof e.noteId!="string"||typeof e.type!="string"?!1:e.type==="mcp.note.deleted"||(e.type==="mcp.note.created"||e.type==="mcp.note.updated")&&typeof e.updatedAt=="string",Z8=e=>!(!If(e)||e.source!=="web"||e.type!=="web.note.updated"||typeof e.noteId!="string"||typeof e.updatedAt!="string"||e.editSessionId!==void 0&&typeof e.editSessionId!="string"||e.eventId!==void 0&&typeof e.eventId!="string"),U8=e=>V8(e)||Z8(e),Df=e=>U8(e)?e:null,Lf=e=>{try{const t=JSON.parse(e);return Df(t)}catch{return null}},q8=e=>e.source!=="web"||!e.eventId?!1:ur.has(e.eventId)?!0:(ur.add(e.eventId),ur.size>200&&(ur.clear(),ur.add(e.eventId)),!1),Mi=e=>{q8(e)||Ta.forEach(t=>{t(e)})},z8=e=>{const t=Df(e);!t||t.source!=="web"||Mi(t)},jf=()=>{ml||typeof window>"u"||(ml=!0,typeof BroadcastChannel<"u"&&(Pa=new BroadcastChannel(B8),Pa.onmessage=e=>{z8(e.data)}),window.addEventListener("storage",e=>{if(e.key!==Of||!e.newValue)return;const t=Lf(e.newValue);t?.source==="web"&&Mi(t)}))},l5=({noteId:e,updatedAt:t,editSessionId:n})=>{if(typeof window>"u")return;jf();const r={type:"web.note.updated",source:"web",noteId:e,updatedAt:t,...n?{editSessionId:n}:{},eventId:`${Date.now()}:${Math.random().toString(36).slice(2)}`};Pa?.postMessage(r);try{window.localStorage.setItem(Of,JSON.stringify(r))}catch{}},K8=e=>(jf(),Ta.add(e),()=>{Ta.delete(e)}),W8=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Lf(t.data);!n||n.type!==e||Mi(n)},G8=()=>{const e=Gn();return c.useEffect(()=>K8(t=>{k8(e,t)}),[e]),c.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events"),n=()=>{N8()},r=H8.map(o=>{const s=W8(o);return t.addEventListener(o,s),()=>{t.removeEventListener(o,s)}});return t.addEventListener("error",n),()=>{r.forEach(o=>{o()}),t.removeEventListener("error",n),t.close()}},[]),null},Y8=({children:e})=>h.jsx(Ng,{client:$y,children:h.jsx(ay,{children:h.jsxs(Fy,{children:[h.jsx(G8,{}),e]})})}),Q8={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},gl={sm:10,md:12,lg:14},kf=c.forwardRef(({className:e,size:t="md",checked:n,disabled:r,...o},s)=>h.jsxs("label",{className:ae("relative inline-flex items-center justify-center cursor-pointer",r&&"cursor-not-allowed opacity-50",e),children:[h.jsx("input",{ref:s,type:"checkbox",checked:n,disabled:r,className:"sr-only peer",...o}),h.jsx("span",{className:ae(Q8[t],"flex items-center justify-center","border border-border-secondary","rounded-[6px]","bg-surface","transition-all duration-200","peer-checked:bg-cta","peer-checked:border-cta","focus-ring-soft"),children:n&&h.jsx(Bv,{width:gl[t],height:gl[t],className:"text-fg-on-filled",weight:"bold"})})]}));kf.displayName="Checkbox";var X8=ld,J8=ud,Ff=dd,$f=fd,eb=vi,Hf=hd,Bf=pd;const tb=X8,nb=J8,rb=eb,Vf=c.createContext("default"),Vr=()=>c.useContext(Vf),Zf=c.forwardRef(({className:e,...t},n)=>h.jsx(Ff,{ref:n,className:ae("fixed","inset-0","z-[1090]","bg-overlay","backdrop-blur-[2px]","data-[state=open]:animate-in","data-[state=closed]:animate-out","data-[state=closed]:fade-out-0","data-[state=open]:fade-in-0",e),...t}));Zf.displayName=Ff.displayName;const Uf=c.forwardRef(({className:e,children:t,variant:n="default",...r},o)=>h.jsxs(nb,{children:[h.jsx(Zf,{}),h.jsx("div",{className:"pointer-events-none fixed inset-0 z-[1100] flex items-center justify-center p-4",children:h.jsx($f,{ref:o,"data-dialog-variant":n,className:yi({variant:n,className:e}),...r,children:h.jsx(Vf.Provider,{value:n,children:t})})})]}));Uf.displayName=$f.displayName;const qf=({title:e,onClose:t,className:n})=>{const r=Vr();return h.jsxs("div",{className:ty({variant:r,className:n}),children:[h.jsx(Wf,{children:e}),t&&h.jsx(rb,{asChild:!0,children:h.jsx("button",{type:"button",className:ny({variant:r}),onClick:t,children:h.jsx(rf,{className:r==="compact"||r==="form"||r==="confirm"?"h-[18px] w-[18px]":"h-5 w-5"})})})]})};qf.displayName="DialogHeader";const zf=c.forwardRef(({className:e,...t},n)=>{const r=Vr();return h.jsx("div",{ref:n,className:bi({variant:r,className:e}),...t})});zf.displayName="DialogBody";const Kf=c.forwardRef(({className:e,...t},n)=>{const r=Vr();return h.jsx("div",{ref:n,className:xi({variant:r,className:e}),...t})});Kf.displayName="DialogFooter";const Wf=c.forwardRef(({className:e,...t},n)=>{const r=Vr();return h.jsx(Hf,{ref:n,className:ae(wi({variant:r}),e),...t})});Wf.displayName=Hf.displayName;const Gf=c.forwardRef(({className:e,...t},n)=>{const r=Vr();return h.jsx(Bf,{ref:n,className:ae(Ei({variant:r}),e),...t})});Gf.displayName=Bf.displayName;const Ft=({isOpen:e,onClose:t,children:n,className:r,variant:o="default"})=>h.jsx(tb,{open:e,onOpenChange:s=>!s&&t(),children:h.jsx(Uf,{variant:o,className:r,children:n})});Ft.Header=qf;Ft.Body=zf;Ft.Footer=Kf;Ft.Description=Gf;function _i(e){const t=e+"CollectionProvider",[n,r]=Nt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:y,children:b}=g,x=M.useRef(null),w=M.useRef(new Map).current;return h.jsx(o,{scope:y,itemMap:w,collectionRef:x,children:b})};a.displayName=t;const i=e+"CollectionSlot",l=qn(i),u=M.forwardRef((g,y)=>{const{scope:b,children:x}=g,w=s(i,b),E=le(y,w.collectionRef);return h.jsx(l,{ref:E,children:x})});u.displayName=i;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=qn(f),m=M.forwardRef((g,y)=>{const{scope:b,children:x,...w}=g,E=M.useRef(null),T=le(y,E),O=s(f,b);return M.useEffect(()=>(O.itemMap.set(E,{ref:E,...w}),()=>{O.itemMap.delete(E)})),h.jsx(p,{[d]:"",ref:T,children:x})});m.displayName=f;function v(g){const y=s(e+"CollectionConsumer",g);return M.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((O,C)=>w.indexOf(O.ref.current)-w.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},v,r]}var ob=c.createContext(void 0);function us(e){const t=c.useContext(ob);return e||t||"ltr"}var sb="Arrow",Yf=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return h.jsx(re.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yf.displayName=sb;var ab=Yf;function ib(e){const[t,n]=c.useState(void 0);return Ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,i=u.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ni="Popper",[Qf,Qn]=Nt(Ni),[cb,Xf]=Qf(Ni),Jf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return h.jsx(cb,{scope:t,anchor:r,onAnchorChange:o,children:n})};Jf.displayName=Ni;var e0="PopperAnchor",t0=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Xf(e0,n),a=c.useRef(null),i=le(t,a),l=c.useRef(null);return c.useEffect(()=>{const u=l.current;l.current=r?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:h.jsx(re.div,{...o,ref:i})});t0.displayName=e0;var Oi="PopperContent",[lb,ub]=Qf(Oi),n0=c.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:v,...g}=e,y=Xf(Oi,n),[b,x]=c.useState(null),w=le(t,$=>x($)),[E,T]=c.useState(null),O=ib(E),C=O?.width??0,S=O?.height??0,N=r+(s!=="center"?"-"+s:""),I=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},P=Array.isArray(u)?u:[u],H=P.length>0,z={padding:I,boundary:P.filter(fb),altBoundary:H},{refs:L,floatingStyles:k,placement:A,isPositioned:D,middlewareData:j}=Yp({strategy:"fixed",placement:N,whileElementsMounted:(...$)=>r1(...$,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Qp({mainAxis:o+S,alignmentAxis:a}),l&&Xp({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?o1():void 0,...z}),l&&Jp({...z}),e1({...z,apply:({elements:$,rects:F,availableWidth:ee,availableHeight:Z})=>{const{width:X,height:te}=F.reference,ie=$.floating.style;ie.setProperty("--radix-popper-available-width",`${ee}px`),ie.setProperty("--radix-popper-available-height",`${Z}px`),ie.setProperty("--radix-popper-anchor-width",`${X}px`),ie.setProperty("--radix-popper-anchor-height",`${te}px`)}}),E&&t1({element:E,padding:i}),hb({arrowWidth:C,arrowHeight:S}),p&&n1({strategy:"referenceHidden",...z})]}),[_,V]=s0(A),K=Mt(v);Ve(()=>{D&&K?.()},[D,K]);const Y=j.arrow?.x,B=j.arrow?.y,q=j.arrow?.centerOffset!==0,[U,J]=c.useState();return Ve(()=>{b&&J(window.getComputedStyle(b).zIndex)},[b]),h.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:D?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(lb,{scope:n,placedSide:_,onArrowChange:T,arrowX:Y,arrowY:B,shouldHideArrow:q,children:h.jsx(re.div,{"data-side":_,"data-align":V,...g,ref:w,style:{...g.style,animation:D?void 0:"none"}})})})});n0.displayName=Oi;var r0="PopperArrow",db={top:"bottom",right:"left",bottom:"top",left:"right"},o0=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ub(r0,r),a=db[s.placedSide];return h.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:h.jsx(ab,{...o,ref:n,style:{...o.style,display:"block"}})})});o0.displayName=r0;function fb(e){return e!==null}var hb=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,f]=s0(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(o.arrow?.x??0)+i/2,m=(o.arrow?.y??0)+l/2;let v="",g="";return u==="bottom"?(v=a?d:`${p}px`,g=`${-l}px`):u==="top"?(v=a?d:`${p}px`,g=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,g=a?d:`${m}px`):u==="left"&&(v=`${r.floating.width+l}px`,g=a?d:`${m}px`),{data:{x:v,y:g}}}});function s0(e){const[t,n="center"]=e.split("-");return[t,n]}var Ii=Jf,Di=t0,Li=n0,ji=o0,Xs="rovingFocusGroup.onEntryFocus",pb={bubbles:!1,cancelable:!0},Zr="RovingFocusGroup",[Ma,a0,mb]=_i(Zr),[gb,ds]=Nt(Zr,[mb]),[vb,yb]=gb(Zr),i0=c.forwardRef((e,t)=>h.jsx(Ma.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Ma.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(bb,{...e,ref:t})})}));i0.displayName=Zr;var bb=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,p=c.useRef(null),m=le(t,p),v=us(s),[g,y]=Bt({prop:a,defaultProp:i??null,onChange:l,caller:Zr}),[b,x]=c.useState(!1),w=Mt(u),E=a0(n),T=c.useRef(!1),[O,C]=c.useState(0);return c.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(Xs,w),()=>S.removeEventListener(Xs,w)},[w]),h.jsx(vb,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:g,onItemFocus:c.useCallback(S=>y(S),[y]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>C(S=>S+1),[]),onFocusableItemRemove:c.useCallback(()=>C(S=>S-1),[]),children:h.jsx(re.div,{tabIndex:b||O===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:W(e.onMouseDown,()=>{T.current=!0}),onFocus:W(e.onFocus,S=>{const N=!T.current;if(S.target===S.currentTarget&&N&&!b){const I=new CustomEvent(Xs,pb);if(S.currentTarget.dispatchEvent(I),!I.defaultPrevented){const P=E().filter(A=>A.focusable),H=P.find(A=>A.active),z=P.find(A=>A.id===g),k=[H,z,...P].filter(Boolean).map(A=>A.ref.current);u0(k,f)}}T.current=!1}),onBlur:W(e.onBlur,()=>x(!1))})})}),c0="RovingFocusGroupItem",l0=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,l=Tt(),u=s||l,f=yb(c0,n),d=f.currentTabStopId===u,p=a0(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:g}=f;return c.useEffect(()=>{if(r)return m(),()=>v()},[r,m,v]),h.jsx(Ma.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:h.jsx(re.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:W(e.onMouseDown,y=>{r?f.onItemFocus(u):y.preventDefault()}),onFocus:W(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:W(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=Eb(y,f.orientation,f.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=p().filter(E=>E.focusable).map(E=>E.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const E=w.indexOf(y.currentTarget);w=f.loop?Sb(w,E+1):w.slice(E+1)}setTimeout(()=>u0(w))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:g!=null}):a})})});l0.displayName=c0;var xb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Eb(e,t,n){const r=wb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xb[r]}function u0(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Sb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var d0=i0,f0=l0,_a=["Enter"," "],Rb=["ArrowDown","PageUp","Home"],h0=["ArrowUp","PageDown","End"],Cb=[...Rb,...h0],Ab={ltr:[..._a,"ArrowRight"],rtl:[..._a,"ArrowLeft"]},Tb={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ur="Menu",[Cr,Pb,Mb]=_i(Ur),[Sn,p0]=Nt(Ur,[Mb,Qn,ds]),fs=Qn(),m0=ds(),[_b,Rn]=Sn(Ur),[Nb,qr]=Sn(Ur),g0=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,i=fs(t),[l,u]=c.useState(null),f=c.useRef(!1),d=Mt(s),p=us(o);return c.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),h.jsx(Ii,{...i,children:h.jsx(_b,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:h.jsx(Nb,{scope:t,onClose:c.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:p,modal:a,children:r})})})};g0.displayName=Ur;var Ob="MenuAnchor",ki=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=fs(n);return h.jsx(Di,{...o,...r,ref:t})});ki.displayName=Ob;var Fi="MenuPortal",[Ib,v0]=Sn(Fi,{forceMount:void 0}),y0=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Rn(Fi,t);return h.jsx(Ib,{scope:t,forceMount:n,children:h.jsx(Ot,{present:n||s.open,children:h.jsx(jr,{asChild:!0,container:o,children:r})})})};y0.displayName=Fi;var mt="MenuContent",[Db,$i]=Sn(mt),b0=c.forwardRef((e,t)=>{const n=v0(mt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Rn(mt,e.__scopeMenu),a=qr(mt,e.__scopeMenu);return h.jsx(Cr.Provider,{scope:e.__scopeMenu,children:h.jsx(Ot,{present:r||s.open,children:h.jsx(Cr.Slot,{scope:e.__scopeMenu,children:a.modal?h.jsx(Lb,{...o,ref:t}):h.jsx(jb,{...o,ref:t})})})})}),Lb=c.forwardRef((e,t)=>{const n=Rn(mt,e.__scopeMenu),r=c.useRef(null),o=le(t,r);return c.useEffect(()=>{const s=r.current;if(s)return hi(s)},[]),h.jsx(Hi,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),jb=c.forwardRef((e,t)=>{const n=Rn(mt,e.__scopeMenu);return h.jsx(Hi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),kb=qn("MenuContent.ScrollLock"),Hi=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:v,...g}=e,y=Rn(mt,n),b=qr(mt,n),x=fs(n),w=m0(n),E=Pb(n),[T,O]=c.useState(null),C=c.useRef(null),S=le(t,C,y.onContentChange),N=c.useRef(0),I=c.useRef(""),P=c.useRef(0),H=c.useRef(null),z=c.useRef("right"),L=c.useRef(0),k=v?Ya:c.Fragment,A=v?{as:kb,allowPinchZoom:!0}:void 0,D=_=>{const V=I.current+_,K=E().filter($=>!$.disabled),Y=document.activeElement,B=K.find($=>$.ref.current===Y)?.textValue,q=K.map($=>$.textValue),U=Gb(q,V,B),J=K.find($=>$.textValue===U)?.ref.current;(function $(F){I.current=F,window.clearTimeout(N.current),F!==""&&(N.current=window.setTimeout(()=>$(""),1e3))})(V),J&&setTimeout(()=>J.focus())};c.useEffect(()=>()=>window.clearTimeout(N.current),[]),fi();const j=c.useCallback(_=>z.current===H.current?.side&&Qb(_,H.current?.area),[]);return h.jsx(Db,{scope:n,searchRef:I,onItemEnter:c.useCallback(_=>{j(_)&&_.preventDefault()},[j]),onItemLeave:c.useCallback(_=>{j(_)||(C.current?.focus(),O(null))},[j]),onTriggerLeave:c.useCallback(_=>{j(_)&&_.preventDefault()},[j]),pointerGraceTimerRef:P,onPointerGraceIntentChange:c.useCallback(_=>{H.current=_},[]),children:h.jsx(k,{...A,children:h.jsx(ns,{asChild:!0,trapped:o,onMountAutoFocus:W(s,_=>{_.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:h.jsx(d0,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:O,onEntryFocus:W(l,_=>{b.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Li,{role:"menu","aria-orientation":"vertical","data-state":L0(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...g,ref:S,style:{outline:"none",...g.style},onKeyDown:W(g.onKeyDown,_=>{const K=_.target.closest("[data-radix-menu-content]")===_.currentTarget,Y=_.ctrlKey||_.altKey||_.metaKey,B=_.key.length===1;K&&(_.key==="Tab"&&_.preventDefault(),!Y&&B&&D(_.key));const q=C.current;if(_.target!==q||!Cb.includes(_.key))return;_.preventDefault();const J=E().filter($=>!$.disabled).map($=>$.ref.current);h0.includes(_.key)&&J.reverse(),Kb(J)}),onBlur:W(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(N.current),I.current="")}),onPointerMove:W(e.onPointerMove,Ar(_=>{const V=_.target,K=L.current!==_.clientX;if(_.currentTarget.contains(V)&&K){const Y=_.clientX>L.current?"right":"left";z.current=Y,L.current=_.clientX}}))})})})})})})});b0.displayName=mt;var Fb="MenuGroup",Bi=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(re.div,{role:"group",...r,ref:t})});Bi.displayName=Fb;var $b="MenuLabel",x0=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(re.div,{...r,ref:t})});x0.displayName=$b;var Lo="MenuItem",vl="menu.itemSelect",hs=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=c.useRef(null),a=qr(Lo,e.__scopeMenu),i=$i(Lo,e.__scopeMenu),l=le(t,s),u=c.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const p=new CustomEvent(vl,{bubbles:!0,cancelable:!0});d.addEventListener(vl,m=>r?.(m),{once:!0}),Bu(d,p),p.defaultPrevented?u.current=!1:a.onClose()}};return h.jsx(w0,{...o,ref:l,disabled:n,onClick:W(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),u.current=!0},onPointerUp:W(e.onPointerUp,d=>{u.current||d.currentTarget?.click()}),onKeyDown:W(e.onKeyDown,d=>{const p=i.searchRef.current!=="";n||p&&d.key===" "||_a.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});hs.displayName=Lo;var w0=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=$i(Lo,n),i=m0(n),l=c.useRef(null),u=le(t,l),[f,d]=c.useState(!1),[p,m]=c.useState("");return c.useEffect(()=>{const v=l.current;v&&m((v.textContent??"").trim())},[s.children]),h.jsx(Cr.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:h.jsx(f0,{asChild:!0,...i,focusable:!r,children:h.jsx(re.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:W(e.onPointerMove,Ar(v=>{r?a.onItemLeave(v):(a.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(e.onPointerLeave,Ar(v=>a.onItemLeave(v))),onFocus:W(e.onFocus,()=>d(!0)),onBlur:W(e.onBlur,()=>d(!1))})})})}),Hb="MenuCheckboxItem",E0=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return h.jsx(T0,{scope:e.__scopeMenu,checked:n,children:h.jsx(hs,{role:"menuitemcheckbox","aria-checked":jo(n)?"mixed":n,...o,ref:t,"data-state":Zi(n),onSelect:W(o.onSelect,()=>r?.(jo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});E0.displayName=Hb;var S0="MenuRadioGroup",[Bb,Vb]=Sn(S0,{value:void 0,onValueChange:()=>{}}),R0=c.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Mt(r);return h.jsx(Bb,{scope:e.__scopeMenu,value:n,onValueChange:s,children:h.jsx(Bi,{...o,ref:t})})});R0.displayName=S0;var C0="MenuRadioItem",A0=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=Vb(C0,e.__scopeMenu),s=n===o.value;return h.jsx(T0,{scope:e.__scopeMenu,checked:s,children:h.jsx(hs,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Zi(s),onSelect:W(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});A0.displayName=C0;var Vi="MenuItemIndicator",[T0,Zb]=Sn(Vi,{checked:!1}),P0=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Zb(Vi,n);return h.jsx(Ot,{present:r||jo(s.checked)||s.checked===!0,children:h.jsx(re.span,{...o,ref:t,"data-state":Zi(s.checked)})})});P0.displayName=Vi;var Ub="MenuSeparator",M0=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(re.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});M0.displayName=Ub;var qb="MenuArrow",_0=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=fs(n);return h.jsx(ji,{...o,...r,ref:t})});_0.displayName=qb;var zb="MenuSub",[u5,N0]=Sn(zb),hr="MenuSubTrigger",O0=c.forwardRef((e,t)=>{const n=Rn(hr,e.__scopeMenu),r=qr(hr,e.__scopeMenu),o=N0(hr,e.__scopeMenu),s=$i(hr,e.__scopeMenu),a=c.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=c.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return c.useEffect(()=>f,[f]),c.useEffect(()=>{const d=i.current;return()=>{window.clearTimeout(d),l(null)}},[i,l]),h.jsx(ki,{asChild:!0,...u,children:h.jsx(w0,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":L0(n.open),...e,ref:Dr(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:W(e.onPointerMove,Ar(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:W(e.onPointerLeave,Ar(d=>{f();const p=n.content?.getBoundingClientRect();if(p){const m=n.content?.dataset.side,v=m==="right",g=v?-5:5,y=p[v?"left":"right"],b=p[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+g,y:d.clientY},{x:y,y:p.top},{x:b,y:p.top},{x:b,y:p.bottom},{x:y,y:p.bottom}],side:m}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:W(e.onKeyDown,d=>{const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||Ab[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});O0.displayName=hr;var I0="MenuSubContent",D0=c.forwardRef((e,t)=>{const n=v0(mt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Rn(mt,e.__scopeMenu),a=qr(mt,e.__scopeMenu),i=N0(I0,e.__scopeMenu),l=c.useRef(null),u=le(t,l);return h.jsx(Cr.Provider,{scope:e.__scopeMenu,children:h.jsx(Ot,{present:r||s.open,children:h.jsx(Cr.Slot,{scope:e.__scopeMenu,children:h.jsx(Hi,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:W(e.onFocusOutside,f=>{f.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:W(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:W(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),p=Tb[a.dir].includes(f.key);d&&p&&(s.onOpenChange(!1),i.trigger?.focus(),f.preventDefault())})})})})})});D0.displayName=I0;function L0(e){return e?"open":"closed"}function jo(e){return e==="indeterminate"}function Zi(e){return jo(e)?"indeterminate":e?"checked":"unchecked"}function Kb(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Wb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Gb(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Wb(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Yb(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],l=t[a],u=i.x,f=i.y,d=l.x,p=l.y;f>r!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(o=!o)}return o}function Qb(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Yb(n,t)}function Ar(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Xb=g0,Jb=ki,e4=y0,t4=b0,n4=Bi,r4=x0,o4=hs,s4=E0,a4=R0,i4=A0,c4=P0,l4=M0,u4=_0,d4=O0,f4=D0,ps="DropdownMenu",[h4]=Nt(ps,[p0]),Ye=p0(),[p4,j0]=h4(ps),k0=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,l=Ye(t),u=c.useRef(null),[f,d]=Bt({prop:o,defaultProp:s??!1,onChange:a,caller:ps});return h.jsx(p4,{scope:t,triggerId:Tt(),triggerRef:u,contentId:Tt(),open:f,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(p=>!p),[d]),modal:i,children:h.jsx(Xb,{...l,open:f,onOpenChange:d,dir:r,modal:i,children:n})})};k0.displayName=ps;var F0="DropdownMenuTrigger",$0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=j0(F0,n),a=Ye(n);return h.jsx(Jb,{asChild:!0,...a,children:h.jsx(re.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Dr(t,s.triggerRef),onPointerDown:W(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:W(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});$0.displayName=F0;var m4="DropdownMenuPortal",H0=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ye(t);return h.jsx(e4,{...r,...n})};H0.displayName=m4;var B0="DropdownMenuContent",V0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j0(B0,n),s=Ye(n),a=c.useRef(!1);return h.jsx(t4,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:W(e.onCloseAutoFocus,i=>{a.current||o.triggerRef.current?.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:W(e.onInteractOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!o.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});V0.displayName=B0;var g4="DropdownMenuGroup",v4=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(n4,{...o,...r,ref:t})});v4.displayName=g4;var y4="DropdownMenuLabel",Z0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(r4,{...o,...r,ref:t})});Z0.displayName=y4;var b4="DropdownMenuItem",U0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(o4,{...o,...r,ref:t})});U0.displayName=b4;var x4="DropdownMenuCheckboxItem",q0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(s4,{...o,...r,ref:t})});q0.displayName=x4;var w4="DropdownMenuRadioGroup",E4=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(a4,{...o,...r,ref:t})});E4.displayName=w4;var S4="DropdownMenuRadioItem",z0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(i4,{...o,...r,ref:t})});z0.displayName=S4;var R4="DropdownMenuItemIndicator",K0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(c4,{...o,...r,ref:t})});K0.displayName=R4;var C4="DropdownMenuSeparator",W0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(l4,{...o,...r,ref:t})});W0.displayName=C4;var A4="DropdownMenuArrow",T4=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(u4,{...o,...r,ref:t})});T4.displayName=A4;var P4="DropdownMenuSubTrigger",G0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(d4,{...o,...r,ref:t})});G0.displayName=P4;var M4="DropdownMenuSubContent",Y0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(f4,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Y0.displayName=M4;var _4=k0,N4=$0,O4=H0,I4=V0,D4=Z0,L4=U0,j4=q0,k4=z0,F4=K0,$4=W0,H4=G0,B4=Y0,V4=_4,Z4=N4,U4=O4,Q0=I4,X0=L4,J0=j4,eh=k4,th=F4,nh=D4,rh=$4,oh=H4,sh=B4;const q4=V4,z4=Z4,K4=c.forwardRef(({className:e,inset:t,children:n,...r},o)=>h.jsx(oh,{ref:o,className:ae("flex","cursor-default","select-none","items-center","rounded-[10px]","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","focus:bg-hover-subtle","focus:text-fg-default","data-[state=open]:bg-hover-subtle","data-[state=open]:text-fg-default",t&&"pl-8",e),...r,children:n}));K4.displayName=oh.displayName;const W4=c.forwardRef(({className:e,...t},n)=>h.jsx(sh,{ref:n,className:ae("z-50","min-w-[8rem]","overflow-hidden","surface-floating","p-1",e),...t}));W4.displayName=sh.displayName;const ah=c.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(U4,{children:h.jsx(Q0,{ref:r,sideOffset:t,className:ae("z-[1100]","min-w-[10rem]","overflow-hidden","surface-floating","p-1","data-[state=open]:animate-fade-in","data-[state=open]:animate-zoom-in",e),...n})}));ah.displayName=Q0.displayName;const ih=c.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(X0,{ref:r,className:ae("relative","flex","cursor-pointer","select-none","items-center","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","rounded-[10px]","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ih.displayName=X0.displayName;const G4=c.forwardRef(({className:e,children:t,checked:n,...r},o)=>h.jsxs(J0,{ref:o,className:ae("relative","flex","cursor-pointer","select-none","items-center","rounded-[10px]","py-2","pl-8","pr-3","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(th,{children:"✓"})}),t]}));G4.displayName=J0.displayName;const Y4=c.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(eh,{ref:r,className:ae("relative","flex","cursor-pointer","select-none","items-center","rounded-[10px]","py-2","pl-8","pr-3","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(th,{children:"●"})}),t]}));Y4.displayName=eh.displayName;const Q4=c.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(nh,{ref:r,className:ae("px-2","py-1.5","text-sm","font-semibold","text-fg-secondary",t&&"pl-8",e),...n}));Q4.displayName=nh.displayName;const ch=c.forwardRef(({className:e,...t},n)=>h.jsx(rh,{ref:n,className:ae("-mx-1","my-1","h-px","bg-divider",e),...t}));ch.displayName=rh.displayName;const X4=({button:e,items:t})=>h.jsxs(q4,{children:[h.jsx(z4,{asChild:!0,children:e}),h.jsx(ah,{align:"end",children:t.map((n,r)=>n.type==="separator"?h.jsx(ch,{},n.key??`separator-${r}`):h.jsx(ih,{onClick:n.onClick,children:n.name},n.name))})]}),lh=c.forwardRef(({title:e,description:t,className:n="",...r},o)=>h.jsxs("div",{ref:o,className:ae("flex flex-col items-center justify-center text-center","h-[400px]","bg-muted/30","border-2 border-dashed","border-border-secondary","rounded-[20px]","p-8",n),...r,children:[e&&h.jsx(se,{as:"h3",variant:"heading",weight:"bold",tone:"muted",className:"mb-2",children:e}),t&&h.jsx(se,{as:"p",variant:"meta",weight:"medium",tone:"tertiary",className:"max-w-[400px]",children:t})]}));lh.displayName="Empty";const J4=je(["w-full","border","border-border-subtle","bg-elevated","text-fg-default","placeholder:text-fg-placeholder","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50"],{variants:{variant:{default:[],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"],error:["border-border-error","bg-accent-soft-danger/40","text-fg-default"]},size:{sm:"h-8 px-3 text-sm rounded-[12px]",md:"h-9 px-3 text-sm rounded-[14px]",lg:"h-11 px-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),ex=c.forwardRef(({className:e,variant:t,size:n,type:r="text",...o},s)=>h.jsx("input",{ref:s,type:r,className:J4({variant:t,size:n,className:e}),...o}));ex.displayName="Input";const tx=je(["font-bold","text-fg-muted","whitespace-nowrap"],{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"sm"}}),uh=c.forwardRef(({className:e,size:t,...n},r)=>h.jsx("label",{ref:r,className:tx({size:t,className:e}),...n}));uh.displayName="Label";const nx=je(["focus-ring-soft","inline-flex","shrink-0","items-center","justify-center","bg-transparent","text-fg-default/70","outline-none","transition-colors","hover:bg-hover-subtle","hover:text-fg-default"],{variants:{size:{sm:"h-7 w-7 rounded-[8px]",md:"h-8 w-8 rounded-[10px]",lg:"h-9 w-9 rounded-[12px]"}},defaultVariants:{size:"md"}}),rx={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"};function ox({label:e,size:t="md",iconClassName:n,className:r,type:o="button",...s}){return h.jsx("button",{type:o,"aria-label":e,className:nx({size:t,className:r}),...s,children:h.jsx(Zv,{className:n??rx[t]})})}const dh=c.forwardRef(({page:e,last:t,onChange:n,className:r="",...o},s)=>{const a=Number(e),i=Number(t),l=[];for(let d=1;d<i+1;d++)(a===d||a===1&&d<a+5||a===2&&d<a+4||d>a-3&&d<a+3||a===i-1&&d>a-4||a===i&&d>a-5)&&l.push(d);const u=a===1,f=a===i;return h.jsxs("nav",{ref:s,className:`mt-8 flex justify-center items-center gap-1 ${r}`,...o,children:[h.jsxs(kn,{disabled:u,onClick:()=>!u&&n(1),"aria-label":"First page",isSkip:!0,children:[h.jsx(zs,{width:16}),h.jsx(zs,{width:16})]}),h.jsx(kn,{disabled:u,onClick:()=>!u&&n(a-1),"aria-label":"Previous page",children:h.jsx(zs,{width:20})}),l.map(d=>h.jsx(kn,{active:a===d,onClick:()=>n(d),"aria-label":`Page ${d}`,"aria-current":a===d?"page":void 0,children:d},d)),h.jsx(kn,{disabled:f,onClick:()=>!f&&n(a+1),"aria-label":"Next page",children:h.jsx(vr,{width:20})}),h.jsxs(kn,{disabled:f,onClick:()=>!f&&n(i),"aria-label":"Last page",isSkip:!0,children:[h.jsx(vr,{width:16}),h.jsx(vr,{width:16})]})]})});dh.displayName="Pagination";const kn=c.forwardRef(({active:e,disabled:t,isSkip:n,children:r,className:o="",...s},a)=>{const i=`
20
+ `+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=yn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&vo.assertOptions(r,{silentJSONParsing:dt.transitional(dt.boolean),forcedJSONParsing:dt.transitional(dt.boolean),clarifyTimeoutError:dt.transitional(dt.boolean),legacyInterceptorReqResOrdering:dt.transitional(dt.boolean)},!1),o!=null&&(R.isFunction(o)?n.paramsSerializer={serialize:o}:vo.assertOptions(o,{encode:dt.function,serialize:dt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),vo.assertOptions(n,{baseUrl:dt.spelling("baseURL"),withXsrfToken:dt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&R.merge(s.common,s[n.method]);s&&R.forEach(["delete","get","head","post","put","patch","query","common"],v=>{delete s[v]}),n.headers=We.concat(a,s);const i=[];let l=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(n)===!1)return;l=l&&g.synchronous;const y=n.transitional||Ri;y&&y.legacyInterceptorReqResOrdering?i.unshift(g.fulfilled,g.rejected):i.push(g.fulfilled,g.rejected)});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let f,d=0,p;if(!l){const v=[dl.bind(this),void 0];for(v.unshift(...i),v.push(...u),p=v.length,f=Promise.resolve(n);d<p;)f=f.then(v[d++],v[d++]);return f}p=i.length;let m=n;for(;d<p;){const v=i[d++],g=i[d++];try{m=v(m)}catch(y){g.call(this,y);break}}try{f=dl.call(this,m)}catch(v){return Promise.reject(v)}for(d=0,p=u.length;d<p;)f=f.then(u[d++],u[d++]);return f}getUri(t){t=yn(this.defaults,t);const n=Rf(t.baseURL,t.url,t.allowAbsoluteUrls);return xf(n,t.params,t.paramsSerializer)}};R.forEach(["delete","get","head","options"],function(t){dn.prototype[t]=function(n,r){return this.request(yn(r||{},{method:t,url:n,data:(r||{}).data}))}});R.forEach(["post","put","patch","query"],function(t){function n(r){return function(s,a,i){return this.request(yn(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}dn.prototype[t]=n(),t!=="query"&&(dn.prototype[t+"Form"]=n(!0))});let R8=class Pf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(i=>{r.subscribe(i),s=i}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s,a,i){r.reason||(r.reason=new Br(s,a,i),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Pf(function(o){t=o}),cancel:t}}};function C8(e){return function(n){return e.apply(null,n)}}function A8(e){return R.isObject(e)&&e.isAxiosError===!0}const Ca={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ca).forEach(([e,t])=>{Ca[t]=e});function Mf(e){const t=new dn(e),n=lf(dn.prototype.request,t);return R.extend(n,dn.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Mf(yn(e,o))},n}const ye=Mf(Hr);ye.Axios=dn;ye.CanceledError=Br;ye.CancelToken=R8;ye.isCancel=Ef;ye.VERSION=Ai;ye.toFormData=cs;ye.AxiosError=G;ye.Cancel=ye.CanceledError;ye.all=function(t){return Promise.all(t)};ye.spread=C8;ye.isAxiosError=A8;ye.mergeConfig=yn;ye.AxiosHeaders=We;ye.formToJSON=e=>wf(R.isHTMLForm(e)?new FormData(e):e);ye.getAdapter=Tf.getAdapter;ye.HttpStatusCode=Ca;ye.default=ye;const{Axios:KC,AxiosError:WC,CanceledError:GC,isCancel:YC,CancelToken:QC,VERSION:XC,all:JC,Cancel:e5,isAxiosError:t5,spread:n5,toFormData:r5,AxiosHeaders:o5,HttpStatusCode:s5,formToJSON:a5,getAdapter:i5,mergeConfig:c5,create:l5}=ye,Pi="/login",T8="/api/auth/";let hl,pl=!1;const P8=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${Pi}?next=${encodeURIComponent(t)}`},M8=e=>{if(!ye.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(T8)&&t!==Pi},_8=e=>!!(e.authRequired&&!e.authenticated),_f=(e=window.location)=>{pl||e.pathname===Pi||(pl=!0,e.assign(P8(e)))},N8=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return;const n=await t.json();_8(n)&&_f()},O8=()=>{hl===void 0&&(hl=ye.interceptors.response.use(e=>e,e=>(M8(e)&&_f(),Promise.reject(e))))},I8=e=>!e||e.length===0?null:[...new Set(e)].sort(),D8=e=>!e||e.length===0?[]:[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort(),L8=e=>!e||e.length===0?null:[...new Set(e)].sort(),ve={notes:{all:()=>["notes"],listAll:()=>["notes","list"],list:(e={})=>["notes","list",{limit:e.limit??25,offset:e.offset??0,query:e.query??"",sortBy:e.sortBy??null,sortOrder:e.sortOrder??null,pinnedFirst:e.pinnedFirst??null,fields:I8(e.fields)}],tagListAll:()=>["notes","tag-list"],tagList:(e={})=>["notes","tag-list",{limit:e.limit??25,offset:e.offset??0,query:e.query??""}],tagNameListAll:()=>["notes","tag-name-list"],tagNameList:e=>["notes","tag-name-list",{limit:e.limit??25,offset:e.offset??0,mode:e.mode??"and",tagNames:D8(e.tagNames)}],detail:e=>["notes","detail",{id:e}],snapshots:(e,t=10)=>["notes","snapshots",{id:e,limit:t}],snapshotDetail:e=>["notes","snapshot-detail",{id:e}],trashAll:()=>["notes","trash"],trash:(e={})=>["notes","trash",{limit:e.limit??25,offset:e.offset??0}],trashDetail:e=>["notes","trash","detail",{id:e}],pinned:()=>["notes","pinned"],backReferencesAll:()=>["notes","back-references"],backReferences:e=>["notes","back-references",{noteId:e}],graph:()=>["notes","graph"],propertyKeysAll:()=>["notes","property-keys"],propertyKeys:(e={})=>["notes","property-keys",{query:e.query??"",limit:e.limit??50,offset:e.offset??0}]},tags:{all:()=>["tags"],list:(e={})=>["tags","list",{limit:e.limit??50,offset:e.offset??0,query:e.query??""}]},images:{all:()=>["images"],listAll:()=>["images","list"],list:(e={})=>["images","list",{limit:e.limit??50,offset:e.offset??0}],detail:e=>["images","detail",{id:e}],notes:e=>["images","notes",{id:e}]},reminders:{all:()=>["reminders"],note:(e,t={})=>["reminders","note",e,{limit:t.limit??10,offset:t.offset??0}],noteAllPages:e=>["reminders","note",e],upcoming:(e={})=>["reminders","upcoming",{limit:e.limit??10,offset:e.offset??0}],upcomingAllPages:()=>["reminders","upcoming"],inDateRangeAll:()=>["reminders","in-date-range"],inDateRange:(e,t)=>["reminders","in-date-range",{year:e,month:t}]},placeholders:{all:()=>["placeholders"],listAll:()=>["placeholders","list"],list:(e={})=>["placeholders","list",{limit:e.limit??25,offset:e.offset??0,query:e.query??"",fields:L8(e.fields)}]},calendar:{all:()=>["calendar"],notesInDateRange:(e,t)=>["calendar","notes-in-date-range",{year:e,month:t}]},views:{all:()=>["views"],workspace:()=>["views","workspace"],section:e=>["views","section",{id:e}],sectionNotesAll:()=>["views","section-notes"],sectionNotes:(e,t={})=>["views","section-notes",{id:e,limit:t.limit??25,offset:t.offset??0}]},ui:{heroBanner:()=>["ui","hero-banner"]}},Aa=[{queryKey:ve.notes.listAll(),exact:!1},{queryKey:ve.notes.tagListAll(),exact:!1},{queryKey:ve.notes.tagNameListAll(),exact:!1},{queryKey:ve.notes.pinned(),exact:!0},{queryKey:ve.notes.backReferencesAll(),exact:!1},{queryKey:ve.notes.graph(),exact:!0},{queryKey:ve.views.sectionNotesAll(),exact:!1},{queryKey:ve.tags.all(),exact:!1}],Nf={queryKey:ve.notes.propertyKeysAll(),exact:!1},j8=[...Aa,Nf,{queryKey:ve.notes.trashAll(),exact:!1},{queryKey:ve.reminders.all(),exact:!1},{queryKey:ve.images.all(),exact:!1},{queryKey:ve.calendar.all(),exact:!1}],Qs=async(e,t)=>{await Promise.all(t.map(n=>e.invalidateQueries(n)))},k8=async(e,t)=>{switch(t.type){case"mcp.note.created":case"web.note.updated":await Qs(e,Aa);return;case"mcp.note.updated":await Qs(e,[...Aa,Nf]);return;case"mcp.note.deleted":await Qs(e,j8);return}},F8=["mcp.note.created","mcp.note.updated","mcp.note.deleted"],$8=["web.note.updated"],H8=[...F8,...$8],Ta=new Set,B8="ocean-brain:web-note-events",Of="ocean-brain:web-note-event",ur=new Set;let ml=!1,Pa=null;const If=e=>typeof e=="object"&&e!==null,V8=e=>!If(e)||e.source!=="mcp"||typeof e.noteId!="string"||typeof e.type!="string"?!1:e.type==="mcp.note.deleted"||(e.type==="mcp.note.created"||e.type==="mcp.note.updated")&&typeof e.updatedAt=="string",Z8=e=>!(!If(e)||e.source!=="web"||e.type!=="web.note.updated"||typeof e.noteId!="string"||typeof e.updatedAt!="string"||e.editSessionId!==void 0&&typeof e.editSessionId!="string"||e.eventId!==void 0&&typeof e.eventId!="string"),U8=e=>V8(e)||Z8(e),Df=e=>U8(e)?e:null,Lf=e=>{try{const t=JSON.parse(e);return Df(t)}catch{return null}},q8=e=>e.source!=="web"||!e.eventId?!1:ur.has(e.eventId)?!0:(ur.add(e.eventId),ur.size>200&&(ur.clear(),ur.add(e.eventId)),!1),Mi=e=>{q8(e)||Ta.forEach(t=>{t(e)})},z8=e=>{const t=Df(e);!t||t.source!=="web"||Mi(t)},jf=()=>{ml||typeof window>"u"||(ml=!0,typeof BroadcastChannel<"u"&&(Pa=new BroadcastChannel(B8),Pa.onmessage=e=>{z8(e.data)}),window.addEventListener("storage",e=>{if(e.key!==Of||!e.newValue)return;const t=Lf(e.newValue);t?.source==="web"&&Mi(t)}))},u5=({noteId:e,updatedAt:t,editSessionId:n})=>{if(typeof window>"u")return;jf();const r={type:"web.note.updated",source:"web",noteId:e,updatedAt:t,...n?{editSessionId:n}:{},eventId:`${Date.now()}:${Math.random().toString(36).slice(2)}`};Pa?.postMessage(r);try{window.localStorage.setItem(Of,JSON.stringify(r))}catch{}},K8=e=>(jf(),Ta.add(e),()=>{Ta.delete(e)}),W8=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Lf(t.data);!n||n.type!==e||Mi(n)},G8=()=>{const e=Gn();return c.useEffect(()=>K8(t=>{k8(e,t)}),[e]),c.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events"),n=()=>{N8()},r=H8.map(o=>{const s=W8(o);return t.addEventListener(o,s),()=>{t.removeEventListener(o,s)}});return t.addEventListener("error",n),()=>{r.forEach(o=>{o()}),t.removeEventListener("error",n),t.close()}},[]),null},Y8=({children:e})=>h.jsx(Ng,{client:$y,children:h.jsx(ay,{children:h.jsxs(Fy,{children:[h.jsx(G8,{}),e]})})}),Q8={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},gl={sm:10,md:12,lg:14},kf=c.forwardRef(({className:e,size:t="md",checked:n,disabled:r,...o},s)=>h.jsxs("label",{className:ae("relative inline-flex items-center justify-center cursor-pointer",r&&"cursor-not-allowed opacity-50",e),children:[h.jsx("input",{ref:s,type:"checkbox",checked:n,disabled:r,className:"sr-only peer",...o}),h.jsx("span",{className:ae(Q8[t],"flex items-center justify-center","border border-border-secondary","rounded-[6px]","bg-surface","transition-all duration-200","peer-checked:bg-cta","peer-checked:border-cta","focus-ring-soft"),children:n&&h.jsx(Bv,{width:gl[t],height:gl[t],className:"text-fg-on-filled",weight:"bold"})})]}));kf.displayName="Checkbox";var X8=ld,J8=ud,Ff=dd,$f=fd,eb=vi,Hf=hd,Bf=pd;const tb=X8,nb=J8,rb=eb,Vf=c.createContext("default"),Vr=()=>c.useContext(Vf),Zf=c.forwardRef(({className:e,...t},n)=>h.jsx(Ff,{ref:n,className:ae("fixed","inset-0","z-[1090]","bg-overlay","backdrop-blur-[2px]","data-[state=open]:animate-in","data-[state=closed]:animate-out","data-[state=closed]:fade-out-0","data-[state=open]:fade-in-0",e),...t}));Zf.displayName=Ff.displayName;const Uf=c.forwardRef(({className:e,children:t,variant:n="default",...r},o)=>h.jsxs(nb,{children:[h.jsx(Zf,{}),h.jsx("div",{className:"pointer-events-none fixed inset-0 z-[1100] flex items-center justify-center p-4",children:h.jsx($f,{ref:o,"data-dialog-variant":n,className:yi({variant:n,className:e}),...r,children:h.jsx(Vf.Provider,{value:n,children:t})})})]}));Uf.displayName=$f.displayName;const qf=({title:e,onClose:t,className:n})=>{const r=Vr();return h.jsxs("div",{className:ty({variant:r,className:n}),children:[h.jsx(Wf,{children:e}),t&&h.jsx(rb,{asChild:!0,children:h.jsx("button",{type:"button",className:ny({variant:r}),onClick:t,children:h.jsx(rf,{className:r==="compact"||r==="form"||r==="confirm"?"h-[18px] w-[18px]":"h-5 w-5"})})})]})};qf.displayName="DialogHeader";const zf=c.forwardRef(({className:e,...t},n)=>{const r=Vr();return h.jsx("div",{ref:n,className:bi({variant:r,className:e}),...t})});zf.displayName="DialogBody";const Kf=c.forwardRef(({className:e,...t},n)=>{const r=Vr();return h.jsx("div",{ref:n,className:xi({variant:r,className:e}),...t})});Kf.displayName="DialogFooter";const Wf=c.forwardRef(({className:e,...t},n)=>{const r=Vr();return h.jsx(Hf,{ref:n,className:ae(wi({variant:r}),e),...t})});Wf.displayName=Hf.displayName;const Gf=c.forwardRef(({className:e,...t},n)=>{const r=Vr();return h.jsx(Bf,{ref:n,className:ae(Ei({variant:r}),e),...t})});Gf.displayName=Bf.displayName;const Ft=({isOpen:e,onClose:t,children:n,className:r,variant:o="default"})=>h.jsx(tb,{open:e,onOpenChange:s=>!s&&t(),children:h.jsx(Uf,{variant:o,className:r,children:n})});Ft.Header=qf;Ft.Body=zf;Ft.Footer=Kf;Ft.Description=Gf;function _i(e){const t=e+"CollectionProvider",[n,r]=Nt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:y,children:b}=g,x=M.useRef(null),w=M.useRef(new Map).current;return h.jsx(o,{scope:y,itemMap:w,collectionRef:x,children:b})};a.displayName=t;const i=e+"CollectionSlot",l=qn(i),u=M.forwardRef((g,y)=>{const{scope:b,children:x}=g,w=s(i,b),E=le(y,w.collectionRef);return h.jsx(l,{ref:E,children:x})});u.displayName=i;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=qn(f),m=M.forwardRef((g,y)=>{const{scope:b,children:x,...w}=g,E=M.useRef(null),T=le(y,E),O=s(f,b);return M.useEffect(()=>(O.itemMap.set(E,{ref:E,...w}),()=>{O.itemMap.delete(E)})),h.jsx(p,{[d]:"",ref:T,children:x})});m.displayName=f;function v(g){const y=s(e+"CollectionConsumer",g);return M.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((O,C)=>w.indexOf(O.ref.current)-w.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},v,r]}var ob=c.createContext(void 0);function us(e){const t=c.useContext(ob);return e||t||"ltr"}var sb="Arrow",Yf=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return h.jsx(re.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yf.displayName=sb;var ab=Yf;function ib(e){const[t,n]=c.useState(void 0);return Ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,i=u.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ni="Popper",[Qf,Qn]=Nt(Ni),[cb,Xf]=Qf(Ni),Jf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return h.jsx(cb,{scope:t,anchor:r,onAnchorChange:o,children:n})};Jf.displayName=Ni;var e0="PopperAnchor",t0=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Xf(e0,n),a=c.useRef(null),i=le(t,a),l=c.useRef(null);return c.useEffect(()=>{const u=l.current;l.current=r?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:h.jsx(re.div,{...o,ref:i})});t0.displayName=e0;var Oi="PopperContent",[lb,ub]=Qf(Oi),n0=c.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:v,...g}=e,y=Xf(Oi,n),[b,x]=c.useState(null),w=le(t,$=>x($)),[E,T]=c.useState(null),O=ib(E),C=O?.width??0,S=O?.height??0,N=r+(s!=="center"?"-"+s:""),I=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},P=Array.isArray(u)?u:[u],H=P.length>0,z={padding:I,boundary:P.filter(fb),altBoundary:H},{refs:L,floatingStyles:k,placement:A,isPositioned:D,middlewareData:j}=Yp({strategy:"fixed",placement:N,whileElementsMounted:(...$)=>r1(...$,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Qp({mainAxis:o+S,alignmentAxis:a}),l&&Xp({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?o1():void 0,...z}),l&&Jp({...z}),e1({...z,apply:({elements:$,rects:F,availableWidth:ee,availableHeight:Z})=>{const{width:X,height:te}=F.reference,ie=$.floating.style;ie.setProperty("--radix-popper-available-width",`${ee}px`),ie.setProperty("--radix-popper-available-height",`${Z}px`),ie.setProperty("--radix-popper-anchor-width",`${X}px`),ie.setProperty("--radix-popper-anchor-height",`${te}px`)}}),E&&t1({element:E,padding:i}),hb({arrowWidth:C,arrowHeight:S}),p&&n1({strategy:"referenceHidden",...z})]}),[_,V]=s0(A),K=Mt(v);Ve(()=>{D&&K?.()},[D,K]);const Y=j.arrow?.x,B=j.arrow?.y,q=j.arrow?.centerOffset!==0,[U,J]=c.useState();return Ve(()=>{b&&J(window.getComputedStyle(b).zIndex)},[b]),h.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:D?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(lb,{scope:n,placedSide:_,onArrowChange:T,arrowX:Y,arrowY:B,shouldHideArrow:q,children:h.jsx(re.div,{"data-side":_,"data-align":V,...g,ref:w,style:{...g.style,animation:D?void 0:"none"}})})})});n0.displayName=Oi;var r0="PopperArrow",db={top:"bottom",right:"left",bottom:"top",left:"right"},o0=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ub(r0,r),a=db[s.placedSide];return h.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:h.jsx(ab,{...o,ref:n,style:{...o.style,display:"block"}})})});o0.displayName=r0;function fb(e){return e!==null}var hb=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,f]=s0(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(o.arrow?.x??0)+i/2,m=(o.arrow?.y??0)+l/2;let v="",g="";return u==="bottom"?(v=a?d:`${p}px`,g=`${-l}px`):u==="top"?(v=a?d:`${p}px`,g=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,g=a?d:`${m}px`):u==="left"&&(v=`${r.floating.width+l}px`,g=a?d:`${m}px`),{data:{x:v,y:g}}}});function s0(e){const[t,n="center"]=e.split("-");return[t,n]}var Ii=Jf,Di=t0,Li=n0,ji=o0,Xs="rovingFocusGroup.onEntryFocus",pb={bubbles:!1,cancelable:!0},Zr="RovingFocusGroup",[Ma,a0,mb]=_i(Zr),[gb,ds]=Nt(Zr,[mb]),[vb,yb]=gb(Zr),i0=c.forwardRef((e,t)=>h.jsx(Ma.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Ma.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(bb,{...e,ref:t})})}));i0.displayName=Zr;var bb=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,p=c.useRef(null),m=le(t,p),v=us(s),[g,y]=Bt({prop:a,defaultProp:i??null,onChange:l,caller:Zr}),[b,x]=c.useState(!1),w=Mt(u),E=a0(n),T=c.useRef(!1),[O,C]=c.useState(0);return c.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(Xs,w),()=>S.removeEventListener(Xs,w)},[w]),h.jsx(vb,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:g,onItemFocus:c.useCallback(S=>y(S),[y]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>C(S=>S+1),[]),onFocusableItemRemove:c.useCallback(()=>C(S=>S-1),[]),children:h.jsx(re.div,{tabIndex:b||O===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:W(e.onMouseDown,()=>{T.current=!0}),onFocus:W(e.onFocus,S=>{const N=!T.current;if(S.target===S.currentTarget&&N&&!b){const I=new CustomEvent(Xs,pb);if(S.currentTarget.dispatchEvent(I),!I.defaultPrevented){const P=E().filter(A=>A.focusable),H=P.find(A=>A.active),z=P.find(A=>A.id===g),k=[H,z,...P].filter(Boolean).map(A=>A.ref.current);u0(k,f)}}T.current=!1}),onBlur:W(e.onBlur,()=>x(!1))})})}),c0="RovingFocusGroupItem",l0=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,l=Tt(),u=s||l,f=yb(c0,n),d=f.currentTabStopId===u,p=a0(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:g}=f;return c.useEffect(()=>{if(r)return m(),()=>v()},[r,m,v]),h.jsx(Ma.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:h.jsx(re.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:W(e.onMouseDown,y=>{r?f.onItemFocus(u):y.preventDefault()}),onFocus:W(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:W(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=Eb(y,f.orientation,f.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=p().filter(E=>E.focusable).map(E=>E.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const E=w.indexOf(y.currentTarget);w=f.loop?Sb(w,E+1):w.slice(E+1)}setTimeout(()=>u0(w))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:g!=null}):a})})});l0.displayName=c0;var xb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Eb(e,t,n){const r=wb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xb[r]}function u0(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Sb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var d0=i0,f0=l0,_a=["Enter"," "],Rb=["ArrowDown","PageUp","Home"],h0=["ArrowUp","PageDown","End"],Cb=[...Rb,...h0],Ab={ltr:[..._a,"ArrowRight"],rtl:[..._a,"ArrowLeft"]},Tb={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ur="Menu",[Cr,Pb,Mb]=_i(Ur),[Sn,p0]=Nt(Ur,[Mb,Qn,ds]),fs=Qn(),m0=ds(),[_b,Rn]=Sn(Ur),[Nb,qr]=Sn(Ur),g0=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,i=fs(t),[l,u]=c.useState(null),f=c.useRef(!1),d=Mt(s),p=us(o);return c.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),h.jsx(Ii,{...i,children:h.jsx(_b,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:h.jsx(Nb,{scope:t,onClose:c.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:p,modal:a,children:r})})})};g0.displayName=Ur;var Ob="MenuAnchor",ki=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=fs(n);return h.jsx(Di,{...o,...r,ref:t})});ki.displayName=Ob;var Fi="MenuPortal",[Ib,v0]=Sn(Fi,{forceMount:void 0}),y0=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Rn(Fi,t);return h.jsx(Ib,{scope:t,forceMount:n,children:h.jsx(Ot,{present:n||s.open,children:h.jsx(jr,{asChild:!0,container:o,children:r})})})};y0.displayName=Fi;var mt="MenuContent",[Db,$i]=Sn(mt),b0=c.forwardRef((e,t)=>{const n=v0(mt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Rn(mt,e.__scopeMenu),a=qr(mt,e.__scopeMenu);return h.jsx(Cr.Provider,{scope:e.__scopeMenu,children:h.jsx(Ot,{present:r||s.open,children:h.jsx(Cr.Slot,{scope:e.__scopeMenu,children:a.modal?h.jsx(Lb,{...o,ref:t}):h.jsx(jb,{...o,ref:t})})})})}),Lb=c.forwardRef((e,t)=>{const n=Rn(mt,e.__scopeMenu),r=c.useRef(null),o=le(t,r);return c.useEffect(()=>{const s=r.current;if(s)return hi(s)},[]),h.jsx(Hi,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),jb=c.forwardRef((e,t)=>{const n=Rn(mt,e.__scopeMenu);return h.jsx(Hi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),kb=qn("MenuContent.ScrollLock"),Hi=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:v,...g}=e,y=Rn(mt,n),b=qr(mt,n),x=fs(n),w=m0(n),E=Pb(n),[T,O]=c.useState(null),C=c.useRef(null),S=le(t,C,y.onContentChange),N=c.useRef(0),I=c.useRef(""),P=c.useRef(0),H=c.useRef(null),z=c.useRef("right"),L=c.useRef(0),k=v?Ya:c.Fragment,A=v?{as:kb,allowPinchZoom:!0}:void 0,D=_=>{const V=I.current+_,K=E().filter($=>!$.disabled),Y=document.activeElement,B=K.find($=>$.ref.current===Y)?.textValue,q=K.map($=>$.textValue),U=Gb(q,V,B),J=K.find($=>$.textValue===U)?.ref.current;(function $(F){I.current=F,window.clearTimeout(N.current),F!==""&&(N.current=window.setTimeout(()=>$(""),1e3))})(V),J&&setTimeout(()=>J.focus())};c.useEffect(()=>()=>window.clearTimeout(N.current),[]),fi();const j=c.useCallback(_=>z.current===H.current?.side&&Qb(_,H.current?.area),[]);return h.jsx(Db,{scope:n,searchRef:I,onItemEnter:c.useCallback(_=>{j(_)&&_.preventDefault()},[j]),onItemLeave:c.useCallback(_=>{j(_)||(C.current?.focus(),O(null))},[j]),onTriggerLeave:c.useCallback(_=>{j(_)&&_.preventDefault()},[j]),pointerGraceTimerRef:P,onPointerGraceIntentChange:c.useCallback(_=>{H.current=_},[]),children:h.jsx(k,{...A,children:h.jsx(ns,{asChild:!0,trapped:o,onMountAutoFocus:W(s,_=>{_.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:h.jsx(d0,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:O,onEntryFocus:W(l,_=>{b.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Li,{role:"menu","aria-orientation":"vertical","data-state":L0(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...g,ref:S,style:{outline:"none",...g.style},onKeyDown:W(g.onKeyDown,_=>{const K=_.target.closest("[data-radix-menu-content]")===_.currentTarget,Y=_.ctrlKey||_.altKey||_.metaKey,B=_.key.length===1;K&&(_.key==="Tab"&&_.preventDefault(),!Y&&B&&D(_.key));const q=C.current;if(_.target!==q||!Cb.includes(_.key))return;_.preventDefault();const J=E().filter($=>!$.disabled).map($=>$.ref.current);h0.includes(_.key)&&J.reverse(),Kb(J)}),onBlur:W(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(N.current),I.current="")}),onPointerMove:W(e.onPointerMove,Ar(_=>{const V=_.target,K=L.current!==_.clientX;if(_.currentTarget.contains(V)&&K){const Y=_.clientX>L.current?"right":"left";z.current=Y,L.current=_.clientX}}))})})})})})})});b0.displayName=mt;var Fb="MenuGroup",Bi=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(re.div,{role:"group",...r,ref:t})});Bi.displayName=Fb;var $b="MenuLabel",x0=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(re.div,{...r,ref:t})});x0.displayName=$b;var Lo="MenuItem",vl="menu.itemSelect",hs=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=c.useRef(null),a=qr(Lo,e.__scopeMenu),i=$i(Lo,e.__scopeMenu),l=le(t,s),u=c.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const p=new CustomEvent(vl,{bubbles:!0,cancelable:!0});d.addEventListener(vl,m=>r?.(m),{once:!0}),Bu(d,p),p.defaultPrevented?u.current=!1:a.onClose()}};return h.jsx(w0,{...o,ref:l,disabled:n,onClick:W(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),u.current=!0},onPointerUp:W(e.onPointerUp,d=>{u.current||d.currentTarget?.click()}),onKeyDown:W(e.onKeyDown,d=>{const p=i.searchRef.current!=="";n||p&&d.key===" "||_a.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});hs.displayName=Lo;var w0=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=$i(Lo,n),i=m0(n),l=c.useRef(null),u=le(t,l),[f,d]=c.useState(!1),[p,m]=c.useState("");return c.useEffect(()=>{const v=l.current;v&&m((v.textContent??"").trim())},[s.children]),h.jsx(Cr.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:h.jsx(f0,{asChild:!0,...i,focusable:!r,children:h.jsx(re.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:W(e.onPointerMove,Ar(v=>{r?a.onItemLeave(v):(a.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(e.onPointerLeave,Ar(v=>a.onItemLeave(v))),onFocus:W(e.onFocus,()=>d(!0)),onBlur:W(e.onBlur,()=>d(!1))})})})}),Hb="MenuCheckboxItem",E0=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return h.jsx(T0,{scope:e.__scopeMenu,checked:n,children:h.jsx(hs,{role:"menuitemcheckbox","aria-checked":jo(n)?"mixed":n,...o,ref:t,"data-state":Zi(n),onSelect:W(o.onSelect,()=>r?.(jo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});E0.displayName=Hb;var S0="MenuRadioGroup",[Bb,Vb]=Sn(S0,{value:void 0,onValueChange:()=>{}}),R0=c.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Mt(r);return h.jsx(Bb,{scope:e.__scopeMenu,value:n,onValueChange:s,children:h.jsx(Bi,{...o,ref:t})})});R0.displayName=S0;var C0="MenuRadioItem",A0=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=Vb(C0,e.__scopeMenu),s=n===o.value;return h.jsx(T0,{scope:e.__scopeMenu,checked:s,children:h.jsx(hs,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Zi(s),onSelect:W(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});A0.displayName=C0;var Vi="MenuItemIndicator",[T0,Zb]=Sn(Vi,{checked:!1}),P0=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Zb(Vi,n);return h.jsx(Ot,{present:r||jo(s.checked)||s.checked===!0,children:h.jsx(re.span,{...o,ref:t,"data-state":Zi(s.checked)})})});P0.displayName=Vi;var Ub="MenuSeparator",M0=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(re.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});M0.displayName=Ub;var qb="MenuArrow",_0=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=fs(n);return h.jsx(ji,{...o,...r,ref:t})});_0.displayName=qb;var zb="MenuSub",[d5,N0]=Sn(zb),hr="MenuSubTrigger",O0=c.forwardRef((e,t)=>{const n=Rn(hr,e.__scopeMenu),r=qr(hr,e.__scopeMenu),o=N0(hr,e.__scopeMenu),s=$i(hr,e.__scopeMenu),a=c.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=c.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return c.useEffect(()=>f,[f]),c.useEffect(()=>{const d=i.current;return()=>{window.clearTimeout(d),l(null)}},[i,l]),h.jsx(ki,{asChild:!0,...u,children:h.jsx(w0,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":L0(n.open),...e,ref:Dr(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:W(e.onPointerMove,Ar(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:W(e.onPointerLeave,Ar(d=>{f();const p=n.content?.getBoundingClientRect();if(p){const m=n.content?.dataset.side,v=m==="right",g=v?-5:5,y=p[v?"left":"right"],b=p[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+g,y:d.clientY},{x:y,y:p.top},{x:b,y:p.top},{x:b,y:p.bottom},{x:y,y:p.bottom}],side:m}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:W(e.onKeyDown,d=>{const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||Ab[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});O0.displayName=hr;var I0="MenuSubContent",D0=c.forwardRef((e,t)=>{const n=v0(mt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Rn(mt,e.__scopeMenu),a=qr(mt,e.__scopeMenu),i=N0(I0,e.__scopeMenu),l=c.useRef(null),u=le(t,l);return h.jsx(Cr.Provider,{scope:e.__scopeMenu,children:h.jsx(Ot,{present:r||s.open,children:h.jsx(Cr.Slot,{scope:e.__scopeMenu,children:h.jsx(Hi,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:W(e.onFocusOutside,f=>{f.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:W(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:W(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),p=Tb[a.dir].includes(f.key);d&&p&&(s.onOpenChange(!1),i.trigger?.focus(),f.preventDefault())})})})})})});D0.displayName=I0;function L0(e){return e?"open":"closed"}function jo(e){return e==="indeterminate"}function Zi(e){return jo(e)?"indeterminate":e?"checked":"unchecked"}function Kb(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Wb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Gb(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Wb(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Yb(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],l=t[a],u=i.x,f=i.y,d=l.x,p=l.y;f>r!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(o=!o)}return o}function Qb(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Yb(n,t)}function Ar(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Xb=g0,Jb=ki,e4=y0,t4=b0,n4=Bi,r4=x0,o4=hs,s4=E0,a4=R0,i4=A0,c4=P0,l4=M0,u4=_0,d4=O0,f4=D0,ps="DropdownMenu",[h4]=Nt(ps,[p0]),Ye=p0(),[p4,j0]=h4(ps),k0=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,l=Ye(t),u=c.useRef(null),[f,d]=Bt({prop:o,defaultProp:s??!1,onChange:a,caller:ps});return h.jsx(p4,{scope:t,triggerId:Tt(),triggerRef:u,contentId:Tt(),open:f,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(p=>!p),[d]),modal:i,children:h.jsx(Xb,{...l,open:f,onOpenChange:d,dir:r,modal:i,children:n})})};k0.displayName=ps;var F0="DropdownMenuTrigger",$0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=j0(F0,n),a=Ye(n);return h.jsx(Jb,{asChild:!0,...a,children:h.jsx(re.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Dr(t,s.triggerRef),onPointerDown:W(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:W(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});$0.displayName=F0;var m4="DropdownMenuPortal",H0=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ye(t);return h.jsx(e4,{...r,...n})};H0.displayName=m4;var B0="DropdownMenuContent",V0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j0(B0,n),s=Ye(n),a=c.useRef(!1);return h.jsx(t4,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:W(e.onCloseAutoFocus,i=>{a.current||o.triggerRef.current?.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:W(e.onInteractOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!o.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});V0.displayName=B0;var g4="DropdownMenuGroup",v4=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(n4,{...o,...r,ref:t})});v4.displayName=g4;var y4="DropdownMenuLabel",Z0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(r4,{...o,...r,ref:t})});Z0.displayName=y4;var b4="DropdownMenuItem",U0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(o4,{...o,...r,ref:t})});U0.displayName=b4;var x4="DropdownMenuCheckboxItem",q0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(s4,{...o,...r,ref:t})});q0.displayName=x4;var w4="DropdownMenuRadioGroup",E4=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(a4,{...o,...r,ref:t})});E4.displayName=w4;var S4="DropdownMenuRadioItem",z0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(i4,{...o,...r,ref:t})});z0.displayName=S4;var R4="DropdownMenuItemIndicator",K0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(c4,{...o,...r,ref:t})});K0.displayName=R4;var C4="DropdownMenuSeparator",W0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(l4,{...o,...r,ref:t})});W0.displayName=C4;var A4="DropdownMenuArrow",T4=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(u4,{...o,...r,ref:t})});T4.displayName=A4;var P4="DropdownMenuSubTrigger",G0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(d4,{...o,...r,ref:t})});G0.displayName=P4;var M4="DropdownMenuSubContent",Y0=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ye(n);return h.jsx(f4,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Y0.displayName=M4;var _4=k0,N4=$0,O4=H0,I4=V0,D4=Z0,L4=U0,j4=q0,k4=z0,F4=K0,$4=W0,H4=G0,B4=Y0,V4=_4,Z4=N4,U4=O4,Q0=I4,X0=L4,J0=j4,eh=k4,th=F4,nh=D4,rh=$4,oh=H4,sh=B4;const q4=V4,z4=Z4,K4=c.forwardRef(({className:e,inset:t,children:n,...r},o)=>h.jsx(oh,{ref:o,className:ae("flex","cursor-default","select-none","items-center","rounded-[10px]","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","focus:bg-hover-subtle","focus:text-fg-default","data-[state=open]:bg-hover-subtle","data-[state=open]:text-fg-default",t&&"pl-8",e),...r,children:n}));K4.displayName=oh.displayName;const W4=c.forwardRef(({className:e,...t},n)=>h.jsx(sh,{ref:n,className:ae("z-50","min-w-[8rem]","overflow-hidden","surface-floating","p-1",e),...t}));W4.displayName=sh.displayName;const ah=c.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(U4,{children:h.jsx(Q0,{ref:r,sideOffset:t,className:ae("z-[1100]","min-w-[10rem]","overflow-hidden","surface-floating","p-1","data-[state=open]:animate-fade-in","data-[state=open]:animate-zoom-in",e),...n})}));ah.displayName=Q0.displayName;const ih=c.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(X0,{ref:r,className:ae("relative","flex","cursor-pointer","select-none","items-center","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","rounded-[10px]","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ih.displayName=X0.displayName;const G4=c.forwardRef(({className:e,children:t,checked:n,...r},o)=>h.jsxs(J0,{ref:o,className:ae("relative","flex","cursor-pointer","select-none","items-center","rounded-[10px]","py-2","pl-8","pr-3","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(th,{children:"✓"})}),t]}));G4.displayName=J0.displayName;const Y4=c.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(eh,{ref:r,className:ae("relative","flex","cursor-pointer","select-none","items-center","rounded-[10px]","py-2","pl-8","pr-3","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","focus:bg-hover-subtle","focus:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(th,{children:"●"})}),t]}));Y4.displayName=eh.displayName;const Q4=c.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(nh,{ref:r,className:ae("px-2","py-1.5","text-sm","font-semibold","text-fg-secondary",t&&"pl-8",e),...n}));Q4.displayName=nh.displayName;const ch=c.forwardRef(({className:e,...t},n)=>h.jsx(rh,{ref:n,className:ae("-mx-1","my-1","h-px","bg-divider",e),...t}));ch.displayName=rh.displayName;const X4=({button:e,items:t})=>h.jsxs(q4,{children:[h.jsx(z4,{asChild:!0,children:e}),h.jsx(ah,{align:"end",children:t.map((n,r)=>n.type==="separator"?h.jsx(ch,{},n.key??`separator-${r}`):h.jsx(ih,{onClick:n.onClick,children:n.name},n.name))})]}),lh=c.forwardRef(({title:e,description:t,className:n="",...r},o)=>h.jsxs("div",{ref:o,className:ae("flex flex-col items-center justify-center text-center","h-[400px]","bg-muted/30","border-2 border-dashed","border-border-secondary","rounded-[20px]","p-8",n),...r,children:[e&&h.jsx(se,{as:"h3",variant:"heading",weight:"bold",tone:"muted",className:"mb-2",children:e}),t&&h.jsx(se,{as:"p",variant:"meta",weight:"medium",tone:"tertiary",className:"max-w-[400px]",children:t})]}));lh.displayName="Empty";const J4=je(["w-full","border","border-border-subtle","bg-elevated","text-fg-default","placeholder:text-fg-placeholder","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50"],{variants:{variant:{default:[],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"],error:["border-border-error","bg-accent-soft-danger/40","text-fg-default"]},size:{sm:"h-8 px-3 text-sm rounded-[12px]",md:"h-9 px-3 text-sm rounded-[14px]",lg:"h-11 px-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),ex=c.forwardRef(({className:e,variant:t,size:n,type:r="text",...o},s)=>h.jsx("input",{ref:s,type:r,className:J4({variant:t,size:n,className:e}),...o}));ex.displayName="Input";const tx=je(["font-bold","text-fg-muted","whitespace-nowrap"],{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"sm"}}),uh=c.forwardRef(({className:e,size:t,...n},r)=>h.jsx("label",{ref:r,className:tx({size:t,className:e}),...n}));uh.displayName="Label";const nx=je(["focus-ring-soft","inline-flex","shrink-0","items-center","justify-center","bg-transparent","text-fg-default/70","outline-none","transition-colors","hover:bg-hover-subtle","hover:text-fg-default"],{variants:{size:{sm:"h-7 w-7 rounded-[8px]",md:"h-8 w-8 rounded-[10px]",lg:"h-9 w-9 rounded-[12px]"}},defaultVariants:{size:"md"}}),rx={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"};function ox({label:e,size:t="md",iconClassName:n,className:r,type:o="button",...s}){return h.jsx("button",{type:o,"aria-label":e,className:nx({size:t,className:r}),...s,children:h.jsx(Zv,{className:n??rx[t]})})}const dh=c.forwardRef(({page:e,last:t,onChange:n,className:r="",...o},s)=>{const a=Number(e),i=Number(t),l=[];for(let d=1;d<i+1;d++)(a===d||a===1&&d<a+5||a===2&&d<a+4||d>a-3&&d<a+3||a===i-1&&d>a-4||a===i&&d>a-5)&&l.push(d);const u=a===1,f=a===i;return h.jsxs("nav",{ref:s,className:`mt-8 flex justify-center items-center gap-1 ${r}`,...o,children:[h.jsxs(kn,{disabled:u,onClick:()=>!u&&n(1),"aria-label":"First page",isSkip:!0,children:[h.jsx(zs,{width:16}),h.jsx(zs,{width:16})]}),h.jsx(kn,{disabled:u,onClick:()=>!u&&n(a-1),"aria-label":"Previous page",children:h.jsx(zs,{width:20})}),l.map(d=>h.jsx(kn,{active:a===d,onClick:()=>n(d),"aria-label":`Page ${d}`,"aria-current":a===d?"page":void 0,children:d},d)),h.jsx(kn,{disabled:f,onClick:()=>!f&&n(a+1),"aria-label":"Next page",children:h.jsx(vr,{width:20})}),h.jsxs(kn,{disabled:f,onClick:()=>!f&&n(i),"aria-label":"Last page",isSkip:!0,children:[h.jsx(vr,{width:16}),h.jsx(vr,{width:16})]})]})});dh.displayName="Pagination";const kn=c.forwardRef(({active:e,disabled:t,isSkip:n,children:r,className:o="",...s},a)=>{const i=`
21
21
  flex justify-center items-center
22
22
  leading-normal text-base font-medium
23
23
  w-9 h-9 md:w-10 md:h-10
24
24
  border border-transparent
25
25
  rounded-[10px]
26
26
  transition-all duration-200
27
- `,l=e?"cursor-default bg-cta border-cta text-fg-on-filled":t?"cursor-default text-fg-disabled border-transparent":"cursor-pointer text-fg-default hover:bg-hover hover:border-border-subtle",u=n?"relative [&>svg]:absolute [&>svg:first-child]:-translate-x-[3px] [&>svg:last-child]:translate-x-[3px]":"";return h.jsx("button",{ref:a,type:"button",disabled:t,className:`${i} ${l} ${u} ${o}`,...s,children:r})});kn.displayName="PaginationItem";const sx=je(["h-full","transition-all","duration-300","ease-out"],{variants:{color:{primary:"bg-pastel-blue-200",success:"bg-pastel-green-200",danger:"bg-pastel-pink-200",warning:"bg-pastel-orange-200"}},defaultVariants:{color:"primary"}}),ax=c.forwardRef(({value:e,max:t,color:n,className:r="",...o},s)=>{const a=Math.min(100,Math.max(0,e/t*100));return h.jsx("div",{ref:s,className:ae("w-full h-3","bg-surface","border-2 border-border","rounded-[6px]","overflow-hidden",r),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,...o,children:h.jsx("div",{className:`progress-fill ${sx({color:n})}`,style:{"--progress-width":`${a}%`}})})});ax.displayName="Progress";function yl(e,[t,n]){return Math.min(n,Math.max(t,e))}function ix(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fh=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cx="VisuallyHidden",hh=c.forwardRef((e,t)=>h.jsx(re.span,{...e,ref:t,style:{...fh,...e.style}}));hh.displayName=cx;var lx=hh,ux=[" ","Enter","ArrowUp","ArrowDown"],dx=[" ","Enter"],bn="Select",[ms,gs,fx]=_i(bn),[Xn]=Nt(bn,[fx,Qn]),vs=Qn(),[hx,en]=Xn(bn),[px,mx]=Xn(bn),ph=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:p,required:m,form:v}=e,g=vs(t),[y,b]=c.useState(null),[x,w]=c.useState(null),[E,T]=c.useState(!1),O=us(u),[C,S]=Bt({prop:r,defaultProp:o??!1,onChange:s,caller:bn}),[N,I]=Bt({prop:a,defaultProp:i,onChange:l,caller:bn}),P=c.useRef(null),H=y?v||!!y.closest("form"):!0,[z,L]=c.useState(new Set),k=Array.from(z).map(A=>A.props.value).join(";");return h.jsx(Ii,{...g,children:h.jsxs(hx,{required:m,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:T,contentId:Tt(),value:N,onValueChange:I,open:C,onOpenChange:S,dir:O,triggerPointerDownPosRef:P,disabled:p,children:[h.jsx(ms.Provider,{scope:t,children:h.jsx(px,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(A=>{L(D=>new Set(D).add(A))},[]),onNativeOptionRemove:c.useCallback(A=>{L(D=>{const j=new Set(D);return j.delete(A),j})},[]),children:n})}),H?h.jsxs(Ih,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:N,onChange:A=>I(A.target.value),disabled:p,form:v,children:[N===void 0?h.jsx("option",{value:""}):null,Array.from(z)]},k):null]})})};ph.displayName=bn;var mh="SelectTrigger",gh=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=vs(n),a=en(mh,n),i=a.disabled||r,l=le(t,a.onTriggerChange),u=gs(n),f=c.useRef("touch"),[d,p,m]=Lh(g=>{const y=u().filter(w=>!w.disabled),b=y.find(w=>w.value===a.value),x=jh(y,g,b);x!==void 0&&a.onValueChange(x.value)}),v=g=>{i||(a.onOpenChange(!0),m()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return h.jsx(Di,{asChild:!0,...s,children:h.jsx(re.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Dh(a.value)?"":void 0,...o,ref:l,onClick:W(o.onClick,g=>{g.currentTarget.focus(),f.current!=="mouse"&&v(g)}),onPointerDown:W(o.onPointerDown,g=>{f.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:W(o.onKeyDown,g=>{const y=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(y&&g.key===" ")&&ux.includes(g.key)&&(v(),g.preventDefault())})})})});gh.displayName=mh;var vh="SelectValue",yh=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...i}=e,l=en(vh,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,d=le(t,l.onValueNodeChange);return Ve(()=>{u(f)},[u,f]),h.jsx(re.span,{...i,ref:d,style:{pointerEvents:"none"},children:Dh(l.value)?h.jsx(h.Fragment,{children:a}):s})});yh.displayName=vh;var gx="SelectIcon",bh=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return h.jsx(re.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});bh.displayName=gx;var vx="SelectPortal",xh=e=>h.jsx(jr,{asChild:!0,...e});xh.displayName=vx;var xn="SelectContent",wh=c.forwardRef((e,t)=>{const n=en(xn,e.__scopeSelect),[r,o]=c.useState();if(Ve(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?$t.createPortal(h.jsx(Eh,{scope:e.__scopeSelect,children:h.jsx(ms.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),s):null}return h.jsx(Sh,{...e,ref:t})});wh.displayName=xn;var yt=10,[Eh,tn]=Xn(xn),yx="SelectContentImpl",bx=qn("SelectContent.RemoveScroll"),Sh=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:y,...b}=e,x=en(xn,n),[w,E]=c.useState(null),[T,O]=c.useState(null),C=le(t,$=>E($)),[S,N]=c.useState(null),[I,P]=c.useState(null),H=gs(n),[z,L]=c.useState(!1),k=c.useRef(!1);c.useEffect(()=>{if(w)return hi(w)},[w]),fi();const A=c.useCallback($=>{const[F,...ee]=H().map(te=>te.ref.current),[Z]=ee.slice(-1),X=document.activeElement;for(const te of $)if(te===X||(te?.scrollIntoView({block:"nearest"}),te===F&&T&&(T.scrollTop=0),te===Z&&T&&(T.scrollTop=T.scrollHeight),te?.focus(),document.activeElement!==X))return},[H,T]),D=c.useCallback(()=>A([S,w]),[A,S,w]);c.useEffect(()=>{z&&D()},[z,D]);const{onOpenChange:j,triggerPointerDownPosRef:_}=x;c.useEffect(()=>{if(w){let $={x:0,y:0};const F=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(_.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(_.current?.y??0))}},ee=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||j(!1),document.removeEventListener("pointermove",F),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",F),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",ee,{capture:!0})}}},[w,j,_]),c.useEffect(()=>{const $=()=>j(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[j]);const[V,K]=Lh($=>{const F=H().filter(X=>!X.disabled),ee=F.find(X=>X.ref.current===document.activeElement),Z=jh(F,$,ee);Z&&setTimeout(()=>Z.ref.current.focus())}),Y=c.useCallback(($,F,ee)=>{const Z=!k.current&&!ee;(x.value!==void 0&&x.value===F||Z)&&(N($),Z&&(k.current=!0))},[x.value]),B=c.useCallback(()=>w?.focus(),[w]),q=c.useCallback(($,F,ee)=>{const Z=!k.current&&!ee;(x.value!==void 0&&x.value===F||Z)&&P($)},[x.value]),U=r==="popper"?Na:Rh,J=U===Na?{side:i,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:y}:{};return h.jsx(Eh,{scope:n,content:w,viewport:T,onViewportChange:O,itemRefCallback:Y,selectedItem:S,onItemLeave:B,itemTextRefCallback:q,focusSelectedItem:D,selectedItemText:I,position:r,isPositioned:z,searchRef:V,children:h.jsx(Ya,{as:bx,allowPinchZoom:!0,children:h.jsx(ns,{asChild:!0,trapped:x.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:W(o,$=>{x.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:h.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:h.jsx(U,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:$=>$.preventDefault(),...b,...J,onPlaced:()=>L(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:W(b.onKeyDown,$=>{const F=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!F&&$.key.length===1&&K($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=H().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const X=$.target,te=Z.indexOf(X);Z=Z.slice(te+1)}setTimeout(()=>A(Z)),$.preventDefault()}})})})})})})});Sh.displayName=yx;var xx="SelectItemAlignedPosition",Rh=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=en(xn,n),a=tn(xn,n),[i,l]=c.useState(null),[u,f]=c.useState(null),d=le(t,C=>f(C)),p=gs(n),m=c.useRef(!1),v=c.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=a,w=c.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&u&&g&&y&&b){const C=s.trigger.getBoundingClientRect(),S=u.getBoundingClientRect(),N=s.valueNode.getBoundingClientRect(),I=b.getBoundingClientRect();if(s.dir!=="rtl"){const X=I.left-S.left,te=N.left-X,ie=C.left-te,ue=C.width+ie,Qe=Math.max(ue,S.width),Fe=window.innerWidth-yt,qe=yl(te,[yt,Math.max(yt,Fe-Qe)]);i.style.minWidth=ue+"px",i.style.left=qe+"px"}else{const X=S.right-I.right,te=window.innerWidth-N.right-X,ie=window.innerWidth-C.right-te,ue=C.width+ie,Qe=Math.max(ue,S.width),Fe=window.innerWidth-yt,qe=yl(te,[yt,Math.max(yt,Fe-Qe)]);i.style.minWidth=ue+"px",i.style.right=qe+"px"}const P=p(),H=window.innerHeight-yt*2,z=g.scrollHeight,L=window.getComputedStyle(u),k=parseInt(L.borderTopWidth,10),A=parseInt(L.paddingTop,10),D=parseInt(L.borderBottomWidth,10),j=parseInt(L.paddingBottom,10),_=k+A+z+j+D,V=Math.min(y.offsetHeight*5,_),K=window.getComputedStyle(g),Y=parseInt(K.paddingTop,10),B=parseInt(K.paddingBottom,10),q=C.top+C.height/2-yt,U=H-q,J=y.offsetHeight/2,$=y.offsetTop+J,F=k+A+$,ee=_-F;if(F<=q){const X=P.length>0&&y===P[P.length-1].ref.current;i.style.bottom="0px";const te=u.clientHeight-g.offsetTop-g.offsetHeight,ie=Math.max(U,J+(X?B:0)+te+D),ue=F+ie;i.style.height=ue+"px"}else{const X=P.length>0&&y===P[0].ref.current;i.style.top="0px";const ie=Math.max(q,k+g.offsetTop+(X?Y:0)+J)+ee;i.style.height=ie+"px",g.scrollTop=F-q+g.offsetTop}i.style.margin=`${yt}px 0`,i.style.minHeight=V+"px",i.style.maxHeight=H+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,s.trigger,s.valueNode,i,u,g,y,b,s.dir,r]);Ve(()=>w(),[w]);const[E,T]=c.useState();Ve(()=>{u&&T(window.getComputedStyle(u).zIndex)},[u]);const O=c.useCallback(C=>{C&&v.current===!0&&(w(),x?.(),v.current=!1)},[w,x]);return h.jsx(Ex,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:m,onScrollButtonChange:O,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:h.jsx(re.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Rh.displayName=xx;var wx="SelectPopperPosition",Na=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=yt,...s}=e,a=vs(n);return h.jsx(Li,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Na.displayName=wx;var[Ex,Ui]=Xn(xn,{}),Oa="SelectViewport",Ch=c.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=tn(Oa,n),a=Ui(Oa,n),i=le(t,s.onViewportChange),l=c.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(ms.Slot,{scope:n,children:h.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:W(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=a;if(p?.current&&d){const m=Math.abs(l.current-f.scrollTop);if(m>0){const v=window.innerHeight-yt*2,g=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(g,y);if(b<v){const x=b+m,w=Math.min(v,x),E=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Ch.displayName=Oa;var Ah="SelectGroup",[Sx,Rx]=Xn(Ah),Cx=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tt();return h.jsx(Sx,{scope:n,id:o,children:h.jsx(re.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Cx.displayName=Ah;var Th="SelectLabel",Ax=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Rx(Th,n);return h.jsx(re.div,{id:o.id,...r,ref:t})});Ax.displayName=Th;var ko="SelectItem",[Tx,Ph]=Xn(ko),Mh=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,i=en(ko,n),l=tn(ko,n),u=i.value===r,[f,d]=c.useState(s??""),[p,m]=c.useState(!1),v=le(t,x=>l.itemRefCallback?.(x,r,o)),g=Tt(),y=c.useRef("touch"),b=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(Tx,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:c.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:h.jsx(ms.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:h.jsx(re.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:v,onFocus:W(a.onFocus,()=>m(!0)),onBlur:W(a.onBlur,()=>m(!1)),onClick:W(a.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:W(a.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:W(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:W(a.onPointerMove,x=>{y.current=x.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:W(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:W(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(dx.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});Mh.displayName=ko;var pr="SelectItemText",_h=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=en(pr,n),i=tn(pr,n),l=Ph(pr,n),u=mx(pr,n),[f,d]=c.useState(null),p=le(t,b=>d(b),l.onItemTextChange,b=>i.itemTextRefCallback?.(b,l.value,l.disabled)),m=f?.textContent,v=c.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return Ve(()=>(g(v),()=>y(v)),[g,y,v]),h.jsxs(h.Fragment,{children:[h.jsx(re.span,{id:l.textId,...s,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?$t.createPortal(s.children,a.valueNode):null]})});_h.displayName=pr;var Nh="SelectItemIndicator",Px=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ph(Nh,n).isSelected?h.jsx(re.span,{"aria-hidden":!0,...r,ref:t}):null});Px.displayName=Nh;var Ia="SelectScrollUpButton",Mx=c.forwardRef((e,t)=>{const n=tn(Ia,e.__scopeSelect),r=Ui(Ia,e.__scopeSelect),[o,s]=c.useState(!1),a=le(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?h.jsx(Oh,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Mx.displayName=Ia;var Da="SelectScrollDownButton",_x=c.forwardRef((e,t)=>{const n=tn(Da,e.__scopeSelect),r=Ui(Da,e.__scopeSelect),[o,s]=c.useState(!1),a=le(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<u;s(f)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?h.jsx(Oh,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});_x.displayName=Da;var Oh=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=tn("SelectScrollButton",n),a=c.useRef(null),i=gs(n),l=c.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),Ve(()=>{i().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),h.jsx(re.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:W(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:W(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:W(o.onPointerLeave,()=>{l()})})}),Nx="SelectSeparator",Ox=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(re.div,{"aria-hidden":!0,...r,ref:t})});Ox.displayName=Nx;var La="SelectArrow",Ix=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=vs(n),s=en(La,n),a=tn(La,n);return s.open&&a.position==="popper"?h.jsx(ji,{...o,...r,ref:t}):null});Ix.displayName=La;var Dx="SelectBubbleInput",Ih=c.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=c.useRef(null),s=le(r,o),a=ix(t);return c.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(d)}},[a,t]),h.jsx(re.select,{...n,style:{...fh,...n.style},ref:s,defaultValue:t})});Ih.displayName=Dx;function Dh(e){return e===""||e===void 0}function Lh(e){const t=Mt(e),n=c.useRef(""),r=c.useRef(0),o=c.useCallback(a=>{const i=n.current+a;t(i),(function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(i)},[t]),s=c.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function jh(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Lx(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Lx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jx=ph,kx=gh,Fx=yh,$x=bh,Hx=xh,Bx=wh,Vx=Ch,Zx=Mh,Ux=_h,qx=jx,zx=Fx,Kx=kx,Wx=$x,Gx=Hx,Yx=Bx,Qx=Vx,Xx=Zx,Jx=Ux;const ew=je(["inline-flex","items-center","justify-between","gap-2","border","border-border-subtle","bg-elevated","text-fg-default","font-medium","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50","cursor-pointer","whitespace-nowrap"],{variants:{variant:{default:["border-border-subtle"],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"]},size:{sm:"h-8 px-3 text-sm rounded-[12px]",md:"h-9 px-3 text-sm rounded-[14px]",lg:"h-11 px-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),yo=({value:e,defaultValue:t,onValueChange:n,placeholder:r,ariaLabel:o,variant:s,size:a,className:i,children:l,disabled:u})=>h.jsxs(qx,{value:e,defaultValue:t,onValueChange:n,disabled:u,children:[h.jsxs(Kx,{"aria-label":o,className:ew({variant:s,size:a,className:i}),children:[h.jsx(zx,{className:"min-w-0 truncate",placeholder:r}),h.jsx(Wx,{children:h.jsx(Hv,{className:"w-3.5 h-3.5 opacity-60"})})]}),h.jsx(Gx,{children:h.jsx(kh,{children:h.jsx(Qx,{className:"p-1",children:l})})})]}),kh=c.forwardRef(({className:e,children:t,...n},r)=>h.jsx(Yx,{ref:r,position:"popper",sideOffset:4,className:ae("z-[1100]","min-w-[var(--radix-select-trigger-width)]","overflow-hidden","surface-floating","data-[state=open]:animate-fade-in","data-[state=open]:animate-zoom-in",e),...n,children:t}));kh.displayName="SelectContent";const Fn=c.forwardRef(({className:e,children:t,...n},r)=>h.jsx(Xx,{ref:r,className:ae("relative","flex","items-center","cursor-pointer","select-none","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","rounded-[10px]","data-[highlighted]:bg-hover-subtle","data-[highlighted]:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),...n,children:h.jsx(Jx,{children:t})}));Fn.displayName="SelectItem";yo.displayName="Select";const bl=e=>typeof e=="number"?`${e}px`:e,Ht=c.forwardRef(({width:e,height:t=30,opacity:n,className:r="",style:o,...s},a)=>h.jsx("div",{ref:a,className:ae("rounded-[14px]","skeleton-sized","bg-[length:200%_100%]","bg-gradient-to-r","from-pastel-lavender-200/30","via-pastel-yellow-200/20","to-pastel-lavender-200/30","animate-shimmer","animate-fade-in",r),style:{"--skeleton-width":bl(e),"--skeleton-height":bl(t),"--skeleton-opacity":n,...o},...s}));Ht.displayName="Skeleton";const tw=c.forwardRef(({checked:e,onCheckedChange:t,onClick:n,className:r,disabled:o,...s},a)=>h.jsx("button",{ref:a,type:"button",role:"switch","aria-checked":e,disabled:o,className:ae("focus-ring-soft relative inline-flex h-7 w-12 items-center rounded-full border p-1 transition-colors duration-200 outline-none",e?"border-transparent bg-cta hover:bg-cta-hover active:bg-cta-hover":"border-border bg-subtle hover:bg-hover active:bg-active",o&&"cursor-not-allowed opacity-80",r),onClick:i=>{n?.(i),!(i.defaultPrevented||o)&&t?.(!e)},...s,children:h.jsx("span",{"aria-hidden":"true",className:ae("pointer-events-none inline-block h-5 w-5 rounded-full shadow-sm transition-transform duration-200",e?"translate-x-5 bg-white":"translate-x-0 bg-fg-secondary")})}));tw.displayName="Switch";const nw=je(["w-full","border","border-border-subtle","bg-elevated","text-fg-default","placeholder:text-fg-placeholder","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50","resize-none"],{variants:{variant:{default:[],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"],error:["border-border-error","bg-accent-soft-danger/40","text-fg-default"]},size:{sm:"min-h-[60px] p-3 text-sm rounded-[12px]",md:"min-h-[80px] p-3 text-sm rounded-[14px]",lg:"min-h-[100px] p-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),rw=c.forwardRef(({className:e,variant:t,size:n,...r},o)=>h.jsx("textarea",{ref:o,className:nw({variant:t,size:n,className:e}),...r}));rw.displayName="Textarea";var Fh="Toggle",$h=c.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[a,i]=Bt({prop:n,onChange:o,defaultProp:r??!1,caller:Fh});return h.jsx(re.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:W(e.onClick,()=>{e.disabled||i(!a)})})});$h.displayName=Fh;var nn="ToggleGroup",[Hh]=Nt(nn,[ds]),Bh=ds(),qi=M.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return h.jsx(ow,{...o,ref:t})}if(n==="multiple"){const o=r;return h.jsx(sw,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${nn}\``)});qi.displayName=nn;var[Vh,Zh]=Hh(nn),ow=M.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[a,i]=Bt({prop:n,defaultProp:r??"",onChange:o,caller:nn});return h.jsx(Vh,{scope:e.__scopeToggleGroup,type:"single",value:M.useMemo(()=>a?[a]:[],[a]),onItemActivate:i,onItemDeactivate:M.useCallback(()=>i(""),[i]),children:h.jsx(Uh,{...s,ref:t})})}),sw=M.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[a,i]=Bt({prop:n,defaultProp:r??[],onChange:o,caller:nn}),l=M.useCallback(f=>i((d=[])=>[...d,f]),[i]),u=M.useCallback(f=>i((d=[])=>d.filter(p=>p!==f)),[i]);return h.jsx(Vh,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:u,children:h.jsx(Uh,{...s,ref:t})})});qi.displayName=nn;var[aw,iw]=Hh(nn),Uh=M.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:a,loop:i=!0,...l}=e,u=Bh(n),f=us(a),d={role:"group",dir:f,...l};return h.jsx(aw,{scope:n,rovingFocus:o,disabled:r,children:o?h.jsx(d0,{asChild:!0,...u,orientation:s,dir:f,loop:i,children:h.jsx(re.div,{...d,ref:t})}):h.jsx(re.div,{...d,ref:t})})}),Fo="ToggleGroupItem",qh=M.forwardRef((e,t)=>{const n=Zh(Fo,e.__scopeToggleGroup),r=iw(Fo,e.__scopeToggleGroup),o=Bh(e.__scopeToggleGroup),s=n.value.includes(e.value),a=r.disabled||e.disabled,i={...e,pressed:s,disabled:a},l=M.useRef(null);return r.rovingFocus?h.jsx(f0,{asChild:!0,...o,focusable:!a,active:s,ref:l,children:h.jsx(xl,{...i,ref:t})}):h.jsx(xl,{...i,ref:t})});qh.displayName=Fo;var xl=M.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=Zh(Fo,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=s.type==="single"?a:void 0;return h.jsx($h,{...i,...o,ref:t,onPressedChange:l=>{l?s.onItemActivate(r):s.onItemDeactivate(r)}})}),cw=qi,lw=qh,uw=cw,dw=lw;const fw=je(["inline-flex","gap-0.5","overflow-hidden"],{variants:{variant:{default:["border-2","border-border","rounded-[10px]","bg-surface"],outline:["border-2","border-border","rounded-[10px]","bg-transparent"],pills:["surface-base","p-1"],quiet:["rounded-[12px]","border","border-border-subtle/80","bg-hover-subtle/55","p-0.5"]}},defaultVariants:{variant:"default"}}),hw=je(["flex","items-center","justify-center","font-bold","border","border-transparent","transition-colors","duration-200","disabled:pointer-events-none","disabled:opacity-50"],{variants:{variant:{default:["text-fg-muted","hover:bg-hover","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled"],outline:["text-fg-muted","hover:bg-hover-subtle","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled"],pills:["text-fg-secondary","rounded-[10px]","hover:bg-hover-subtle","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled","data-[state=on]:border-border-secondary"],quiet:["rounded-[10px]","font-medium","text-fg-secondary","hover:bg-hover-subtle/80","data-[state=on]:border-border-secondary/70","data-[state=on]:bg-elevated","data-[state=on]:text-fg-default","data-[state=on]:shadow-[0_8px_18px_-16px_rgba(15,18,24,0.28)]"]},size:{sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),zh=c.createContext({}),pw=c.forwardRef(({className:e,variant:t,size:n,children:r,...o},s)=>h.jsx(zh.Provider,{value:{variant:t??"default",size:n??"md"},children:h.jsx(uw,{ref:s,className:fw({variant:t,className:e}),...o,children:r})}));pw.displayName="ToggleGroup";const mw=c.forwardRef(({className:e,activeClassName:t,children:n,...r},o)=>{const s=c.useContext(zh);return h.jsx(dw,{ref:o,className:hw({variant:s.variant,size:s.size,className:ae(e,t)}),...r,children:n})});mw.displayName="ToggleGroupItem";var[ys]=Nt("Tooltip",[Qn]),bs=Qn(),Kh="TooltipProvider",gw=700,ja="tooltip.open",[vw,zi]=ys(Kh),Wh=e=>{const{__scopeTooltip:t,delayDuration:n=gw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,a=c.useRef(!0),i=c.useRef(!1),l=c.useRef(0);return c.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),h.jsx(vw,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:c.useCallback(u=>{i.current=u},[]),disableHoverableContent:o,children:s})};Wh.displayName=Kh;var Tr="Tooltip",[yw,zr]=ys(Tr),Gh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,l=zi(Tr,e.__scopeTooltip),u=bs(t),[f,d]=c.useState(null),p=Tt(),m=c.useRef(0),v=a??l.disableHoverableContent,g=i??l.delayDuration,y=c.useRef(!1),[b,x]=Bt({prop:r,defaultProp:o??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(ja))):l.onClose(),s?.(C)},caller:Tr}),w=c.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),E=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),T=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),O=c.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},g)},[g,x]);return c.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),h.jsx(Ii,{...u,children:h.jsx(yw,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:f,onTriggerChange:d,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayedRef.current?O():E()},[l.isOpenDelayedRef,O,E]),onTriggerLeave:c.useCallback(()=>{v?T():(window.clearTimeout(m.current),m.current=0)},[T,v]),onOpen:E,onClose:T,disableHoverableContent:v,children:n})})};Gh.displayName=Tr;var ka="TooltipTrigger",Yh=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zr(ka,n),s=zi(ka,n),a=bs(n),i=c.useRef(null),l=le(t,i,o.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),d=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(Di,{asChild:!0,...a,children:h.jsx(re.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:W(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:W(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:W(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:W(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:W(e.onBlur,o.onClose),onClick:W(e.onClick,o.onClose)})})});Yh.displayName=ka;var Ki="TooltipPortal",[bw,xw]=ys(Ki,{forceMount:void 0}),Qh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=zr(Ki,t);return h.jsx(bw,{scope:t,forceMount:n,children:h.jsx(Ot,{present:n||s.open,children:h.jsx(jr,{asChild:!0,container:o,children:r})})})};Qh.displayName=Ki;var Kn="TooltipContent",Xh=c.forwardRef((e,t)=>{const n=xw(Kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,a=zr(Kn,e.__scopeTooltip);return h.jsx(Ot,{present:r||a.open,children:a.disableHoverableContent?h.jsx(Jh,{side:o,...s,ref:t}):h.jsx(ww,{side:o,...s,ref:t})})}),ww=c.forwardRef((e,t)=>{const n=zr(Kn,e.__scopeTooltip),r=zi(Kn,e.__scopeTooltip),o=c.useRef(null),s=le(t,o),[a,i]=c.useState(null),{trigger:l,onClose:u}=n,f=o.current,{onPointerInTransitChange:d}=r,p=c.useCallback(()=>{i(null),d(!1)},[d]),m=c.useCallback((v,g)=>{const y=v.currentTarget,b={x:v.clientX,y:v.clientY},x=Aw(b,y.getBoundingClientRect()),w=Tw(b,x),E=Pw(g.getBoundingClientRect()),T=_w([...w,...E]);i(T),d(!0)},[d]);return c.useEffect(()=>()=>p(),[p]),c.useEffect(()=>{if(l&&f){const v=y=>m(y,f),g=y=>m(y,l);return l.addEventListener("pointerleave",v),f.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",g)}}},[l,f,m,p]),c.useEffect(()=>{if(a){const v=g=>{const y=g.target,b={x:g.clientX,y:g.clientY},x=l?.contains(y)||f?.contains(y),w=!Mw(b,a);x?p():w&&(p(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,f,a,u,p]),h.jsx(Jh,{...e,ref:s})}),[Ew,Sw]=ys(Tr,{isInside:!1}),Rw=Hu("TooltipContent"),Jh=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,l=zr(Kn,n),u=bs(n),{onClose:f}=l;return c.useEffect(()=>(document.addEventListener(ja,f),()=>document.removeEventListener(ja,f)),[f]),c.useEffect(()=>{if(l.trigger){const d=p=>{p.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),h.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:h.jsxs(Li,{"data-state":l.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Rw,{children:r}),h.jsx(Ew,{scope:n,isInside:!0,children:h.jsx(lx,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Xh.displayName=Kn;var ep="TooltipArrow",Cw=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=bs(n);return Sw(ep,n).isInside?null:h.jsx(ji,{...o,...r,ref:t})});Cw.displayName=ep;function Aw(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Tw(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Pw(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Mw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],l=t[a],u=i.x,f=i.y,d=l.x,p=l.y;f>r!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(o=!o)}return o}function _w(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Nw(t)}function Nw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ow=Wh,Iw=Gh,Dw=Yh,Lw=Qh,jw=Xh,kw=Ow,Fw=Iw,$w=Dw,Hw=Lw,tp=jw;const Bw=kw,Vw=Fw,Zw=$w,np=c.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(tp,{ref:r,sideOffset:t,className:ae("z-50","overflow-hidden","px-3","py-1.5","text-xs","font-bold","bg-elevated","text-fg-secondary","border","border-border-subtle","shadow-sm","rounded-[8px]","animate-in","fade-in-0","zoom-in-95","data-[state=closed]:animate-out","data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",e),...n}));np.displayName=tp.displayName;const d5=({content:e,children:t,side:n="top",delayDuration:r=200})=>h.jsx(Bw,{children:h.jsxs(Vw,{delayDuration:r,children:[h.jsx(Zw,{asChild:!0,children:t}),h.jsx(Hw,{children:h.jsx(np,{side:n,children:e})})]})}),wl=({children:e,fallback:t})=>e||t;function Uw({children:e}){return h.jsx("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:e})}const xs=28,Wi=[xs,50,100];function qw(e){return Wi.includes(e)}function zw({itemsPerPage:e,onItemsPerPageChange:t,sortBy:n,onSortByChange:r,sortOrder:o,onSortOrderChange:s,pinnedFirst:a,onPinnedFirstChange:i}){return h.jsx("div",{className:"flex justify-end",children:h.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Kd,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),h.jsx(yo,{value:String(e),onValueChange:l=>{const u=Number(l);qw(u)&&t(u)},variant:"ghost",size:"sm",children:Wi.map(l=>h.jsx(Fn,{value:String(l),children:l===xs?`Default (${l})`:l},l))})]}),h.jsx("div",{className:"h-5 w-px bg-divider"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Yv,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),h.jsxs(yo,{value:n,onValueChange:l=>r(l),variant:"ghost",size:"sm",children:[h.jsx(Fn,{value:"updatedAt",children:"Updated"}),h.jsx(Fn,{value:"createdAt",children:"Created"})]}),h.jsxs(yo,{value:o,onValueChange:l=>s(l),variant:"ghost",size:"sm",children:[h.jsx(Fn,{value:"desc",children:"Newest"}),h.jsx(Fn,{value:"asc",children:"Oldest"})]})]}),h.jsx("div",{className:"h-5 w-px bg-divider"}),h.jsxs(uh,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[h.jsx(kf,{id:"pinnedFirst",size:"sm",checked:a,onChange:l=>i(l.target.checked)}),h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}var Js,El;function Kw(){if(El)return Js;El=1;function e(i){return i&&typeof i=="object"&&"default"in i?i.default:i}var t=a1(),n=e(t);function r(i,l,u){return l in i?Object.defineProperty(i,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[l]=u,i}function o(i,l){i.prototype=Object.create(l.prototype),i.prototype.constructor=i,i.__proto__=l}var s=!!(typeof window<"u"&&window.document&&window.document.createElement);function a(i,l,u){if(typeof i!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof l!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof u<"u"&&typeof u!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function f(d){return d.displayName||d.name||"Component"}return function(p){if(typeof p!="function")throw new Error("Expected WrappedComponent to be a React component.");var m=[],v;function g(){v=i(m.map(function(b){return b.props})),y.canUseDOM?l(v):u&&(v=u(v))}var y=(function(b){o(x,b);function x(){return b.apply(this,arguments)||this}x.peek=function(){return v},x.rewind=function(){if(x.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var T=v;return v=void 0,m=[],T};var w=x.prototype;return w.UNSAFE_componentWillMount=function(){m.push(this),g()},w.componentDidUpdate=function(){g()},w.componentWillUnmount=function(){var T=m.indexOf(this);m.splice(T,1),g()},w.render=function(){return n.createElement(p,this.props)},x})(t.PureComponent);return r(y,"displayName","SideEffect("+f(p)+")"),r(y,"canUseDOM",s),y}}return Js=a,Js}var Ww=Kw();const Gw=Ir(Ww);var ea,Sl;function Yw(){if(Sl)return ea;Sl=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(s,a){if(s===a)return!0;if(s&&a&&typeof s=="object"&&typeof a=="object"){if(s.constructor!==a.constructor)return!1;var i,l,u;if(Array.isArray(s)){if(i=s.length,i!=a.length)return!1;for(l=i;l--!==0;)if(!o(s[l],a[l]))return!1;return!0}var f;if(t&&s instanceof Map&&a instanceof Map){if(s.size!==a.size)return!1;for(f=s.entries();!(l=f.next()).done;)if(!a.has(l.value[0]))return!1;for(f=s.entries();!(l=f.next()).done;)if(!o(l.value[1],a.get(l.value[0])))return!1;return!0}if(n&&s instanceof Set&&a instanceof Set){if(s.size!==a.size)return!1;for(f=s.entries();!(l=f.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(a)){if(i=s.length,i!=a.length)return!1;for(l=i;l--!==0;)if(s[l]!==a[l])return!1;return!0}if(s.constructor===RegExp)return s.source===a.source&&s.flags===a.flags;if(s.valueOf!==Object.prototype.valueOf&&typeof s.valueOf=="function"&&typeof a.valueOf=="function")return s.valueOf()===a.valueOf();if(s.toString!==Object.prototype.toString&&typeof s.toString=="function"&&typeof a.toString=="function")return s.toString()===a.toString();if(u=Object.keys(s),i=u.length,i!==Object.keys(a).length)return!1;for(l=i;l--!==0;)if(!Object.prototype.hasOwnProperty.call(a,u[l]))return!1;if(e&&s instanceof Element)return!1;for(l=i;l--!==0;)if(!((u[l]==="_owner"||u[l]==="__v"||u[l]==="__o")&&s.$$typeof)&&!o(s[u[l]],a[u[l]]))return!1;return!0}return s!==s&&a!==a}return ea=function(a,i){try{return o(a,i)}catch(l){if((l.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw l}},ea}var Qw=Yw();const Xw=Ir(Qw);var ta,Rl;function Jw(){if(Rl)return ta;Rl=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var a={},i=0;i<10;i++)a["_"+String.fromCharCode(i)]=i;var l=Object.getOwnPropertyNames(a).map(function(f){return a[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ta=o()?Object.assign:function(s,a){for(var i,l=r(s),u,f=1;f<arguments.length;f++){i=Object(arguments[f]);for(var d in i)t.call(i,d)&&(l[d]=i[d]);if(e){u=e(i);for(var p=0;p<u.length;p++)n.call(i,u[p])&&(l[u[p]]=i[u[p]])}}return l},ta}var eE=Jw();const tE=Ir(eE);var fn={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},ne={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(ne).map(function(e){return ne[e]});var we={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},$o={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Pr={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},nE=Object.keys($o).reduce(function(e,t){return e[$o[t]]=t,e},{}),rE=[ne.NOSCRIPT,ne.SCRIPT,ne.STYLE],xt="data-react-helmet",oE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sE=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},aE=(function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),Xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iE=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Cl=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},cE=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Fa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},lE=function(t){var n=Bn(t,ne.TITLE),r=Bn(t,Pr.TITLE_TEMPLATE);if(r&&n)return r.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var o=Bn(t,Pr.DEFAULT_TITLE);return n||o||void 0},uE=function(t){return Bn(t,Pr.ON_CHANGE_CLIENT_STATE)||function(){}},na=function(t,n){return n.filter(function(r){return typeof r[t]<"u"}).map(function(r){return r[t]}).reduce(function(r,o){return Xe({},r,o)},{})},dE=function(t,n){return n.filter(function(r){return typeof r[ne.BASE]<"u"}).map(function(r){return r[ne.BASE]}).reverse().reduce(function(r,o){if(!r.length)for(var s=Object.keys(o),a=0;a<s.length;a++){var i=s[a],l=i.toLowerCase();if(t.indexOf(l)!==-1&&o[l])return r.concat(o)}return r},[])},dr=function(t,n,r){var o={};return r.filter(function(s){return Array.isArray(s[t])?!0:(typeof s[t]<"u"&&mE("Helmet: "+t+' should be of type "Array". Instead found type "'+oE(s[t])+'"'),!1)}).map(function(s){return s[t]}).reverse().reduce(function(s,a){var i={};a.filter(function(p){for(var m=void 0,v=Object.keys(p),g=0;g<v.length;g++){var y=v[g],b=y.toLowerCase();n.indexOf(b)!==-1&&!(m===we.REL&&p[m].toLowerCase()==="canonical")&&!(b===we.REL&&p[b].toLowerCase()==="stylesheet")&&(m=b),n.indexOf(y)!==-1&&(y===we.INNER_HTML||y===we.CSS_TEXT||y===we.ITEM_PROP)&&(m=y)}if(!m||!p[m])return!1;var x=p[m].toLowerCase();return o[m]||(o[m]={}),i[m]||(i[m]={}),o[m][x]?!1:(i[m][x]=!0,!0)}).reverse().forEach(function(p){return s.push(p)});for(var l=Object.keys(i),u=0;u<l.length;u++){var f=l[u],d=tE({},o[f],i[f]);o[f]=d}return s},[]).reverse()},Bn=function(t,n){for(var r=t.length-1;r>=0;r--){var o=t[r];if(o.hasOwnProperty(n))return o[n]}return null},fE=function(t){return{baseTag:dE([we.HREF,we.TARGET],t),bodyAttributes:na(fn.BODY,t),defer:Bn(t,Pr.DEFER),encode:Bn(t,Pr.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:na(fn.HTML,t),linkTags:dr(ne.LINK,[we.REL,we.HREF],t),metaTags:dr(ne.META,[we.NAME,we.CHARSET,we.HTTPEQUIV,we.PROPERTY,we.ITEM_PROP],t),noscriptTags:dr(ne.NOSCRIPT,[we.INNER_HTML],t),onChangeClientState:uE(t),scriptTags:dr(ne.SCRIPT,[we.SRC,we.INNER_HTML],t),styleTags:dr(ne.STYLE,[we.CSS_TEXT],t),title:lE(t),titleAttributes:na(fn.TITLE,t)}},$a=(function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){$a(t)},0)}})(),Al=function(t){return clearTimeout(t)},hE=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||$a:global.requestAnimationFrame||$a,pE=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Al:global.cancelAnimationFrame||Al,mE=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},fr=null,gE=function(t){fr&&pE(fr),t.defer?fr=hE(function(){Tl(t,function(){fr=null})}):(Tl(t),fr=null)},Tl=function(t,n){var r=t.baseTag,o=t.bodyAttributes,s=t.htmlAttributes,a=t.linkTags,i=t.metaTags,l=t.noscriptTags,u=t.onChangeClientState,f=t.scriptTags,d=t.styleTags,p=t.title,m=t.titleAttributes;Ha(ne.BODY,o),Ha(ne.HTML,s),vE(p,m);var v={baseTag:Dn(ne.BASE,r),linkTags:Dn(ne.LINK,a),metaTags:Dn(ne.META,i),noscriptTags:Dn(ne.NOSCRIPT,l),scriptTags:Dn(ne.SCRIPT,f),styleTags:Dn(ne.STYLE,d)},g={},y={};Object.keys(v).forEach(function(b){var x=v[b],w=x.newTags,E=x.oldTags;w.length&&(g[b]=w),E.length&&(y[b]=v[b].oldTags)}),n&&n(),u(t,g,y)},rp=function(t){return Array.isArray(t)?t.join(""):t},vE=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=rp(t)),Ha(ne.TITLE,n)},Ha=function(t,n){var r=document.getElementsByTagName(t)[0];if(r){for(var o=r.getAttribute(xt),s=o?o.split(","):[],a=[].concat(s),i=Object.keys(n),l=0;l<i.length;l++){var u=i[l],f=n[u]||"";r.getAttribute(u)!==f&&r.setAttribute(u,f),s.indexOf(u)===-1&&s.push(u);var d=a.indexOf(u);d!==-1&&a.splice(d,1)}for(var p=a.length-1;p>=0;p--)r.removeAttribute(a[p]);s.length===a.length?r.removeAttribute(xt):r.getAttribute(xt)!==i.join(",")&&r.setAttribute(xt,i.join(","))}},Dn=function(t,n){var r=document.head||document.querySelector(ne.HEAD),o=r.querySelectorAll(t+"["+xt+"]"),s=Array.prototype.slice.call(o),a=[],i=void 0;return n&&n.length&&n.forEach(function(l){var u=document.createElement(t);for(var f in l)if(l.hasOwnProperty(f))if(f===we.INNER_HTML)u.innerHTML=l.innerHTML;else if(f===we.CSS_TEXT)u.styleSheet?u.styleSheet.cssText=l.cssText:u.appendChild(document.createTextNode(l.cssText));else{var d=typeof l[f]>"u"?"":l[f];u.setAttribute(f,d)}u.setAttribute(xt,"true"),s.some(function(p,m){return i=m,u.isEqualNode(p)})?s.splice(i,1):a.push(u)}),s.forEach(function(l){return l.parentNode.removeChild(l)}),a.forEach(function(l){return r.appendChild(l)}),{oldTags:s,newTags:a}},op=function(t){return Object.keys(t).reduce(function(n,r){var o=typeof t[r]<"u"?r+'="'+t[r]+'"':""+r;return n?n+" "+o:o},"")},yE=function(t,n,r,o){var s=op(r),a=rp(n);return s?"<"+t+" "+xt+'="true" '+s+">"+Fa(a,o)+"</"+t+">":"<"+t+" "+xt+'="true">'+Fa(a,o)+"</"+t+">"},bE=function(t,n,r){return n.reduce(function(o,s){var a=Object.keys(s).filter(function(u){return!(u===we.INNER_HTML||u===we.CSS_TEXT)}).reduce(function(u,f){var d=typeof s[f]>"u"?f:f+'="'+Fa(s[f],r)+'"';return u?u+" "+d:d},""),i=s.innerHTML||s.cssText||"",l=rE.indexOf(t)===-1;return o+"<"+t+" "+xt+'="true" '+a+(l?"/>":">"+i+"</"+t+">")},"")},sp=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[$o[o]||o]=t[o],r},n)},xE=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[nE[o]||o]=t[o],r},n)},wE=function(t,n,r){var o,s=(o={key:n},o[xt]=!0,o),a=sp(r,s);return[M.createElement(ne.TITLE,a,n)]},EE=function(t,n){return n.map(function(r,o){var s,a=(s={key:o},s[xt]=!0,s);return Object.keys(r).forEach(function(i){var l=$o[i]||i;if(l===we.INNER_HTML||l===we.CSS_TEXT){var u=r.innerHTML||r.cssText;a.dangerouslySetInnerHTML={__html:u}}else a[l]=r[i]}),M.createElement(t,a)})},jt=function(t,n,r){switch(t){case ne.TITLE:return{toComponent:function(){return wE(t,n.title,n.titleAttributes)},toString:function(){return yE(t,n.title,n.titleAttributes,r)}};case fn.BODY:case fn.HTML:return{toComponent:function(){return sp(n)},toString:function(){return op(n)}};default:return{toComponent:function(){return EE(t,n)},toString:function(){return bE(t,n,r)}}}},ap=function(t){var n=t.baseTag,r=t.bodyAttributes,o=t.encode,s=t.htmlAttributes,a=t.linkTags,i=t.metaTags,l=t.noscriptTags,u=t.scriptTags,f=t.styleTags,d=t.title,p=d===void 0?"":d,m=t.titleAttributes;return{base:jt(ne.BASE,n,o),bodyAttributes:jt(fn.BODY,r,o),htmlAttributes:jt(fn.HTML,s,o),link:jt(ne.LINK,a,o),meta:jt(ne.META,i,o),noscript:jt(ne.NOSCRIPT,l,o),script:jt(ne.SCRIPT,u,o),style:jt(ne.STYLE,f,o),title:jt(ne.TITLE,{title:p,titleAttributes:m},o)}},SE=function(t){var n,r;return r=n=(function(o){iE(s,o);function s(){return sE(this,s),cE(this,o.apply(this,arguments))}return s.prototype.shouldComponentUpdate=function(i){return!Xw(this.props,i)},s.prototype.mapNestedChildrenToProps=function(i,l){if(!l)return null;switch(i.type){case ne.SCRIPT:case ne.NOSCRIPT:return{innerHTML:l};case ne.STYLE:return{cssText:l}}throw new Error("<"+i.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},s.prototype.flattenArrayTypeChildren=function(i){var l,u=i.child,f=i.arrayTypeChildren,d=i.newChildProps,p=i.nestedChildren;return Xe({},f,(l={},l[u.type]=[].concat(f[u.type]||[],[Xe({},d,this.mapNestedChildrenToProps(u,p))]),l))},s.prototype.mapObjectTypeChildren=function(i){var l,u,f=i.child,d=i.newProps,p=i.newChildProps,m=i.nestedChildren;switch(f.type){case ne.TITLE:return Xe({},d,(l={},l[f.type]=m,l.titleAttributes=Xe({},p),l));case ne.BODY:return Xe({},d,{bodyAttributes:Xe({},p)});case ne.HTML:return Xe({},d,{htmlAttributes:Xe({},p)})}return Xe({},d,(u={},u[f.type]=Xe({},p),u))},s.prototype.mapArrayTypeChildrenToProps=function(i,l){var u=Xe({},l);return Object.keys(i).forEach(function(f){var d;u=Xe({},u,(d={},d[f]=i[f],d))}),u},s.prototype.warnOnInvalidChildren=function(i,l){return!0},s.prototype.mapChildrenToProps=function(i,l){var u=this,f={};return M.Children.forEach(i,function(d){if(!(!d||!d.props)){var p=d.props,m=p.children,v=Cl(p,["children"]),g=xE(v);switch(u.warnOnInvalidChildren(d,m),d.type){case ne.LINK:case ne.META:case ne.NOSCRIPT:case ne.SCRIPT:case ne.STYLE:f=u.flattenArrayTypeChildren({child:d,arrayTypeChildren:f,newChildProps:g,nestedChildren:m});break;default:l=u.mapObjectTypeChildren({child:d,newProps:l,newChildProps:g,nestedChildren:m});break}}}),l=this.mapArrayTypeChildrenToProps(f,l),l},s.prototype.render=function(){var i=this.props,l=i.children,u=Cl(i,["children"]),f=Xe({},u);return l&&(f=this.mapChildrenToProps(l,f)),M.createElement(t,f)},aE(s,null,[{key:"canUseDOM",set:function(i){t.canUseDOM=i}}]),s})(M.Component),n.propTypes={base:xe.object,bodyAttributes:xe.object,children:xe.oneOfType([xe.arrayOf(xe.node),xe.node]),defaultTitle:xe.string,defer:xe.bool,encodeSpecialCharacters:xe.bool,htmlAttributes:xe.object,link:xe.arrayOf(xe.object),meta:xe.arrayOf(xe.object),noscript:xe.arrayOf(xe.object),onChangeClientState:xe.func,script:xe.arrayOf(xe.object),style:xe.arrayOf(xe.object),title:xe.string,titleAttributes:xe.object,titleTemplate:xe.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var o=t.rewind();return o||(o=ap({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),o},r},RE=function(){return null},CE=Gw(fE,gE,ap)(RE),Ba=SE(CE);Ba.renderStatic=Ba.rewind;function Pl(e,t){return t==null?h.jsx(se,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",children:e}):typeof t=="string"||typeof t=="number"?h.jsx(se,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",children:t}):h.jsx("div",{role:"heading","aria-level":1,children:t})}function Ml(e){return e==null?null:typeof e=="string"||typeof e=="number"?h.jsx(se,{as:"p",variant:"meta",weight:"medium",tone:"tertiary",className:"mt-1",children:e}):h.jsx("div",{className:"mt-1",children:e})}function ws({title:e,heading:t,variant:n="default",description:r,headerRight:o,children:s}){return h.jsxs(h.Fragment,{children:[h.jsx(Ba,{children:h.jsx("title",{children:e?`${e} | Ocean Brain`:"Ocean Brain"})}),n==="default"&&h.jsx("div",{className:"mb-5 border-b border-border-subtle/80 pb-4",children:h.jsxs("div",{className:o?"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between":void 0,children:[h.jsxs("div",{children:[Pl(e,t),Ml(r)]}),o]})}),n==="subtle"&&h.jsx("div",{className:"mb-6",children:h.jsxs("div",{className:o?"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between":void 0,children:[h.jsxs("div",{children:[Pl(e,t),Ml(r)]}),o]})}),s]})}const AE=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},ra=new Map;function TE(){const e=ts({select:n=>n.pathname}),t=c.useRef(null);return c.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,r=a=>{if(a!==0){ra.set(e,a);return}ra.delete(e)},o=AE(()=>{if(t.current){const{scrollTop:a}=n;r(a)}}),s=ra.get(e);return s&&(n.scrollTop=s),n.addEventListener("scroll",o),()=>{n.removeEventListener("scroll",o)}}},[e]),h.jsx("div",{ref:t,className:"hidden"})}const Kr="/",ip="/views",PE="/views/notes",cp="/calendar",lp="/reminders",up="/graph",dp="/search",fp="/tag",Jn="/$id",Gi="/tag/$id",hp="/setting",ME="/setting/mcp",_E="/setting/trash",NE="/setting/manage-image",OE="/setting/manage-image/$id",IE="/setting/placeholder",DE="/setting/properties",Va="An unexpected routing error occurred.",pp=e=>typeof e=="object"&&e!==null&&"errors"in e&&Array.isArray(e.errors),LE=e=>e instanceof Error?e.message:pp(e)?e.errors?.[0]?.message??Va:Va,jE=e=>{if(pp(e))return e.errors?.[0]?.code};function Yi({title:e,error:t,description:n,onRetry:r,showBackAction:o=!0,showHomeAction:s=!0}){const a=En(),i=Ge(),[l,u]=c.useState("idle"),f=LE(t),d=jE(t),p=async()=>{try{const m=[d,f].filter(Boolean).join(" :: ");await navigator.clipboard.writeText(m||Va),u("copied")}catch{u("failed")}};return h.jsxs("div",{className:"rounded-[18px] border-2 border-border bg-surface p-6",children:[h.jsx(se,{as:"p",variant:"heading",weight:"bold",tracking:"tighter",children:e}),n&&h.jsx(se,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:n}),h.jsxs(se,{as:"div",variant:"body",tone:"secondary",className:"mt-4 rounded-[14px] border border-border-subtle bg-subtle px-3 py-2",children:[f,d&&h.jsxs(se,{as:"span",variant:"body",weight:"bold",tone:"tertiary",className:"ml-2",children:["[",d,"]"]})]}),h.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r&&h.jsx(bt,{size:"sm",onClick:r,children:"Try again"}),o&&h.jsx(bt,{size:"sm",variant:"ghost",onClick:()=>i.history.back(),children:"Go back"}),s&&h.jsx(bt,{size:"sm",variant:"ghost",onClick:()=>a({to:Kr,search:{page:1,limit:xs,sortBy:"updatedAt",sortOrder:"desc",pinnedFirst:!1}}),children:"Go home"}),h.jsx(bt,{size:"sm",variant:"ghost",onClick:p,children:l==="copied"?"Copied details":l==="failed"?"Copy failed":"Copy details"})]})]})}function ke({title:e="Loading page",description:t="Preparing route resources."}){return h.jsx(ws,{title:e,description:t,variant:"none",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsx(Ht,{height:"56px"}),h.jsx(Ht,{height:"220px"}),h.jsx(Ht,{height:"160px"})]})})}function kE({error:e,reset:t}){return h.jsx(ws,{title:"Something went wrong",variant:"none",children:h.jsx(Yi,{title:"Route failed to render",description:"Retry the route or navigate somewhere safe.",error:e,onRetry:t})})}function FE(){return h.jsx(ws,{title:"Not found",variant:"none",children:h.jsxs("div",{className:"rounded-[18px] border-2 border-border bg-surface p-6",children:[h.jsx(se,{as:"p",variant:"heading",weight:"bold",tracking:"tighter",children:"This page does not exist."}),h.jsx(se,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:"Check the URL or navigate from the sidebar."})]})})}const $E=(e=[],t=[])=>e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]));class HE extends c.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error!==null&&$E(t.resetKeys,this.props.resetKeys)&&this.resetErrorBoundary()}resetErrorBoundary=()=>{this.props.onReset?.(),this.setState({error:null})};render(){return this.state.error!==null?this.props.fallbackRender({error:this.state.error,resetErrorBoundary:this.resetErrorBoundary}):this.props.children}}function mp({children:e,fallback:t,errorTitle:n,errorDescription:r,resetKeys:o,renderError:s}){return h.jsx(Dg,{children:({reset:a})=>h.jsx(HE,{onReset:a,resetKeys:o,fallbackRender:({error:i,resetErrorBoundary:l})=>s?s({error:i,retry:l}):h.jsx(Yi,{title:n,description:r,error:i,onRetry:l}),children:h.jsx(c.Suspense,{fallback:t,children:e})})})}const _l=e=>{let t;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(m=>m(t,p))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=t=e(r,o,i);return i},BE=(e=>e?_l(e):_l),VE=e=>e;function ZE(e,t=VE){const n=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(n),n}const Nl=e=>{const t=BE(e),n=r=>ZE(t,r);return Object.assign(n,t),n},UE=(e=>e?Nl(e):Nl),gp="theme",Ol="(prefers-color-scheme: dark)";function qE(e){return e==="light"||e==="dark"}function zE(){return typeof document>"u"?null:document.documentElement}function vp(){return typeof window>"u"?null:window.localStorage}function yp(e){const t=zE();t&&(t.classList.remove("light","dark"),t.classList.add(e))}function Ho(){const e=vp()?.getItem(gp)??null;return qE(e)?e:null}function KE({storedTheme:e,systemPrefersDark:t}){return e||(t?"dark":"light")}function WE(e,t={}){yp(e),t.persist!==!1&&vp()?.setItem(gp,e)}function GE(e={}){const t=e.matchMedia?e.matchMedia(Ol).matches:typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Ol).matches:!1,n=KE({storedTheme:Ho(),systemPrefersDark:t});return yp(n),n}const Il=Ho(),Bo=UE(e=>({explicitTheme:Il,theme:Il??"light",setTheme:t=>{e({explicitTheme:t,theme:t})},setSystemTheme:t=>{e(n=>n.explicitTheme?n:{theme:t})},toggleTheme:()=>{e(t=>{const n=t.theme==="light"?"dark":"light";return{explicitTheme:n,theme:n}})}}));Bo.subscribe(e=>{WE(e.theme,{persist:e.explicitTheme===e.theme})});const YE=()=>null,QE="flex h-full w-full flex-row",XE=ae("fixed","bottom-4","left-4","z-[1003]","flex","h-12","w-12","items-center","justify-center","rounded-[14px]","border","border-border-subtle","bg-surface","text-fg-secondary","shadow-[0_12px_24px_-18px_rgba(0,0,0,0.35)]","transition-all","hover:bg-hover-subtle","hover:text-fg-default","active:translate-y-px","aria-expanded:bg-hover-subtle","aria-expanded:text-fg-default"),JE=ae("fixed","z-[1002]","h-full","w-full","flex-[0_0_300px]","overflow-y-auto","border-r-0","border-border-subtle","bg-[var(--page-bg)]","pb-20","pointer-events-none","-translate-x-full","md:static","md:w-auto","md:translate-x-0","md:border-r","md:pb-0","md:pointer-events-auto"),e3="pointer-events-auto translate-x-0",t3=ae("flex","h-full","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","[scrollbar-gutter:stable]"),n3=ae("sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-md:after:content-['']","max-md:after:pointer-events-none","max-md:after:absolute","max-md:after:inset-y-0","max-md:after:right-0","max-md:after:w-12","max-md:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),r3=ae("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),o3="min-w-0 max-w-full flex-1 overflow-x-clip p-4 max-md:pb-20",s3=({sidebar:e,topNavigation:t,children:n})=>{const r=ts({select:i=>i.pathname}),[o,s]=c.useState(!1),a="site-layout-sidebar";return c.useEffect(()=>{s(!1)},[r]),h.jsxs("div",{className:QE,children:[h.jsx("div",{className:"md:hidden",children:h.jsx("button",{type:"button",className:XE,"aria-label":"Toggle sidebar","aria-controls":a,"aria-expanded":o,onClick:()=>s(i=>!i),children:h.jsx(Kv,{className:"h-6 w-6"})})}),h.jsx("aside",{id:a,className:ae(JE,o&&e3),children:e}),h.jsxs("main",{className:t3,children:[h.jsx("div",{className:n3,children:h.jsx("div",{className:r3,children:t})}),h.jsx("div",{className:o3,children:n}),h.jsx(TE,{})]})]})},a3=e=>({type:"error",category:"graphql",errors:e.map(t=>({code:t.extensions?.code??"GRAPHQL_ERROR",message:t.message??"GraphQL request failed",details:t}))}),i3=e=>{const t=ye.isAxiosError(e)?e.response?.data?.message??e.message??"Network request failed":"Network request failed",n=ye.isAxiosError(e)?e.code??(e.response?.status?`HTTP_${e.response.status}`:"NETWORK_ERROR"):"NETWORK_ERROR",r=ye.isAxiosError(e)?e.response?.data:void 0;return{type:"error",category:"network",errors:[{code:n,message:t,details:r}]}},c3={async execute(e){try{const{data:t}=await ye.post("/graphql",e);return t.errors&&t.errors.length>0?a3(t.errors):t.data?{type:"success",...t.data}:{type:"error",category:"graphql",errors:[{code:"EMPTY_RESPONSE",message:"GraphQL response data is empty",details:t}]}}catch(t){return i3(t)}}},l3={server:c3},u3=()=>l3.server;async function he(e,t,n){const r=typeof e=="string"?{query:e,variables:t,operationName:n}:e;return u3().execute(r)}const bp=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",xp=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),d3=async e=>{try{const t=await he(`
27
+ `,l=e?"cursor-default bg-cta border-cta text-fg-on-filled":t?"cursor-default text-fg-disabled border-transparent":"cursor-pointer text-fg-default hover:bg-hover hover:border-border-subtle",u=n?"relative [&>svg]:absolute [&>svg:first-child]:-translate-x-[3px] [&>svg:last-child]:translate-x-[3px]":"";return h.jsx("button",{ref:a,type:"button",disabled:t,className:`${i} ${l} ${u} ${o}`,...s,children:r})});kn.displayName="PaginationItem";const sx=je(["h-full","transition-all","duration-300","ease-out"],{variants:{color:{primary:"bg-pastel-blue-200",success:"bg-pastel-green-200",danger:"bg-pastel-pink-200",warning:"bg-pastel-orange-200"}},defaultVariants:{color:"primary"}}),ax=c.forwardRef(({value:e,max:t,color:n,className:r="",...o},s)=>{const a=Math.min(100,Math.max(0,e/t*100));return h.jsx("div",{ref:s,className:ae("w-full h-3","bg-surface","border-2 border-border","rounded-[6px]","overflow-hidden",r),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,...o,children:h.jsx("div",{className:`progress-fill ${sx({color:n})}`,style:{"--progress-width":`${a}%`}})})});ax.displayName="Progress";function yl(e,[t,n]){return Math.min(n,Math.max(t,e))}function ix(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fh=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cx="VisuallyHidden",hh=c.forwardRef((e,t)=>h.jsx(re.span,{...e,ref:t,style:{...fh,...e.style}}));hh.displayName=cx;var lx=hh,ux=[" ","Enter","ArrowUp","ArrowDown"],dx=[" ","Enter"],bn="Select",[ms,gs,fx]=_i(bn),[Xn]=Nt(bn,[fx,Qn]),vs=Qn(),[hx,en]=Xn(bn),[px,mx]=Xn(bn),ph=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:p,required:m,form:v}=e,g=vs(t),[y,b]=c.useState(null),[x,w]=c.useState(null),[E,T]=c.useState(!1),O=us(u),[C,S]=Bt({prop:r,defaultProp:o??!1,onChange:s,caller:bn}),[N,I]=Bt({prop:a,defaultProp:i,onChange:l,caller:bn}),P=c.useRef(null),H=y?v||!!y.closest("form"):!0,[z,L]=c.useState(new Set),k=Array.from(z).map(A=>A.props.value).join(";");return h.jsx(Ii,{...g,children:h.jsxs(hx,{required:m,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:T,contentId:Tt(),value:N,onValueChange:I,open:C,onOpenChange:S,dir:O,triggerPointerDownPosRef:P,disabled:p,children:[h.jsx(ms.Provider,{scope:t,children:h.jsx(px,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(A=>{L(D=>new Set(D).add(A))},[]),onNativeOptionRemove:c.useCallback(A=>{L(D=>{const j=new Set(D);return j.delete(A),j})},[]),children:n})}),H?h.jsxs(Ih,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:N,onChange:A=>I(A.target.value),disabled:p,form:v,children:[N===void 0?h.jsx("option",{value:""}):null,Array.from(z)]},k):null]})})};ph.displayName=bn;var mh="SelectTrigger",gh=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=vs(n),a=en(mh,n),i=a.disabled||r,l=le(t,a.onTriggerChange),u=gs(n),f=c.useRef("touch"),[d,p,m]=Lh(g=>{const y=u().filter(w=>!w.disabled),b=y.find(w=>w.value===a.value),x=jh(y,g,b);x!==void 0&&a.onValueChange(x.value)}),v=g=>{i||(a.onOpenChange(!0),m()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return h.jsx(Di,{asChild:!0,...s,children:h.jsx(re.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Dh(a.value)?"":void 0,...o,ref:l,onClick:W(o.onClick,g=>{g.currentTarget.focus(),f.current!=="mouse"&&v(g)}),onPointerDown:W(o.onPointerDown,g=>{f.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:W(o.onKeyDown,g=>{const y=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(y&&g.key===" ")&&ux.includes(g.key)&&(v(),g.preventDefault())})})})});gh.displayName=mh;var vh="SelectValue",yh=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...i}=e,l=en(vh,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,d=le(t,l.onValueNodeChange);return Ve(()=>{u(f)},[u,f]),h.jsx(re.span,{...i,ref:d,style:{pointerEvents:"none"},children:Dh(l.value)?h.jsx(h.Fragment,{children:a}):s})});yh.displayName=vh;var gx="SelectIcon",bh=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return h.jsx(re.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});bh.displayName=gx;var vx="SelectPortal",xh=e=>h.jsx(jr,{asChild:!0,...e});xh.displayName=vx;var xn="SelectContent",wh=c.forwardRef((e,t)=>{const n=en(xn,e.__scopeSelect),[r,o]=c.useState();if(Ve(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?$t.createPortal(h.jsx(Eh,{scope:e.__scopeSelect,children:h.jsx(ms.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),s):null}return h.jsx(Sh,{...e,ref:t})});wh.displayName=xn;var yt=10,[Eh,tn]=Xn(xn),yx="SelectContentImpl",bx=qn("SelectContent.RemoveScroll"),Sh=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:y,...b}=e,x=en(xn,n),[w,E]=c.useState(null),[T,O]=c.useState(null),C=le(t,$=>E($)),[S,N]=c.useState(null),[I,P]=c.useState(null),H=gs(n),[z,L]=c.useState(!1),k=c.useRef(!1);c.useEffect(()=>{if(w)return hi(w)},[w]),fi();const A=c.useCallback($=>{const[F,...ee]=H().map(te=>te.ref.current),[Z]=ee.slice(-1),X=document.activeElement;for(const te of $)if(te===X||(te?.scrollIntoView({block:"nearest"}),te===F&&T&&(T.scrollTop=0),te===Z&&T&&(T.scrollTop=T.scrollHeight),te?.focus(),document.activeElement!==X))return},[H,T]),D=c.useCallback(()=>A([S,w]),[A,S,w]);c.useEffect(()=>{z&&D()},[z,D]);const{onOpenChange:j,triggerPointerDownPosRef:_}=x;c.useEffect(()=>{if(w){let $={x:0,y:0};const F=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(_.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(_.current?.y??0))}},ee=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||j(!1),document.removeEventListener("pointermove",F),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",F),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",ee,{capture:!0})}}},[w,j,_]),c.useEffect(()=>{const $=()=>j(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[j]);const[V,K]=Lh($=>{const F=H().filter(X=>!X.disabled),ee=F.find(X=>X.ref.current===document.activeElement),Z=jh(F,$,ee);Z&&setTimeout(()=>Z.ref.current.focus())}),Y=c.useCallback(($,F,ee)=>{const Z=!k.current&&!ee;(x.value!==void 0&&x.value===F||Z)&&(N($),Z&&(k.current=!0))},[x.value]),B=c.useCallback(()=>w?.focus(),[w]),q=c.useCallback(($,F,ee)=>{const Z=!k.current&&!ee;(x.value!==void 0&&x.value===F||Z)&&P($)},[x.value]),U=r==="popper"?Na:Rh,J=U===Na?{side:i,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:y}:{};return h.jsx(Eh,{scope:n,content:w,viewport:T,onViewportChange:O,itemRefCallback:Y,selectedItem:S,onItemLeave:B,itemTextRefCallback:q,focusSelectedItem:D,selectedItemText:I,position:r,isPositioned:z,searchRef:V,children:h.jsx(Ya,{as:bx,allowPinchZoom:!0,children:h.jsx(ns,{asChild:!0,trapped:x.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:W(o,$=>{x.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:h.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:h.jsx(U,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:$=>$.preventDefault(),...b,...J,onPlaced:()=>L(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:W(b.onKeyDown,$=>{const F=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!F&&$.key.length===1&&K($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=H().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const X=$.target,te=Z.indexOf(X);Z=Z.slice(te+1)}setTimeout(()=>A(Z)),$.preventDefault()}})})})})})})});Sh.displayName=yx;var xx="SelectItemAlignedPosition",Rh=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=en(xn,n),a=tn(xn,n),[i,l]=c.useState(null),[u,f]=c.useState(null),d=le(t,C=>f(C)),p=gs(n),m=c.useRef(!1),v=c.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=a,w=c.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&u&&g&&y&&b){const C=s.trigger.getBoundingClientRect(),S=u.getBoundingClientRect(),N=s.valueNode.getBoundingClientRect(),I=b.getBoundingClientRect();if(s.dir!=="rtl"){const X=I.left-S.left,te=N.left-X,ie=C.left-te,ue=C.width+ie,Qe=Math.max(ue,S.width),Fe=window.innerWidth-yt,qe=yl(te,[yt,Math.max(yt,Fe-Qe)]);i.style.minWidth=ue+"px",i.style.left=qe+"px"}else{const X=S.right-I.right,te=window.innerWidth-N.right-X,ie=window.innerWidth-C.right-te,ue=C.width+ie,Qe=Math.max(ue,S.width),Fe=window.innerWidth-yt,qe=yl(te,[yt,Math.max(yt,Fe-Qe)]);i.style.minWidth=ue+"px",i.style.right=qe+"px"}const P=p(),H=window.innerHeight-yt*2,z=g.scrollHeight,L=window.getComputedStyle(u),k=parseInt(L.borderTopWidth,10),A=parseInt(L.paddingTop,10),D=parseInt(L.borderBottomWidth,10),j=parseInt(L.paddingBottom,10),_=k+A+z+j+D,V=Math.min(y.offsetHeight*5,_),K=window.getComputedStyle(g),Y=parseInt(K.paddingTop,10),B=parseInt(K.paddingBottom,10),q=C.top+C.height/2-yt,U=H-q,J=y.offsetHeight/2,$=y.offsetTop+J,F=k+A+$,ee=_-F;if(F<=q){const X=P.length>0&&y===P[P.length-1].ref.current;i.style.bottom="0px";const te=u.clientHeight-g.offsetTop-g.offsetHeight,ie=Math.max(U,J+(X?B:0)+te+D),ue=F+ie;i.style.height=ue+"px"}else{const X=P.length>0&&y===P[0].ref.current;i.style.top="0px";const ie=Math.max(q,k+g.offsetTop+(X?Y:0)+J)+ee;i.style.height=ie+"px",g.scrollTop=F-q+g.offsetTop}i.style.margin=`${yt}px 0`,i.style.minHeight=V+"px",i.style.maxHeight=H+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,s.trigger,s.valueNode,i,u,g,y,b,s.dir,r]);Ve(()=>w(),[w]);const[E,T]=c.useState();Ve(()=>{u&&T(window.getComputedStyle(u).zIndex)},[u]);const O=c.useCallback(C=>{C&&v.current===!0&&(w(),x?.(),v.current=!1)},[w,x]);return h.jsx(Ex,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:m,onScrollButtonChange:O,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:h.jsx(re.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Rh.displayName=xx;var wx="SelectPopperPosition",Na=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=yt,...s}=e,a=vs(n);return h.jsx(Li,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Na.displayName=wx;var[Ex,Ui]=Xn(xn,{}),Oa="SelectViewport",Ch=c.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=tn(Oa,n),a=Ui(Oa,n),i=le(t,s.onViewportChange),l=c.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(ms.Slot,{scope:n,children:h.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:W(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=a;if(p?.current&&d){const m=Math.abs(l.current-f.scrollTop);if(m>0){const v=window.innerHeight-yt*2,g=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(g,y);if(b<v){const x=b+m,w=Math.min(v,x),E=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Ch.displayName=Oa;var Ah="SelectGroup",[Sx,Rx]=Xn(Ah),Cx=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tt();return h.jsx(Sx,{scope:n,id:o,children:h.jsx(re.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Cx.displayName=Ah;var Th="SelectLabel",Ax=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Rx(Th,n);return h.jsx(re.div,{id:o.id,...r,ref:t})});Ax.displayName=Th;var ko="SelectItem",[Tx,Ph]=Xn(ko),Mh=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,i=en(ko,n),l=tn(ko,n),u=i.value===r,[f,d]=c.useState(s??""),[p,m]=c.useState(!1),v=le(t,x=>l.itemRefCallback?.(x,r,o)),g=Tt(),y=c.useRef("touch"),b=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(Tx,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:c.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:h.jsx(ms.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:h.jsx(re.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:v,onFocus:W(a.onFocus,()=>m(!0)),onBlur:W(a.onBlur,()=>m(!1)),onClick:W(a.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:W(a.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:W(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:W(a.onPointerMove,x=>{y.current=x.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:W(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:W(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(dx.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});Mh.displayName=ko;var pr="SelectItemText",_h=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=en(pr,n),i=tn(pr,n),l=Ph(pr,n),u=mx(pr,n),[f,d]=c.useState(null),p=le(t,b=>d(b),l.onItemTextChange,b=>i.itemTextRefCallback?.(b,l.value,l.disabled)),m=f?.textContent,v=c.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return Ve(()=>(g(v),()=>y(v)),[g,y,v]),h.jsxs(h.Fragment,{children:[h.jsx(re.span,{id:l.textId,...s,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?$t.createPortal(s.children,a.valueNode):null]})});_h.displayName=pr;var Nh="SelectItemIndicator",Px=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ph(Nh,n).isSelected?h.jsx(re.span,{"aria-hidden":!0,...r,ref:t}):null});Px.displayName=Nh;var Ia="SelectScrollUpButton",Mx=c.forwardRef((e,t)=>{const n=tn(Ia,e.__scopeSelect),r=Ui(Ia,e.__scopeSelect),[o,s]=c.useState(!1),a=le(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?h.jsx(Oh,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Mx.displayName=Ia;var Da="SelectScrollDownButton",_x=c.forwardRef((e,t)=>{const n=tn(Da,e.__scopeSelect),r=Ui(Da,e.__scopeSelect),[o,s]=c.useState(!1),a=le(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<u;s(f)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?h.jsx(Oh,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});_x.displayName=Da;var Oh=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=tn("SelectScrollButton",n),a=c.useRef(null),i=gs(n),l=c.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),Ve(()=>{i().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),h.jsx(re.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:W(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:W(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:W(o.onPointerLeave,()=>{l()})})}),Nx="SelectSeparator",Ox=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(re.div,{"aria-hidden":!0,...r,ref:t})});Ox.displayName=Nx;var La="SelectArrow",Ix=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=vs(n),s=en(La,n),a=tn(La,n);return s.open&&a.position==="popper"?h.jsx(ji,{...o,...r,ref:t}):null});Ix.displayName=La;var Dx="SelectBubbleInput",Ih=c.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=c.useRef(null),s=le(r,o),a=ix(t);return c.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(d)}},[a,t]),h.jsx(re.select,{...n,style:{...fh,...n.style},ref:s,defaultValue:t})});Ih.displayName=Dx;function Dh(e){return e===""||e===void 0}function Lh(e){const t=Mt(e),n=c.useRef(""),r=c.useRef(0),o=c.useCallback(a=>{const i=n.current+a;t(i),(function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(i)},[t]),s=c.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function jh(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Lx(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Lx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jx=ph,kx=gh,Fx=yh,$x=bh,Hx=xh,Bx=wh,Vx=Ch,Zx=Mh,Ux=_h,qx=jx,zx=Fx,Kx=kx,Wx=$x,Gx=Hx,Yx=Bx,Qx=Vx,Xx=Zx,Jx=Ux;const ew=je(["inline-flex","items-center","justify-between","gap-2","border","border-border-subtle","bg-elevated","text-fg-default","font-medium","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50","cursor-pointer","whitespace-nowrap"],{variants:{variant:{default:["border-border-subtle"],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"]},size:{sm:"h-8 px-3 text-sm rounded-[12px]",md:"h-9 px-3 text-sm rounded-[14px]",lg:"h-11 px-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),yo=({value:e,defaultValue:t,onValueChange:n,placeholder:r,ariaLabel:o,variant:s,size:a,className:i,children:l,disabled:u})=>h.jsxs(qx,{value:e,defaultValue:t,onValueChange:n,disabled:u,children:[h.jsxs(Kx,{"aria-label":o,className:ew({variant:s,size:a,className:i}),children:[h.jsx(zx,{className:"min-w-0 truncate",placeholder:r}),h.jsx(Wx,{children:h.jsx(Hv,{className:"w-3.5 h-3.5 opacity-60"})})]}),h.jsx(Gx,{children:h.jsx(kh,{children:h.jsx(Qx,{className:"p-1",children:l})})})]}),kh=c.forwardRef(({className:e,children:t,...n},r)=>h.jsx(Yx,{ref:r,position:"popper",sideOffset:4,className:ae("z-[1100]","min-w-[var(--radix-select-trigger-width)]","overflow-hidden","surface-floating","data-[state=open]:animate-fade-in","data-[state=open]:animate-zoom-in",e),...n,children:t}));kh.displayName="SelectContent";const Fn=c.forwardRef(({className:e,children:t,...n},r)=>h.jsx(Xx,{ref:r,className:ae("relative","flex","items-center","cursor-pointer","select-none","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","rounded-[10px]","data-[highlighted]:bg-hover-subtle","data-[highlighted]:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),...n,children:h.jsx(Jx,{children:t})}));Fn.displayName="SelectItem";yo.displayName="Select";const bl=e=>typeof e=="number"?`${e}px`:e,Ht=c.forwardRef(({width:e,height:t=30,opacity:n,className:r="",style:o,...s},a)=>h.jsx("div",{ref:a,className:ae("rounded-[14px]","skeleton-sized","bg-[length:200%_100%]","bg-gradient-to-r","from-pastel-lavender-200/30","via-pastel-yellow-200/20","to-pastel-lavender-200/30","animate-shimmer","animate-fade-in",r),style:{"--skeleton-width":bl(e),"--skeleton-height":bl(t),"--skeleton-opacity":n,...o},...s}));Ht.displayName="Skeleton";const tw=c.forwardRef(({checked:e,onCheckedChange:t,onClick:n,className:r,disabled:o,...s},a)=>h.jsx("button",{ref:a,type:"button",role:"switch","aria-checked":e,disabled:o,className:ae("focus-ring-soft relative inline-flex h-7 w-12 items-center rounded-full border p-1 transition-colors duration-200 outline-none",e?"border-transparent bg-cta hover:bg-cta-hover active:bg-cta-hover":"border-border bg-subtle hover:bg-hover active:bg-active",o&&"cursor-not-allowed opacity-80",r),onClick:i=>{n?.(i),!(i.defaultPrevented||o)&&t?.(!e)},...s,children:h.jsx("span",{"aria-hidden":"true",className:ae("pointer-events-none inline-block h-5 w-5 rounded-full shadow-sm transition-transform duration-200",e?"translate-x-5 bg-white":"translate-x-0 bg-fg-secondary")})}));tw.displayName="Switch";const nw=je(["w-full","border","border-border-subtle","bg-elevated","text-fg-default","placeholder:text-fg-placeholder","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50","resize-none"],{variants:{variant:{default:[],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"],error:["border-border-error","bg-accent-soft-danger/40","text-fg-default"]},size:{sm:"min-h-[60px] p-3 text-sm rounded-[12px]",md:"min-h-[80px] p-3 text-sm rounded-[14px]",lg:"min-h-[100px] p-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),rw=c.forwardRef(({className:e,variant:t,size:n,...r},o)=>h.jsx("textarea",{ref:o,className:nw({variant:t,size:n,className:e}),...r}));rw.displayName="Textarea";var Fh="Toggle",$h=c.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[a,i]=Bt({prop:n,onChange:o,defaultProp:r??!1,caller:Fh});return h.jsx(re.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:W(e.onClick,()=>{e.disabled||i(!a)})})});$h.displayName=Fh;var nn="ToggleGroup",[Hh]=Nt(nn,[ds]),Bh=ds(),qi=M.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return h.jsx(ow,{...o,ref:t})}if(n==="multiple"){const o=r;return h.jsx(sw,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${nn}\``)});qi.displayName=nn;var[Vh,Zh]=Hh(nn),ow=M.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[a,i]=Bt({prop:n,defaultProp:r??"",onChange:o,caller:nn});return h.jsx(Vh,{scope:e.__scopeToggleGroup,type:"single",value:M.useMemo(()=>a?[a]:[],[a]),onItemActivate:i,onItemDeactivate:M.useCallback(()=>i(""),[i]),children:h.jsx(Uh,{...s,ref:t})})}),sw=M.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[a,i]=Bt({prop:n,defaultProp:r??[],onChange:o,caller:nn}),l=M.useCallback(f=>i((d=[])=>[...d,f]),[i]),u=M.useCallback(f=>i((d=[])=>d.filter(p=>p!==f)),[i]);return h.jsx(Vh,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:u,children:h.jsx(Uh,{...s,ref:t})})});qi.displayName=nn;var[aw,iw]=Hh(nn),Uh=M.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:a,loop:i=!0,...l}=e,u=Bh(n),f=us(a),d={role:"group",dir:f,...l};return h.jsx(aw,{scope:n,rovingFocus:o,disabled:r,children:o?h.jsx(d0,{asChild:!0,...u,orientation:s,dir:f,loop:i,children:h.jsx(re.div,{...d,ref:t})}):h.jsx(re.div,{...d,ref:t})})}),Fo="ToggleGroupItem",qh=M.forwardRef((e,t)=>{const n=Zh(Fo,e.__scopeToggleGroup),r=iw(Fo,e.__scopeToggleGroup),o=Bh(e.__scopeToggleGroup),s=n.value.includes(e.value),a=r.disabled||e.disabled,i={...e,pressed:s,disabled:a},l=M.useRef(null);return r.rovingFocus?h.jsx(f0,{asChild:!0,...o,focusable:!a,active:s,ref:l,children:h.jsx(xl,{...i,ref:t})}):h.jsx(xl,{...i,ref:t})});qh.displayName=Fo;var xl=M.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=Zh(Fo,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=s.type==="single"?a:void 0;return h.jsx($h,{...i,...o,ref:t,onPressedChange:l=>{l?s.onItemActivate(r):s.onItemDeactivate(r)}})}),cw=qi,lw=qh,uw=cw,dw=lw;const fw=je(["inline-flex","gap-0.5","overflow-hidden"],{variants:{variant:{default:["border-2","border-border","rounded-[10px]","bg-surface"],outline:["border-2","border-border","rounded-[10px]","bg-transparent"],pills:["surface-base","p-1"],quiet:["rounded-[12px]","border","border-border-subtle/80","bg-hover-subtle/55","p-0.5"]}},defaultVariants:{variant:"default"}}),hw=je(["flex","items-center","justify-center","font-bold","border","border-transparent","transition-colors","duration-200","disabled:pointer-events-none","disabled:opacity-50"],{variants:{variant:{default:["text-fg-muted","hover:bg-hover","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled"],outline:["text-fg-muted","hover:bg-hover-subtle","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled"],pills:["text-fg-secondary","rounded-[10px]","hover:bg-hover-subtle","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled","data-[state=on]:border-border-secondary"],quiet:["rounded-[10px]","font-medium","text-fg-secondary","hover:bg-hover-subtle/80","data-[state=on]:border-border-secondary/70","data-[state=on]:bg-elevated","data-[state=on]:text-fg-default","data-[state=on]:shadow-[0_8px_18px_-16px_rgba(15,18,24,0.28)]"]},size:{sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),zh=c.createContext({}),pw=c.forwardRef(({className:e,variant:t,size:n,children:r,...o},s)=>h.jsx(zh.Provider,{value:{variant:t??"default",size:n??"md"},children:h.jsx(uw,{ref:s,className:fw({variant:t,className:e}),...o,children:r})}));pw.displayName="ToggleGroup";const mw=c.forwardRef(({className:e,activeClassName:t,children:n,...r},o)=>{const s=c.useContext(zh);return h.jsx(dw,{ref:o,className:hw({variant:s.variant,size:s.size,className:ae(e,t)}),...r,children:n})});mw.displayName="ToggleGroupItem";var[ys]=Nt("Tooltip",[Qn]),bs=Qn(),Kh="TooltipProvider",gw=700,ja="tooltip.open",[vw,zi]=ys(Kh),Wh=e=>{const{__scopeTooltip:t,delayDuration:n=gw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,a=c.useRef(!0),i=c.useRef(!1),l=c.useRef(0);return c.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),h.jsx(vw,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:c.useCallback(u=>{i.current=u},[]),disableHoverableContent:o,children:s})};Wh.displayName=Kh;var Tr="Tooltip",[yw,zr]=ys(Tr),Gh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,l=zi(Tr,e.__scopeTooltip),u=bs(t),[f,d]=c.useState(null),p=Tt(),m=c.useRef(0),v=a??l.disableHoverableContent,g=i??l.delayDuration,y=c.useRef(!1),[b,x]=Bt({prop:r,defaultProp:o??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(ja))):l.onClose(),s?.(C)},caller:Tr}),w=c.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),E=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),T=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),O=c.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},g)},[g,x]);return c.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),h.jsx(Ii,{...u,children:h.jsx(yw,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:f,onTriggerChange:d,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayedRef.current?O():E()},[l.isOpenDelayedRef,O,E]),onTriggerLeave:c.useCallback(()=>{v?T():(window.clearTimeout(m.current),m.current=0)},[T,v]),onOpen:E,onClose:T,disableHoverableContent:v,children:n})})};Gh.displayName=Tr;var ka="TooltipTrigger",Yh=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zr(ka,n),s=zi(ka,n),a=bs(n),i=c.useRef(null),l=le(t,i,o.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),d=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(Di,{asChild:!0,...a,children:h.jsx(re.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:W(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:W(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:W(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:W(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:W(e.onBlur,o.onClose),onClick:W(e.onClick,o.onClose)})})});Yh.displayName=ka;var Ki="TooltipPortal",[bw,xw]=ys(Ki,{forceMount:void 0}),Qh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=zr(Ki,t);return h.jsx(bw,{scope:t,forceMount:n,children:h.jsx(Ot,{present:n||s.open,children:h.jsx(jr,{asChild:!0,container:o,children:r})})})};Qh.displayName=Ki;var Kn="TooltipContent",Xh=c.forwardRef((e,t)=>{const n=xw(Kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,a=zr(Kn,e.__scopeTooltip);return h.jsx(Ot,{present:r||a.open,children:a.disableHoverableContent?h.jsx(Jh,{side:o,...s,ref:t}):h.jsx(ww,{side:o,...s,ref:t})})}),ww=c.forwardRef((e,t)=>{const n=zr(Kn,e.__scopeTooltip),r=zi(Kn,e.__scopeTooltip),o=c.useRef(null),s=le(t,o),[a,i]=c.useState(null),{trigger:l,onClose:u}=n,f=o.current,{onPointerInTransitChange:d}=r,p=c.useCallback(()=>{i(null),d(!1)},[d]),m=c.useCallback((v,g)=>{const y=v.currentTarget,b={x:v.clientX,y:v.clientY},x=Aw(b,y.getBoundingClientRect()),w=Tw(b,x),E=Pw(g.getBoundingClientRect()),T=_w([...w,...E]);i(T),d(!0)},[d]);return c.useEffect(()=>()=>p(),[p]),c.useEffect(()=>{if(l&&f){const v=y=>m(y,f),g=y=>m(y,l);return l.addEventListener("pointerleave",v),f.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",g)}}},[l,f,m,p]),c.useEffect(()=>{if(a){const v=g=>{const y=g.target,b={x:g.clientX,y:g.clientY},x=l?.contains(y)||f?.contains(y),w=!Mw(b,a);x?p():w&&(p(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,f,a,u,p]),h.jsx(Jh,{...e,ref:s})}),[Ew,Sw]=ys(Tr,{isInside:!1}),Rw=Hu("TooltipContent"),Jh=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,l=zr(Kn,n),u=bs(n),{onClose:f}=l;return c.useEffect(()=>(document.addEventListener(ja,f),()=>document.removeEventListener(ja,f)),[f]),c.useEffect(()=>{if(l.trigger){const d=p=>{p.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),h.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:h.jsxs(Li,{"data-state":l.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Rw,{children:r}),h.jsx(Ew,{scope:n,isInside:!0,children:h.jsx(lx,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Xh.displayName=Kn;var ep="TooltipArrow",Cw=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=bs(n);return Sw(ep,n).isInside?null:h.jsx(ji,{...o,...r,ref:t})});Cw.displayName=ep;function Aw(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Tw(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Pw(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Mw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],l=t[a],u=i.x,f=i.y,d=l.x,p=l.y;f>r!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(o=!o)}return o}function _w(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Nw(t)}function Nw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ow=Wh,Iw=Gh,Dw=Yh,Lw=Qh,jw=Xh,kw=Ow,Fw=Iw,$w=Dw,Hw=Lw,tp=jw;const Bw=kw,Vw=Fw,Zw=$w,np=c.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(tp,{ref:r,sideOffset:t,className:ae("z-50","overflow-hidden","px-3","py-1.5","text-xs","font-bold","bg-elevated","text-fg-secondary","border","border-border-subtle","shadow-sm","rounded-[8px]","animate-in","fade-in-0","zoom-in-95","data-[state=closed]:animate-out","data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",e),...n}));np.displayName=tp.displayName;const f5=({content:e,children:t,side:n="top",delayDuration:r=200})=>h.jsx(Bw,{children:h.jsxs(Vw,{delayDuration:r,children:[h.jsx(Zw,{asChild:!0,children:t}),h.jsx(Hw,{children:h.jsx(np,{side:n,children:e})})]})}),wl=({children:e,fallback:t})=>e||t;function Uw({children:e}){return h.jsx("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:e})}const xs=28,Wi=[xs,50,100];function qw(e){return Wi.includes(e)}function zw({itemsPerPage:e,onItemsPerPageChange:t,sortBy:n,onSortByChange:r,sortOrder:o,onSortOrderChange:s,pinnedFirst:a,onPinnedFirstChange:i}){return h.jsx("div",{className:"flex justify-end",children:h.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Kd,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),h.jsx(yo,{value:String(e),onValueChange:l=>{const u=Number(l);qw(u)&&t(u)},variant:"ghost",size:"sm",children:Wi.map(l=>h.jsx(Fn,{value:String(l),children:l===xs?`Default (${l})`:l},l))})]}),h.jsx("div",{className:"h-5 w-px bg-divider"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Yv,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),h.jsxs(yo,{value:n,onValueChange:l=>r(l),variant:"ghost",size:"sm",children:[h.jsx(Fn,{value:"updatedAt",children:"Updated"}),h.jsx(Fn,{value:"createdAt",children:"Created"})]}),h.jsxs(yo,{value:o,onValueChange:l=>s(l),variant:"ghost",size:"sm",children:[h.jsx(Fn,{value:"desc",children:"Newest"}),h.jsx(Fn,{value:"asc",children:"Oldest"})]})]}),h.jsx("div",{className:"h-5 w-px bg-divider"}),h.jsxs(uh,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[h.jsx(kf,{id:"pinnedFirst",size:"sm",checked:a,onChange:l=>i(l.target.checked)}),h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}var Js,El;function Kw(){if(El)return Js;El=1;function e(i){return i&&typeof i=="object"&&"default"in i?i.default:i}var t=a1(),n=e(t);function r(i,l,u){return l in i?Object.defineProperty(i,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[l]=u,i}function o(i,l){i.prototype=Object.create(l.prototype),i.prototype.constructor=i,i.__proto__=l}var s=!!(typeof window<"u"&&window.document&&window.document.createElement);function a(i,l,u){if(typeof i!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof l!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof u<"u"&&typeof u!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function f(d){return d.displayName||d.name||"Component"}return function(p){if(typeof p!="function")throw new Error("Expected WrappedComponent to be a React component.");var m=[],v;function g(){v=i(m.map(function(b){return b.props})),y.canUseDOM?l(v):u&&(v=u(v))}var y=(function(b){o(x,b);function x(){return b.apply(this,arguments)||this}x.peek=function(){return v},x.rewind=function(){if(x.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var T=v;return v=void 0,m=[],T};var w=x.prototype;return w.UNSAFE_componentWillMount=function(){m.push(this),g()},w.componentDidUpdate=function(){g()},w.componentWillUnmount=function(){var T=m.indexOf(this);m.splice(T,1),g()},w.render=function(){return n.createElement(p,this.props)},x})(t.PureComponent);return r(y,"displayName","SideEffect("+f(p)+")"),r(y,"canUseDOM",s),y}}return Js=a,Js}var Ww=Kw();const Gw=Ir(Ww);var ea,Sl;function Yw(){if(Sl)return ea;Sl=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(s,a){if(s===a)return!0;if(s&&a&&typeof s=="object"&&typeof a=="object"){if(s.constructor!==a.constructor)return!1;var i,l,u;if(Array.isArray(s)){if(i=s.length,i!=a.length)return!1;for(l=i;l--!==0;)if(!o(s[l],a[l]))return!1;return!0}var f;if(t&&s instanceof Map&&a instanceof Map){if(s.size!==a.size)return!1;for(f=s.entries();!(l=f.next()).done;)if(!a.has(l.value[0]))return!1;for(f=s.entries();!(l=f.next()).done;)if(!o(l.value[1],a.get(l.value[0])))return!1;return!0}if(n&&s instanceof Set&&a instanceof Set){if(s.size!==a.size)return!1;for(f=s.entries();!(l=f.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(a)){if(i=s.length,i!=a.length)return!1;for(l=i;l--!==0;)if(s[l]!==a[l])return!1;return!0}if(s.constructor===RegExp)return s.source===a.source&&s.flags===a.flags;if(s.valueOf!==Object.prototype.valueOf&&typeof s.valueOf=="function"&&typeof a.valueOf=="function")return s.valueOf()===a.valueOf();if(s.toString!==Object.prototype.toString&&typeof s.toString=="function"&&typeof a.toString=="function")return s.toString()===a.toString();if(u=Object.keys(s),i=u.length,i!==Object.keys(a).length)return!1;for(l=i;l--!==0;)if(!Object.prototype.hasOwnProperty.call(a,u[l]))return!1;if(e&&s instanceof Element)return!1;for(l=i;l--!==0;)if(!((u[l]==="_owner"||u[l]==="__v"||u[l]==="__o")&&s.$$typeof)&&!o(s[u[l]],a[u[l]]))return!1;return!0}return s!==s&&a!==a}return ea=function(a,i){try{return o(a,i)}catch(l){if((l.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw l}},ea}var Qw=Yw();const Xw=Ir(Qw);var ta,Rl;function Jw(){if(Rl)return ta;Rl=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var a={},i=0;i<10;i++)a["_"+String.fromCharCode(i)]=i;var l=Object.getOwnPropertyNames(a).map(function(f){return a[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ta=o()?Object.assign:function(s,a){for(var i,l=r(s),u,f=1;f<arguments.length;f++){i=Object(arguments[f]);for(var d in i)t.call(i,d)&&(l[d]=i[d]);if(e){u=e(i);for(var p=0;p<u.length;p++)n.call(i,u[p])&&(l[u[p]]=i[u[p]])}}return l},ta}var eE=Jw();const tE=Ir(eE);var fn={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},ne={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(ne).map(function(e){return ne[e]});var we={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},$o={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Pr={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},nE=Object.keys($o).reduce(function(e,t){return e[$o[t]]=t,e},{}),rE=[ne.NOSCRIPT,ne.SCRIPT,ne.STYLE],xt="data-react-helmet",oE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sE=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},aE=(function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),Xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iE=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Cl=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},cE=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Fa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},lE=function(t){var n=Bn(t,ne.TITLE),r=Bn(t,Pr.TITLE_TEMPLATE);if(r&&n)return r.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var o=Bn(t,Pr.DEFAULT_TITLE);return n||o||void 0},uE=function(t){return Bn(t,Pr.ON_CHANGE_CLIENT_STATE)||function(){}},na=function(t,n){return n.filter(function(r){return typeof r[t]<"u"}).map(function(r){return r[t]}).reduce(function(r,o){return Xe({},r,o)},{})},dE=function(t,n){return n.filter(function(r){return typeof r[ne.BASE]<"u"}).map(function(r){return r[ne.BASE]}).reverse().reduce(function(r,o){if(!r.length)for(var s=Object.keys(o),a=0;a<s.length;a++){var i=s[a],l=i.toLowerCase();if(t.indexOf(l)!==-1&&o[l])return r.concat(o)}return r},[])},dr=function(t,n,r){var o={};return r.filter(function(s){return Array.isArray(s[t])?!0:(typeof s[t]<"u"&&mE("Helmet: "+t+' should be of type "Array". Instead found type "'+oE(s[t])+'"'),!1)}).map(function(s){return s[t]}).reverse().reduce(function(s,a){var i={};a.filter(function(p){for(var m=void 0,v=Object.keys(p),g=0;g<v.length;g++){var y=v[g],b=y.toLowerCase();n.indexOf(b)!==-1&&!(m===we.REL&&p[m].toLowerCase()==="canonical")&&!(b===we.REL&&p[b].toLowerCase()==="stylesheet")&&(m=b),n.indexOf(y)!==-1&&(y===we.INNER_HTML||y===we.CSS_TEXT||y===we.ITEM_PROP)&&(m=y)}if(!m||!p[m])return!1;var x=p[m].toLowerCase();return o[m]||(o[m]={}),i[m]||(i[m]={}),o[m][x]?!1:(i[m][x]=!0,!0)}).reverse().forEach(function(p){return s.push(p)});for(var l=Object.keys(i),u=0;u<l.length;u++){var f=l[u],d=tE({},o[f],i[f]);o[f]=d}return s},[]).reverse()},Bn=function(t,n){for(var r=t.length-1;r>=0;r--){var o=t[r];if(o.hasOwnProperty(n))return o[n]}return null},fE=function(t){return{baseTag:dE([we.HREF,we.TARGET],t),bodyAttributes:na(fn.BODY,t),defer:Bn(t,Pr.DEFER),encode:Bn(t,Pr.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:na(fn.HTML,t),linkTags:dr(ne.LINK,[we.REL,we.HREF],t),metaTags:dr(ne.META,[we.NAME,we.CHARSET,we.HTTPEQUIV,we.PROPERTY,we.ITEM_PROP],t),noscriptTags:dr(ne.NOSCRIPT,[we.INNER_HTML],t),onChangeClientState:uE(t),scriptTags:dr(ne.SCRIPT,[we.SRC,we.INNER_HTML],t),styleTags:dr(ne.STYLE,[we.CSS_TEXT],t),title:lE(t),titleAttributes:na(fn.TITLE,t)}},$a=(function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){$a(t)},0)}})(),Al=function(t){return clearTimeout(t)},hE=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||$a:global.requestAnimationFrame||$a,pE=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Al:global.cancelAnimationFrame||Al,mE=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},fr=null,gE=function(t){fr&&pE(fr),t.defer?fr=hE(function(){Tl(t,function(){fr=null})}):(Tl(t),fr=null)},Tl=function(t,n){var r=t.baseTag,o=t.bodyAttributes,s=t.htmlAttributes,a=t.linkTags,i=t.metaTags,l=t.noscriptTags,u=t.onChangeClientState,f=t.scriptTags,d=t.styleTags,p=t.title,m=t.titleAttributes;Ha(ne.BODY,o),Ha(ne.HTML,s),vE(p,m);var v={baseTag:Dn(ne.BASE,r),linkTags:Dn(ne.LINK,a),metaTags:Dn(ne.META,i),noscriptTags:Dn(ne.NOSCRIPT,l),scriptTags:Dn(ne.SCRIPT,f),styleTags:Dn(ne.STYLE,d)},g={},y={};Object.keys(v).forEach(function(b){var x=v[b],w=x.newTags,E=x.oldTags;w.length&&(g[b]=w),E.length&&(y[b]=v[b].oldTags)}),n&&n(),u(t,g,y)},rp=function(t){return Array.isArray(t)?t.join(""):t},vE=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=rp(t)),Ha(ne.TITLE,n)},Ha=function(t,n){var r=document.getElementsByTagName(t)[0];if(r){for(var o=r.getAttribute(xt),s=o?o.split(","):[],a=[].concat(s),i=Object.keys(n),l=0;l<i.length;l++){var u=i[l],f=n[u]||"";r.getAttribute(u)!==f&&r.setAttribute(u,f),s.indexOf(u)===-1&&s.push(u);var d=a.indexOf(u);d!==-1&&a.splice(d,1)}for(var p=a.length-1;p>=0;p--)r.removeAttribute(a[p]);s.length===a.length?r.removeAttribute(xt):r.getAttribute(xt)!==i.join(",")&&r.setAttribute(xt,i.join(","))}},Dn=function(t,n){var r=document.head||document.querySelector(ne.HEAD),o=r.querySelectorAll(t+"["+xt+"]"),s=Array.prototype.slice.call(o),a=[],i=void 0;return n&&n.length&&n.forEach(function(l){var u=document.createElement(t);for(var f in l)if(l.hasOwnProperty(f))if(f===we.INNER_HTML)u.innerHTML=l.innerHTML;else if(f===we.CSS_TEXT)u.styleSheet?u.styleSheet.cssText=l.cssText:u.appendChild(document.createTextNode(l.cssText));else{var d=typeof l[f]>"u"?"":l[f];u.setAttribute(f,d)}u.setAttribute(xt,"true"),s.some(function(p,m){return i=m,u.isEqualNode(p)})?s.splice(i,1):a.push(u)}),s.forEach(function(l){return l.parentNode.removeChild(l)}),a.forEach(function(l){return r.appendChild(l)}),{oldTags:s,newTags:a}},op=function(t){return Object.keys(t).reduce(function(n,r){var o=typeof t[r]<"u"?r+'="'+t[r]+'"':""+r;return n?n+" "+o:o},"")},yE=function(t,n,r,o){var s=op(r),a=rp(n);return s?"<"+t+" "+xt+'="true" '+s+">"+Fa(a,o)+"</"+t+">":"<"+t+" "+xt+'="true">'+Fa(a,o)+"</"+t+">"},bE=function(t,n,r){return n.reduce(function(o,s){var a=Object.keys(s).filter(function(u){return!(u===we.INNER_HTML||u===we.CSS_TEXT)}).reduce(function(u,f){var d=typeof s[f]>"u"?f:f+'="'+Fa(s[f],r)+'"';return u?u+" "+d:d},""),i=s.innerHTML||s.cssText||"",l=rE.indexOf(t)===-1;return o+"<"+t+" "+xt+'="true" '+a+(l?"/>":">"+i+"</"+t+">")},"")},sp=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[$o[o]||o]=t[o],r},n)},xE=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[nE[o]||o]=t[o],r},n)},wE=function(t,n,r){var o,s=(o={key:n},o[xt]=!0,o),a=sp(r,s);return[M.createElement(ne.TITLE,a,n)]},EE=function(t,n){return n.map(function(r,o){var s,a=(s={key:o},s[xt]=!0,s);return Object.keys(r).forEach(function(i){var l=$o[i]||i;if(l===we.INNER_HTML||l===we.CSS_TEXT){var u=r.innerHTML||r.cssText;a.dangerouslySetInnerHTML={__html:u}}else a[l]=r[i]}),M.createElement(t,a)})},jt=function(t,n,r){switch(t){case ne.TITLE:return{toComponent:function(){return wE(t,n.title,n.titleAttributes)},toString:function(){return yE(t,n.title,n.titleAttributes,r)}};case fn.BODY:case fn.HTML:return{toComponent:function(){return sp(n)},toString:function(){return op(n)}};default:return{toComponent:function(){return EE(t,n)},toString:function(){return bE(t,n,r)}}}},ap=function(t){var n=t.baseTag,r=t.bodyAttributes,o=t.encode,s=t.htmlAttributes,a=t.linkTags,i=t.metaTags,l=t.noscriptTags,u=t.scriptTags,f=t.styleTags,d=t.title,p=d===void 0?"":d,m=t.titleAttributes;return{base:jt(ne.BASE,n,o),bodyAttributes:jt(fn.BODY,r,o),htmlAttributes:jt(fn.HTML,s,o),link:jt(ne.LINK,a,o),meta:jt(ne.META,i,o),noscript:jt(ne.NOSCRIPT,l,o),script:jt(ne.SCRIPT,u,o),style:jt(ne.STYLE,f,o),title:jt(ne.TITLE,{title:p,titleAttributes:m},o)}},SE=function(t){var n,r;return r=n=(function(o){iE(s,o);function s(){return sE(this,s),cE(this,o.apply(this,arguments))}return s.prototype.shouldComponentUpdate=function(i){return!Xw(this.props,i)},s.prototype.mapNestedChildrenToProps=function(i,l){if(!l)return null;switch(i.type){case ne.SCRIPT:case ne.NOSCRIPT:return{innerHTML:l};case ne.STYLE:return{cssText:l}}throw new Error("<"+i.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},s.prototype.flattenArrayTypeChildren=function(i){var l,u=i.child,f=i.arrayTypeChildren,d=i.newChildProps,p=i.nestedChildren;return Xe({},f,(l={},l[u.type]=[].concat(f[u.type]||[],[Xe({},d,this.mapNestedChildrenToProps(u,p))]),l))},s.prototype.mapObjectTypeChildren=function(i){var l,u,f=i.child,d=i.newProps,p=i.newChildProps,m=i.nestedChildren;switch(f.type){case ne.TITLE:return Xe({},d,(l={},l[f.type]=m,l.titleAttributes=Xe({},p),l));case ne.BODY:return Xe({},d,{bodyAttributes:Xe({},p)});case ne.HTML:return Xe({},d,{htmlAttributes:Xe({},p)})}return Xe({},d,(u={},u[f.type]=Xe({},p),u))},s.prototype.mapArrayTypeChildrenToProps=function(i,l){var u=Xe({},l);return Object.keys(i).forEach(function(f){var d;u=Xe({},u,(d={},d[f]=i[f],d))}),u},s.prototype.warnOnInvalidChildren=function(i,l){return!0},s.prototype.mapChildrenToProps=function(i,l){var u=this,f={};return M.Children.forEach(i,function(d){if(!(!d||!d.props)){var p=d.props,m=p.children,v=Cl(p,["children"]),g=xE(v);switch(u.warnOnInvalidChildren(d,m),d.type){case ne.LINK:case ne.META:case ne.NOSCRIPT:case ne.SCRIPT:case ne.STYLE:f=u.flattenArrayTypeChildren({child:d,arrayTypeChildren:f,newChildProps:g,nestedChildren:m});break;default:l=u.mapObjectTypeChildren({child:d,newProps:l,newChildProps:g,nestedChildren:m});break}}}),l=this.mapArrayTypeChildrenToProps(f,l),l},s.prototype.render=function(){var i=this.props,l=i.children,u=Cl(i,["children"]),f=Xe({},u);return l&&(f=this.mapChildrenToProps(l,f)),M.createElement(t,f)},aE(s,null,[{key:"canUseDOM",set:function(i){t.canUseDOM=i}}]),s})(M.Component),n.propTypes={base:xe.object,bodyAttributes:xe.object,children:xe.oneOfType([xe.arrayOf(xe.node),xe.node]),defaultTitle:xe.string,defer:xe.bool,encodeSpecialCharacters:xe.bool,htmlAttributes:xe.object,link:xe.arrayOf(xe.object),meta:xe.arrayOf(xe.object),noscript:xe.arrayOf(xe.object),onChangeClientState:xe.func,script:xe.arrayOf(xe.object),style:xe.arrayOf(xe.object),title:xe.string,titleAttributes:xe.object,titleTemplate:xe.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var o=t.rewind();return o||(o=ap({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),o},r},RE=function(){return null},CE=Gw(fE,gE,ap)(RE),Ba=SE(CE);Ba.renderStatic=Ba.rewind;function Pl(e,t){return t==null?h.jsx(se,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",children:e}):typeof t=="string"||typeof t=="number"?h.jsx(se,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",children:t}):h.jsx("div",{role:"heading","aria-level":1,children:t})}function Ml(e){return e==null?null:typeof e=="string"||typeof e=="number"?h.jsx(se,{as:"p",variant:"meta",weight:"medium",tone:"tertiary",className:"mt-1",children:e}):h.jsx("div",{className:"mt-1",children:e})}function ws({title:e,heading:t,variant:n="default",description:r,headerRight:o,children:s}){return h.jsxs(h.Fragment,{children:[h.jsx(Ba,{children:h.jsx("title",{children:e?`${e} | Ocean Brain`:"Ocean Brain"})}),n==="default"&&h.jsx("div",{className:"mb-5 border-b border-border-subtle/80 pb-4",children:h.jsxs("div",{className:o?"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between":void 0,children:[h.jsxs("div",{children:[Pl(e,t),Ml(r)]}),o]})}),n==="subtle"&&h.jsx("div",{className:"mb-6",children:h.jsxs("div",{className:o?"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between":void 0,children:[h.jsxs("div",{children:[Pl(e,t),Ml(r)]}),o]})}),s]})}const AE=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},ra=new Map;function TE(){const e=ts({select:n=>n.pathname}),t=c.useRef(null);return c.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,r=a=>{if(a!==0){ra.set(e,a);return}ra.delete(e)},o=AE(()=>{if(t.current){const{scrollTop:a}=n;r(a)}}),s=ra.get(e);return s&&(n.scrollTop=s),n.addEventListener("scroll",o),()=>{n.removeEventListener("scroll",o)}}},[e]),h.jsx("div",{ref:t,className:"hidden"})}const Kr="/",ip="/views",PE="/views/notes",cp="/calendar",lp="/reminders",up="/graph",dp="/search",fp="/tag",Jn="/$id",Gi="/tag/$id",hp="/setting",ME="/setting/mcp",_E="/setting/trash",NE="/setting/manage-image",OE="/setting/manage-image/$id",IE="/setting/placeholder",DE="/setting/properties",Va="An unexpected routing error occurred.",pp=e=>typeof e=="object"&&e!==null&&"errors"in e&&Array.isArray(e.errors),LE=e=>e instanceof Error?e.message:pp(e)?e.errors?.[0]?.message??Va:Va,jE=e=>{if(pp(e))return e.errors?.[0]?.code};function Yi({title:e,error:t,description:n,onRetry:r,showBackAction:o=!0,showHomeAction:s=!0}){const a=En(),i=Ge(),[l,u]=c.useState("idle"),f=LE(t),d=jE(t),p=async()=>{try{const m=[d,f].filter(Boolean).join(" :: ");await navigator.clipboard.writeText(m||Va),u("copied")}catch{u("failed")}};return h.jsxs("div",{className:"rounded-[18px] border-2 border-border bg-surface p-6",children:[h.jsx(se,{as:"p",variant:"heading",weight:"bold",tracking:"tighter",children:e}),n&&h.jsx(se,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:n}),h.jsxs(se,{as:"div",variant:"body",tone:"secondary",className:"mt-4 rounded-[14px] border border-border-subtle bg-subtle px-3 py-2",children:[f,d&&h.jsxs(se,{as:"span",variant:"body",weight:"bold",tone:"tertiary",className:"ml-2",children:["[",d,"]"]})]}),h.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r&&h.jsx(bt,{size:"sm",onClick:r,children:"Try again"}),o&&h.jsx(bt,{size:"sm",variant:"ghost",onClick:()=>i.history.back(),children:"Go back"}),s&&h.jsx(bt,{size:"sm",variant:"ghost",onClick:()=>a({to:Kr,search:{page:1,limit:xs,sortBy:"updatedAt",sortOrder:"desc",pinnedFirst:!1}}),children:"Go home"}),h.jsx(bt,{size:"sm",variant:"ghost",onClick:p,children:l==="copied"?"Copied details":l==="failed"?"Copy failed":"Copy details"})]})]})}function ke({title:e="Loading page",description:t="Preparing route resources."}){return h.jsx(ws,{title:e,description:t,variant:"none",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsx(Ht,{height:"56px"}),h.jsx(Ht,{height:"220px"}),h.jsx(Ht,{height:"160px"})]})})}function kE({error:e,reset:t}){return h.jsx(ws,{title:"Something went wrong",variant:"none",children:h.jsx(Yi,{title:"Route failed to render",description:"Retry the route or navigate somewhere safe.",error:e,onRetry:t})})}function FE(){return h.jsx(ws,{title:"Not found",variant:"none",children:h.jsxs("div",{className:"rounded-[18px] border-2 border-border bg-surface p-6",children:[h.jsx(se,{as:"p",variant:"heading",weight:"bold",tracking:"tighter",children:"This page does not exist."}),h.jsx(se,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:"Check the URL or navigate from the sidebar."})]})})}const $E=(e=[],t=[])=>e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]));class HE extends c.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error!==null&&$E(t.resetKeys,this.props.resetKeys)&&this.resetErrorBoundary()}resetErrorBoundary=()=>{this.props.onReset?.(),this.setState({error:null})};render(){return this.state.error!==null?this.props.fallbackRender({error:this.state.error,resetErrorBoundary:this.resetErrorBoundary}):this.props.children}}function mp({children:e,fallback:t,errorTitle:n,errorDescription:r,resetKeys:o,renderError:s}){return h.jsx(Dg,{children:({reset:a})=>h.jsx(HE,{onReset:a,resetKeys:o,fallbackRender:({error:i,resetErrorBoundary:l})=>s?s({error:i,retry:l}):h.jsx(Yi,{title:n,description:r,error:i,onRetry:l}),children:h.jsx(c.Suspense,{fallback:t,children:e})})})}const _l=e=>{let t;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(m=>m(t,p))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=t=e(r,o,i);return i},BE=(e=>e?_l(e):_l),VE=e=>e;function ZE(e,t=VE){const n=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(n),n}const Nl=e=>{const t=BE(e),n=r=>ZE(t,r);return Object.assign(n,t),n},UE=(e=>e?Nl(e):Nl),gp="theme",Ol="(prefers-color-scheme: dark)";function qE(e){return e==="light"||e==="dark"}function zE(){return typeof document>"u"?null:document.documentElement}function vp(){return typeof window>"u"?null:window.localStorage}function yp(e){const t=zE();t&&(t.classList.remove("light","dark"),t.classList.add(e))}function Ho(){const e=vp()?.getItem(gp)??null;return qE(e)?e:null}function KE({storedTheme:e,systemPrefersDark:t}){return e||(t?"dark":"light")}function WE(e,t={}){yp(e),t.persist!==!1&&vp()?.setItem(gp,e)}function GE(e={}){const t=e.matchMedia?e.matchMedia(Ol).matches:typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Ol).matches:!1,n=KE({storedTheme:Ho(),systemPrefersDark:t});return yp(n),n}const Il=Ho(),Bo=UE(e=>({explicitTheme:Il,theme:Il??"light",setTheme:t=>{e({explicitTheme:t,theme:t})},setSystemTheme:t=>{e(n=>n.explicitTheme?n:{theme:t})},toggleTheme:()=>{e(t=>{const n=t.theme==="light"?"dark":"light";return{explicitTheme:n,theme:n}})}}));Bo.subscribe(e=>{WE(e.theme,{persist:e.explicitTheme===e.theme})});const YE=()=>null,QE="flex h-dvh min-h-0 w-full flex-row overflow-hidden",XE=ae("fixed","bottom-4","left-4","z-[1003]","flex","h-12","w-12","items-center","justify-center","rounded-[14px]","border","border-border-subtle","bg-surface","text-fg-secondary","shadow-[0_12px_24px_-18px_rgba(0,0,0,0.35)]","transition-all","hover:bg-hover-subtle","hover:text-fg-default","active:translate-y-px","aria-expanded:bg-hover-subtle","aria-expanded:text-fg-default"),JE=ae("fixed","z-[1002]","h-full","w-full","flex-[0_0_300px]","overflow-y-auto","border-r-0","border-border-subtle","bg-[var(--page-bg)]","pb-20","md:static","md:w-auto","md:translate-x-0","md:border-r","md:pb-0","md:pointer-events-auto"),e3="pointer-events-none -translate-x-full",t3="pointer-events-auto translate-x-0",n3=ae("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","overscroll-contain","[scrollbar-gutter:stable]"),r3=ae("sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-md:after:content-['']","max-md:after:pointer-events-none","max-md:after:absolute","max-md:after:inset-y-0","max-md:after:right-0","max-md:after:w-12","max-md:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),o3=ae("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),s3=ae("min-h-0","min-w-0","max-w-full","flex-1","overflow-x-clip","px-4","pt-4","pb-4","max-md:pb-[calc(6rem+env(safe-area-inset-bottom))]"),a3=({sidebar:e,topNavigation:t,children:n})=>{const r=ts({select:i=>i.pathname}),[o,s]=c.useState(!1),a="site-layout-sidebar";return c.useEffect(()=>{s(!1)},[r]),h.jsxs("div",{className:QE,children:[h.jsx("div",{className:"md:hidden",children:h.jsx("button",{type:"button",className:XE,"aria-label":"Toggle sidebar","aria-controls":a,"aria-expanded":o,onClick:()=>s(i=>!i),children:h.jsx(Kv,{className:"h-6 w-6"})})}),h.jsx("aside",{id:a,className:ae(JE,o?t3:e3),children:e}),h.jsxs("main",{className:n3,children:[h.jsx("div",{className:r3,children:h.jsx("div",{className:o3,children:t})}),h.jsx("div",{className:s3,children:n}),h.jsx(TE,{})]})]})},i3=e=>({type:"error",category:"graphql",errors:e.map(t=>({code:t.extensions?.code??"GRAPHQL_ERROR",message:t.message??"GraphQL request failed",details:t}))}),c3=e=>{const t=ye.isAxiosError(e)?e.response?.data?.message??e.message??"Network request failed":"Network request failed",n=ye.isAxiosError(e)?e.code??(e.response?.status?`HTTP_${e.response.status}`:"NETWORK_ERROR"):"NETWORK_ERROR",r=ye.isAxiosError(e)?e.response?.data:void 0;return{type:"error",category:"network",errors:[{code:n,message:t,details:r}]}},l3={async execute(e){try{const{data:t}=await ye.post("/graphql",e);return t.errors&&t.errors.length>0?i3(t.errors):t.data?{type:"success",...t.data}:{type:"error",category:"graphql",errors:[{code:"EMPTY_RESPONSE",message:"GraphQL response data is empty",details:t}]}}catch(t){return c3(t)}}},u3={server:l3},d3=()=>u3.server;async function he(e,t,n){const r=typeof e=="string"?{query:e,variables:t,operationName:n}:e;return d3().execute(r)}const bp=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",xp=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),f3=async e=>{try{const t=await he(`
28
28
  query GetServerCache($key: String!) {
29
29
  cache(key: $key) {
30
30
  value
31
31
  }
32
32
  }
33
- `,{key:e});if(t.type==="error")throw t;if(!bp(t.cache))throw xp("cache",t);return t.cache.value}catch{return""}},f3=async(e,t)=>{const n=await he(`
33
+ `,{key:e});if(t.type==="error")throw t;if(!bp(t.cache))throw xp("cache",t);return t.cache.value}catch{return""}},h3=async(e,t)=>{const n=await he(`
34
34
  mutation SetServerCache($key: String!, $value: String!) {
35
35
  setCache(key: $key, value: $value) {
36
36
  value
37
37
  }
38
38
  }
39
- `,{key:e,value:encodeURIComponent(t)});return n.type==="error"?n:bp(n.setCache)?{...n,setCache:n.setCache}:xp("setCache",n)},h3=()=>{const e=sf(),t=cf(),n=Gn(),{data:r}=Vg({queryKey:ve.ui.heroBanner(),async queryFn(){return d3("heroBanner")}});return r?h.jsx("div",{className:"p-3 pb-0",children:h.jsxs("button",{type:"button","aria-label":"Remove hero banner",className:"surface-base focus-ring-soft group relative block w-full overflow-hidden text-left outline-none",onClick:async()=>{if(await e("Remove this hero banner from the sidebar?")){const o=await f3("heroBanner","");if(o.type==="error"){t(o.errors[0]?.message??"Failed to remove hero banner");return}await n.invalidateQueries({queryKey:ve.ui.heroBanner(),exact:!0})}},children:[h.jsx("img",{alt:"Studio atmosphere banner",className:"w-full object-cover transition duration-500 group-hover:scale-[1.01] group-hover:opacity-90 dark:brightness-[0.85] dark:saturate-[0.9]",src:r}),h.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(180deg,rgba(18,24,34,0.1),rgba(18,24,34,0.38))] opacity-0 transition-opacity duration-300 group-hover:opacity-100"}),h.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 flex items-end justify-between gap-3 p-3",children:h.jsx(se,{as:"span",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",className:"rounded-[12px] border border-white/14 bg-black/16 px-2.5 py-2 text-white/80 opacity-0 backdrop-blur-sm transition-opacity duration-300 group-hover:opacity-100",children:"Remove"})})]})}):null},p3=new Set(["content","order","layout","properties"]),m3=`query FetchNotes(
39
+ `,{key:e,value:encodeURIComponent(t)});return n.type==="error"?n:bp(n.setCache)?{...n,setCache:n.setCache}:xp("setCache",n)},p3=()=>{const e=sf(),t=cf(),n=Gn(),{data:r}=Vg({queryKey:ve.ui.heroBanner(),async queryFn(){return f3("heroBanner")}});return r?h.jsx("div",{className:"p-3 pb-0",children:h.jsxs("button",{type:"button","aria-label":"Remove hero banner",className:"surface-base focus-ring-soft group relative block w-full overflow-hidden text-left outline-none",onClick:async()=>{if(await e("Remove this hero banner from the sidebar?")){const o=await h3("heroBanner","");if(o.type==="error"){t(o.errors[0]?.message??"Failed to remove hero banner");return}await n.invalidateQueries({queryKey:ve.ui.heroBanner(),exact:!0})}},children:[h.jsx("img",{alt:"Studio atmosphere banner",className:"w-full object-cover transition duration-500 group-hover:scale-[1.01] group-hover:opacity-90 dark:brightness-[0.85] dark:saturate-[0.9]",src:r}),h.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(180deg,rgba(18,24,34,0.1),rgba(18,24,34,0.38))] opacity-0 transition-opacity duration-300 group-hover:opacity-100"}),h.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 flex items-end justify-between gap-3 p-3",children:h.jsx(se,{as:"span",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",className:"rounded-[12px] border border-white/14 bg-black/16 px-2.5 py-2 text-white/80 opacity-0 backdrop-blur-sm transition-opacity duration-300 group-hover:opacity-100",children:"Remove"})})]})}):null},m3=new Set(["content","order","layout","properties"]),g3=`query FetchNotes(
40
40
  $searchFilter: SearchFilterInput,
41
41
  $pagination: PaginationInput
42
42
  ) {
@@ -57,7 +57,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
57
57
  }
58
58
  }
59
59
  }
60
- }`,g3=e=>{if(!e||e.length===0)return"";const t=Array.from(new Set(e.filter(n=>p3.has(n))));return t.length===0?"":t.map(n=>n==="properties"?` properties {
60
+ }`,v3=e=>{if(!e||e.length===0)return"";const t=Array.from(new Set(e.filter(n=>m3.has(n))));return t.length===0?"":t.map(n=>n==="properties"?` properties {
61
61
  key
62
62
  name
63
63
  value
@@ -67,7 +67,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
67
67
  updatedAt
68
68
  }`:" "+n).join(`
69
69
  `)+`
70
- `};function wp({limit:e=25,offset:t=0,query:n="",sortBy:r,sortOrder:o,pinnedFirst:s,fields:a}={}){const i=g3(a),l=m3.replace("__NOTE_ADDITIONAL_FIELDS__",i);return he(l,{searchFilter:{query:n,sortBy:r,sortOrder:o,pinnedFirst:s},pagination:{limit:e,offset:t}})}function f5({query:e="",limit:t=25,offset:n=0}={}){return he(`query FetchTagNotes(
70
+ `};function wp({limit:e=25,offset:t=0,query:n="",sortBy:r,sortOrder:o,pinnedFirst:s,fields:a}={}){const i=v3(a),l=g3.replace("__NOTE_ADDITIONAL_FIELDS__",i);return he(l,{searchFilter:{query:n,sortBy:r,sortOrder:o,pinnedFirst:s},pagination:{limit:e,offset:t}})}function h5({query:e="",limit:t=25,offset:n=0}={}){return he(`query FetchTagNotes(
71
71
  $searchFilter: SearchFilterInput,
72
72
  $pagination: PaginationInput
73
73
  ) {
@@ -88,7 +88,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
88
88
  updatedAt
89
89
  }
90
90
  }
91
- }`,{searchFilter:{query:e},pagination:{limit:t,offset:n}})}function h5(e){return he(`query FetchNote($id: ID!) {
91
+ }`,{searchFilter:{query:e},pagination:{limit:t,offset:n}})}function p5(e){return he(`query FetchNote($id: ID!) {
92
92
  note(id: $id) {
93
93
  title
94
94
  pinned
@@ -106,19 +106,19 @@ __NOTE_ADDITIONAL_FIELDS__ id
106
106
  updatedAt
107
107
  }
108
108
  }
109
- }`,{id:e})}function v3(e){return he(`query FetchBackReferences($id: ID!) {
109
+ }`,{id:e})}function y3(e){return he(`query FetchBackReferences($id: ID!) {
110
110
  backReferences(id: $id) {
111
111
  id
112
112
  title
113
113
  }
114
- }`,{id:e})}function p5(e){return he(`query FetchImageNotes($src: String!) {
114
+ }`,{id:e})}function m5(e){return he(`query FetchImageNotes($src: String!) {
115
115
  imageNotes(src: $src) {
116
116
  id
117
117
  title
118
118
  createdAt
119
119
  updatedAt
120
120
  }
121
- }`,{src:e})}function m5({query:e="",limit:t=50,offset:n=0}={}){return he(`query FetchNotePropertyKeys($query: String, $pagination: PaginationInput) {
121
+ }`,{src:e})}function g5({query:e="",limit:t=50,offset:n=0}={}){return he(`query FetchNotePropertyKeys($query: String, $pagination: PaginationInput) {
122
122
  notePropertyKeys(query: $query, pagination: $pagination) {
123
123
  totalCount
124
124
  keys {
@@ -130,7 +130,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
130
130
  updatedAt
131
131
  }
132
132
  }
133
- }`,{...e?{query:e}:{},pagination:{limit:t,offset:n}})}function g5(e){return he(`mutation CreateNotePropertyKey($input: NotePropertyDefinitionInput!) {
133
+ }`,{...e?{query:e}:{},pagination:{limit:t,offset:n}})}function v5(e){return he(`mutation CreateNotePropertyKey($input: NotePropertyDefinitionInput!) {
134
134
  createNotePropertyKey(input: $input) {
135
135
  key
136
136
  name
@@ -139,7 +139,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
139
139
  options { id label value color order }
140
140
  updatedAt
141
141
  }
142
- }`,{input:e})}function v5({key:e,...t}){return he(`mutation UpdateNotePropertyKey($key: String!, $input: NotePropertyDefinitionUpdateInput!) {
142
+ }`,{input:e})}function y5({key:e,...t}){return he(`mutation UpdateNotePropertyKey($key: String!, $input: NotePropertyDefinitionUpdateInput!) {
143
143
  updateNotePropertyKey(key: $key, input: $input) {
144
144
  key
145
145
  name
@@ -148,7 +148,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
148
148
  options { id label value color order }
149
149
  updatedAt
150
150
  }
151
- }`,{key:e,input:t})}function y5({key:e,confirmImpact:t}){return he(`mutation DeleteNotePropertyKey($key: String!, $confirmImpact: Boolean) {
151
+ }`,{key:e,input:t})}function b5({key:e,confirmImpact:t}){return he(`mutation DeleteNotePropertyKey($key: String!, $confirmImpact: Boolean) {
152
152
  deleteNotePropertyKey(key: $key, confirmImpact: $confirmImpact) {
153
153
  key
154
154
  name
@@ -156,11 +156,11 @@ __NOTE_ADDITIONAL_FIELDS__ id
156
156
  affectedNoteCount
157
157
  deleted
158
158
  }
159
- }`,{key:e,...t?{confirmImpact:!0}:{}})}function y3(e){return he(`mutation CreateNote($note: NoteInput!) {
159
+ }`,{key:e,...t?{confirmImpact:!0}:{}})}function b3(e){return he(`mutation CreateNote($note: NoteInput!) {
160
160
  createNote(note: $note) {
161
161
  id
162
162
  }
163
- }`,{note:e})}function b5({id:e,set:t=[],deleteKeys:n=[],editSessionId:r,expectedUpdatedAt:o,force:s}){return he(`mutation UpdateNoteProperties(
163
+ }`,{note:e})}function x5({id:e,set:t=[],deleteKeys:n=[],editSessionId:r,expectedUpdatedAt:o,force:s}){return he(`mutation UpdateNoteProperties(
164
164
  $id: ID!,
165
165
  $patch: NotePropertiesPatchInput!,
166
166
  $editSessionId: String,
@@ -186,13 +186,13 @@ __NOTE_ADDITIONAL_FIELDS__ id
186
186
  updatedAt
187
187
  }
188
188
  }
189
- }`,{id:e,patch:{...t.length>0?{set:t}:{},...n.length>0?{deleteKeys:n}:{}},...r?{editSessionId:r}:{},expectedUpdatedAt:o,...s?{force:!0}:{}})}const x5=({id:e,editSessionId:t,expectedUpdatedAt:n,force:r,...o})=>he(`mutation UpdateNote($id: ID!, $note: NoteInput!, $editSessionId: String, $expectedUpdatedAt: String, $force: Boolean) {
189
+ }`,{id:e,patch:{...t.length>0?{set:t}:{},...n.length>0?{deleteKeys:n}:{}},...r?{editSessionId:r}:{},expectedUpdatedAt:o,...s?{force:!0}:{}})}const w5=({id:e,editSessionId:t,expectedUpdatedAt:n,force:r,...o})=>he(`mutation UpdateNote($id: ID!, $note: NoteInput!, $editSessionId: String, $expectedUpdatedAt: String, $force: Boolean) {
190
190
  updateNote(id: $id, note: $note, editSessionId: $editSessionId, expectedUpdatedAt: $expectedUpdatedAt, force: $force) {
191
191
  id
192
192
  title
193
193
  updatedAt
194
194
  }
195
- }`,{id:e,note:o,...t?{editSessionId:t}:{},...n?{expectedUpdatedAt:n}:{},...r?{force:!0}:{}});function w5(e,t=10){return he(`query FetchNoteSnapshots($id: ID!, $limit: Int) {
195
+ }`,{id:e,note:o,...t?{editSessionId:t}:{},...n?{expectedUpdatedAt:n}:{},...r?{force:!0}:{}});function E5(e,t=10){return he(`query FetchNoteSnapshots($id: ID!, $limit: Int) {
196
196
  noteSnapshots(id: $id, limit: $limit) {
197
197
  id
198
198
  title
@@ -203,7 +203,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
203
203
  label
204
204
  }
205
205
  }
206
- }`,{id:e,limit:t})}function E5(e){return he(`query FetchNoteSnapshot($id: ID!) {
206
+ }`,{id:e,limit:t})}function S5(e){return he(`query FetchNoteSnapshot($id: ID!) {
207
207
  noteSnapshot(id: $id) {
208
208
  id
209
209
  title
@@ -215,7 +215,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
215
215
  label
216
216
  }
217
217
  }
218
- }`,{id:e})}function S5(e,t="current"){return he(`query FetchNoteSnapshotDiff($id: ID!, $target: NoteSnapshotDiffTarget, $contextLines: Int) {
218
+ }`,{id:e})}function R5(e,t="current"){return he(`query FetchNoteSnapshotDiff($id: ID!, $target: NoteSnapshotDiffTarget, $contextLines: Int) {
219
219
  noteSnapshotDiff(id: $id, target: $target, contextLines: $contextLines) {
220
220
  noteId
221
221
  mode
@@ -249,7 +249,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
249
249
  afterMarkdownSha256
250
250
  }
251
251
  }
252
- }`,{id:e,target:t.toUpperCase(),contextLines:3})}function R5(e){return he(`mutation RestoreNoteSnapshot($id: ID!) {
252
+ }`,{id:e,target:t.toUpperCase(),contextLines:3})}function C5(e){return he(`mutation RestoreNoteSnapshot($id: ID!) {
253
253
  restoreNoteSnapshot(id: $id) {
254
254
  id
255
255
  title
@@ -258,7 +258,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
258
258
  content
259
259
  updatedAt
260
260
  }
261
- }`,{id:e})}function C5({limit:e=25,offset:t=0}={}){return he(`query FetchTrashedNotes($pagination: PaginationInput) {
261
+ }`,{id:e})}function A5({limit:e=25,offset:t=0}={}){return he(`query FetchTrashedNotes($pagination: PaginationInput) {
262
262
  trashedNotes(pagination: $pagination) {
263
263
  totalCount
264
264
  notes {
@@ -274,7 +274,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
274
274
  tagNames
275
275
  }
276
276
  }
277
- }`,{pagination:{limit:e,offset:t}})}function A5(e){return he(`query FetchTrashedNote($id: ID!) {
277
+ }`,{pagination:{limit:e,offset:t}})}function T5(e){return he(`query FetchTrashedNote($id: ID!) {
278
278
  trashedNote(id: $id) {
279
279
  id
280
280
  title
@@ -288,7 +288,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
288
288
  layout
289
289
  tagNames
290
290
  }
291
- }`,{id:e})}function T5(e){return he(`mutation RestoreTrashedNote($id: ID!) {
291
+ }`,{id:e})}function P5(e){return he(`mutation RestoreTrashedNote($id: ID!) {
292
292
  restoreTrashedNote(id: $id) {
293
293
  id
294
294
  title
@@ -297,9 +297,9 @@ __NOTE_ADDITIONAL_FIELDS__ id
297
297
  content
298
298
  updatedAt
299
299
  }
300
- }`,{id:e})}function P5(e){return he(`mutation PurgeTrashedNote($id: ID!) {
300
+ }`,{id:e})}function M5(e){return he(`mutation PurgeTrashedNote($id: ID!) {
301
301
  purgeTrashedNote(id: $id)
302
- }`,{id:e})}function b3(e,t){return he(`mutation PinNote($id: ID!, $pinned: Boolean!) {
302
+ }`,{id:e})}function x3(e,t){return he(`mutation PinNote($id: ID!, $pinned: Boolean!) {
303
303
  pinNote(id: $id, pinned: $pinned) {
304
304
  id
305
305
  title
@@ -307,14 +307,14 @@ __NOTE_ADDITIONAL_FIELDS__ id
307
307
  createdAt
308
308
  updatedAt
309
309
  }
310
- }`,{id:e,pinned:t})}function x3(e){return he(`mutation DeleteNote($id: ID!) {
310
+ }`,{id:e,pinned:t})}function w3(e){return he(`mutation DeleteNote($id: ID!) {
311
311
  deleteNote(id: $id)
312
- }`,{id:e})}function w3(e){return he(`mutation ReorderNotes($notes: [NoteOrderInput!]!) {
312
+ }`,{id:e})}function E3(e){return he(`mutation ReorderNotes($notes: [NoteOrderInput!]!) {
313
313
  reorderNotes(notes: $notes) {
314
314
  id
315
315
  order
316
316
  }
317
- }`,{notes:e})}function M5(){return he(`query FetchNoteGraph {
317
+ }`,{notes:e})}function _5(){return he(`query FetchNoteGraph {
318
318
  noteGraph {
319
319
  nodes {
320
320
  id
@@ -326,11 +326,11 @@ __NOTE_ADDITIONAL_FIELDS__ id
326
326
  target
327
327
  }
328
328
  }
329
- }`)}const Za=6e4,ao=6e4,Ln=(e,t)=>`${e} ${t}${e===1?"":"s"} ago`;function Ep(e,t=Date.now()){const n=new Date(e),r=Math.max(0,Math.floor((t-n.getTime())/1e3));let o=Math.floor(r/31536e3);return o>=1?Ln(o,"year"):(o=Math.floor(r/2592e3),o>=1?Ln(o,"month"):(o=Math.floor(r/86400),o>=1?Ln(o,"day"):(o=Math.floor(r/3600),o>=1?Ln(o,"hour"):(o=Math.floor(r/60),o>=1?Ln(o,"minute"):Ln(Math.floor(r),"second")))))}function _5(e,t=Date.now()){return e===null||t-e<Za?"just now":Ep(e,t)}function N5(e,t=Date.now()){if(e===null)return ao;const n=Math.max(0,t-e);if(n<Za)return Za-n;const r=n%ao;return r===0?ao:ao-r}function E3({id:e,title:t,tags:n,pinned:r,updatedAt:o,onPinned:s,onDelete:a}){const i=Ep(Number(o));return h.jsxs("div",{className:ae("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[r&&h.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:h.jsxs("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-secondary/70 bg-elevated text-fg-tertiary shadow-[0_8px_18px_-14px_rgba(23,29,38,0.32)]",children:[h.jsx(Xd,{className:"h-3.5 w-3.5",weight:"fill"}),h.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),h.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[h.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:h.jsxs(se,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),h.jsx(X4,{button:h.jsx(ox,{label:"Note actions",size:"sm"}),items:[{name:r?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>a?.()}]})]}),h.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[h.jsx(se,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:h.jsx(Pt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Jn,params:{id:e},children:t||"Untitled"})}),n.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(l=>h.jsx(Pt,{to:Gi,params:{id:l.id},search:{page:1},children:h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:l.name})},l.id))})]})]})]},e)}function S3({isOpen:e,title:t,description:n,references:r,confirmLabel:o,onClose:s,onConfirm:a,confirmVariant:i="primary",isConfirming:l=!1}){return h.jsxs(Ft,{isOpen:e,onClose:s,variant:"inspect",children:[h.jsx(Ft.Header,{title:t,onClose:s}),h.jsx(Ft.Body,{children:h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(Ft.Description,{className:"text-meta font-normal text-fg-secondary",children:n}),h.jsxs("div",{className:"overflow-hidden rounded-[16px] border border-border-subtle bg-hover-subtle/40",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border-subtle px-4 py-3",children:[h.jsx(se,{as:"p",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:"Referenced notes"}),h.jsxs(se,{as:"p",variant:"label",tone:"tertiary",children:[r.length," ",r.length===1?"note":"notes"]})]}),h.jsx("ul",{className:"flex flex-col",children:r.map((u,f)=>h.jsx("li",{className:f>0?"border-t border-border-subtle":void 0,children:h.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[h.jsx(se,{as:"p",variant:"body",weight:"medium",className:"min-w-0 flex-1 break-words",children:u.title||"Untitled note"}),h.jsx(bt,{asChild:!0,variant:"ghost",size:"sm",className:"self-start sm:self-auto",children:h.jsx(Pt,{to:Jn,params:{id:u.id},children:"Open note"})})]})},u.id))})]})]})}),h.jsx(Ft.Footer,{children:h.jsxs(Uw,{children:[h.jsx(bt,{variant:"ghost",size:"sm",onClick:s,disabled:l,children:"Cancel"}),h.jsx(bt,{variant:i,size:"sm",onClick:a,isLoading:l,children:o})]})})]})}var bo={exports:{}},R3=bo.exports,Dl;function C3(){return Dl||(Dl=1,(function(e,t){(function(n,r){e.exports=r()})(R3,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",a="second",i="minute",l="hour",u="day",f="week",d="month",p="quarter",m="year",v="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var k=["th","st","nd","rd"],A=L%100;return"["+L+(k[(A-20)%10]||k[A]||k[0])+"]"}},w=function(L,k,A){var D=String(L);return!D||D.length>=k?L:""+Array(k+1-D.length).join(A)+L},E={s:w,z:function(L){var k=-L.utcOffset(),A=Math.abs(k),D=Math.floor(A/60),j=A%60;return(k<=0?"+":"-")+w(D,2,"0")+":"+w(j,2,"0")},m:function L(k,A){if(k.date()<A.date())return-L(A,k);var D=12*(A.year()-k.year())+(A.month()-k.month()),j=k.clone().add(D,d),_=A-j<0,V=k.clone().add(D+(_?-1:1),d);return+(-(D+(A-j)/(_?j-V:V-j))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:d,y:m,w:f,d:u,D:v,h:l,m:i,s:a,ms:s,Q:p}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},T="en",O={};O[T]=x;var C="$isDayjsObject",S=function(L){return L instanceof H||!(!L||!L[C])},N=function L(k,A,D){var j;if(!k)return T;if(typeof k=="string"){var _=k.toLowerCase();O[_]&&(j=_),A&&(O[_]=A,j=_);var V=k.split("-");if(!j&&V.length>1)return L(V[0])}else{var K=k.name;O[K]=k,j=K}return!D&&j&&(T=j),j||!D&&T},I=function(L,k){if(S(L))return L.clone();var A=typeof k=="object"?k:{};return A.date=L,A.args=arguments,new H(A)},P=E;P.l=N,P.i=S,P.w=function(L,k){return I(L,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var H=(function(){function L(A){this.$L=N(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[C]=!0}var k=L.prototype;return k.parse=function(A){this.$d=(function(D){var j=D.date,_=D.utc;if(j===null)return new Date(NaN);if(P.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var V=j.match(y);if(V){var K=V[2]-1||0,Y=(V[7]||"0").substring(0,3);return _?new Date(Date.UTC(V[1],K,V[3]||1,V[4]||0,V[5]||0,V[6]||0,Y)):new Date(V[1],K,V[3]||1,V[4]||0,V[5]||0,V[6]||0,Y)}}return new Date(j)})(A),this.init()},k.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},k.$utils=function(){return P},k.isValid=function(){return this.$d.toString()!==g},k.isSame=function(A,D){var j=I(A);return this.startOf(D)<=j&&j<=this.endOf(D)},k.isAfter=function(A,D){return I(A)<this.startOf(D)},k.isBefore=function(A,D){return this.endOf(D)<I(A)},k.$g=function(A,D,j){return P.u(A)?this[D]:this.set(j,A)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(A,D){var j=this,_=!!P.u(D)||D,V=P.p(A),K=function(ee,Z){var X=P.w(j.$u?Date.UTC(j.$y,Z,ee):new Date(j.$y,Z,ee),j);return _?X:X.endOf(u)},Y=function(ee,Z){return P.w(j.toDate()[ee].apply(j.toDate("s"),(_?[0,0,0,0]:[23,59,59,999]).slice(Z)),j)},B=this.$W,q=this.$M,U=this.$D,J="set"+(this.$u?"UTC":"");switch(V){case m:return _?K(1,0):K(31,11);case d:return _?K(1,q):K(0,q+1);case f:var $=this.$locale().weekStart||0,F=(B<$?B+7:B)-$;return K(_?U-F:U+(6-F),q);case u:case v:return Y(J+"Hours",0);case l:return Y(J+"Minutes",1);case i:return Y(J+"Seconds",2);case a:return Y(J+"Milliseconds",3);default:return this.clone()}},k.endOf=function(A){return this.startOf(A,!1)},k.$set=function(A,D){var j,_=P.p(A),V="set"+(this.$u?"UTC":""),K=(j={},j[u]=V+"Date",j[v]=V+"Date",j[d]=V+"Month",j[m]=V+"FullYear",j[l]=V+"Hours",j[i]=V+"Minutes",j[a]=V+"Seconds",j[s]=V+"Milliseconds",j)[_],Y=_===u?this.$D+(D-this.$W):D;if(_===d||_===m){var B=this.clone().set(v,1);B.$d[K](Y),B.init(),this.$d=B.set(v,Math.min(this.$D,B.daysInMonth())).$d}else K&&this.$d[K](Y);return this.init(),this},k.set=function(A,D){return this.clone().$set(A,D)},k.get=function(A){return this[P.p(A)]()},k.add=function(A,D){var j,_=this;A=Number(A);var V=P.p(D),K=function(q){var U=I(_);return P.w(U.date(U.date()+Math.round(q*A)),_)};if(V===d)return this.set(d,this.$M+A);if(V===m)return this.set(m,this.$y+A);if(V===u)return K(1);if(V===f)return K(7);var Y=(j={},j[i]=r,j[l]=o,j[a]=n,j)[V]||1,B=this.$d.getTime()+A*Y;return P.w(B,this)},k.subtract=function(A,D){return this.add(-1*A,D)},k.format=function(A){var D=this,j=this.$locale();if(!this.isValid())return j.invalidDate||g;var _=A||"YYYY-MM-DDTHH:mm:ssZ",V=P.z(this),K=this.$H,Y=this.$m,B=this.$M,q=j.weekdays,U=j.months,J=j.meridiem,$=function(Z,X,te,ie){return Z&&(Z[X]||Z(D,_))||te[X].slice(0,ie)},F=function(Z){return P.s(K%12||12,Z,"0")},ee=J||function(Z,X,te){var ie=Z<12?"AM":"PM";return te?ie.toLowerCase():ie};return _.replace(b,(function(Z,X){return X||(function(te){switch(te){case"YY":return String(D.$y).slice(-2);case"YYYY":return P.s(D.$y,4,"0");case"M":return B+1;case"MM":return P.s(B+1,2,"0");case"MMM":return $(j.monthsShort,B,U,3);case"MMMM":return $(U,B);case"D":return D.$D;case"DD":return P.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return $(j.weekdaysMin,D.$W,q,2);case"ddd":return $(j.weekdaysShort,D.$W,q,3);case"dddd":return q[D.$W];case"H":return String(K);case"HH":return P.s(K,2,"0");case"h":return F(1);case"hh":return F(2);case"a":return ee(K,Y,!0);case"A":return ee(K,Y,!1);case"m":return String(Y);case"mm":return P.s(Y,2,"0");case"s":return String(D.$s);case"ss":return P.s(D.$s,2,"0");case"SSS":return P.s(D.$ms,3,"0");case"Z":return V}return null})(Z)||V.replace(":","")}))},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(A,D,j){var _,V=this,K=P.p(D),Y=I(A),B=(Y.utcOffset()-this.utcOffset())*r,q=this-Y,U=function(){return P.m(V,Y)};switch(K){case m:_=U()/12;break;case d:_=U();break;case p:_=U()/3;break;case f:_=(q-B)/6048e5;break;case u:_=(q-B)/864e5;break;case l:_=q/o;break;case i:_=q/r;break;case a:_=q/n;break;default:_=q}return j?_:P.a(_)},k.daysInMonth=function(){return this.endOf(d).$D},k.$locale=function(){return O[this.$L]},k.locale=function(A,D){if(!A)return this.$L;var j=this.clone(),_=N(A,D,!0);return _&&(j.$L=_),j},k.clone=function(){return P.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},L})(),z=H.prototype;return I.prototype=z,[["$ms",s],["$s",a],["$m",i],["$H",l],["$W",u],["$M",d],["$y",m],["$D",v]].forEach((function(L){z[L[1]]=function(k){return this.$g(k,L[0],L[1])}})),I.extend=function(L,k){return L.$i||(L(k,H,I),L.$i=!0),I},I.locale=N,I.isDayjs=S,I.unix=function(L){return I(1e3*L)},I.en=O[T],I.Ls=O,I.p={},I}))})(bo)),bo.exports}var A3=C3();const He=Ir(A3),T3=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear(),s=new Date(r,n,1).getDay();return Math.ceil((t+s)/7)},P3=()=>[{name:"Year",template:"year",replacement:He().format("YYYY")},{name:"Month",template:"month",replacement:He().format("MM")},{name:"Short Month",template:"mon",replacement:He().format("M")},{name:"Day",template:"day",replacement:He().format("DD")},{name:"Short Day",template:"d",replacement:He().format("D")},{name:"Week of Month",template:"week_of_month",replacement:T3().toString()},{name:"Hour 24",template:"hour",replacement:He().format("HH")},{name:"Hour 12",template:"hour_12",replacement:He().format("hh")},{name:"Short Hour 24",template:"h",replacement:He().format("H")},{name:"Short Hour 12",template:"h_12",replacement:He().format("h")},{name:"AM/PM",template:"ampm",replacement:He().format("A")},{name:"Minute",template:"minute",replacement:He().format("mm")},{name:"Short Minute",template:"m",replacement:He().format("m")},{name:"Second",template:"second",replacement:He().format("ss")},{name:"Short Second",template:"s",replacement:He().format("s")}],M3="{%",_3="%}",Ll=e=>e.replace(new RegExp(`${M3}([^}]+)${_3}`,"g"),(t,n)=>P3().find(o=>o.template===n)?.replacement||t),io={title:"Move note to Trash?",description:"This note is referenced by the notes below. Those links may stop opening while this note stays in Trash. If you restore this note later, the links will work again.",confirmLabel:"Move to Trash",confirmVariant:"soft-danger"},Sp=()=>{const e=sf(),t=cf(),n=Gn(),r=En(),[o,s]=c.useState(null),a=async(d="",p="",m)=>{const v=Ll(d),g=Ll(p),y=await y3({title:v,content:g,...m&&{layout:m}});return y.type==="error"?(t(y.errors[0].message),null):(r({to:Jn,params:{id:y.createNote.id}}),y.createNote.id)},i=async(d,p,m)=>{try{const v=await b3(d,!p);if(v.type==="error"){t(v.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:ve.notes.listAll(),exact:!1}),n.invalidateQueries({queryKey:ve.notes.tagListAll(),exact:!1}),n.invalidateQueries({queryKey:ve.notes.pinned(),exact:!0})]),m?.()}catch{t("Failed to update note pin status")}},l=async(d,p)=>{const m=await x3(d);if(m.type==="error"){t(m.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:ve.notes.all(),exact:!1}),n.invalidateQueries({queryKey:ve.tags.all(),exact:!1}),n.invalidateQueries({queryKey:ve.reminders.all(),exact:!1}),n.invalidateQueries({queryKey:ve.images.all(),exact:!1}),n.invalidateQueries({queryKey:["calendar"],exact:!1})]),t("The note has been moved to trash."),p?.()},u=async()=>{if(!o)return;const{id:d,callback:p}=o;s(null),await l(d,p)};return{onCreate:a,onPinned:i,onDelete:async(d,p)=>{const m=await v3(d);if(m.type==="error"){t("Failed to check linked notes before moving this note to Trash.");return}if(n.setQueryData(ve.notes.backReferences(d),m.backReferences),m.backReferences.length>0){s({id:d,callback:p,backReferences:m.backReferences});return}await e("Move this note to trash?")&&await l(d,p)},deleteWarningDialog:h.jsx(S3,{isOpen:!!o,title:io.title,description:io.description,references:o?.backReferences??[],confirmLabel:io.confirmLabel,confirmVariant:io.confirmVariant,onClose:()=>s(null),onConfirm:()=>{u()}})}};function N3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Es=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function er(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Qi(e){return"nodeType"in e}function nt(e){var t,n;return e?er(e)?e:Qi(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Xi(e){const{Document:t}=nt(e);return e instanceof t}function Wr(e){return er(e)?!1:e instanceof nt(e).HTMLElement}function Rp(e){return e instanceof nt(e).SVGElement}function tr(e){return e?er(e)?e.document:Qi(e)?Xi(e)?e:Wr(e)||Rp(e)?e.ownerDocument:document:document:document}const _t=Es?c.useLayoutEffect:c.useEffect;function Ji(e){const t=c.useRef(e);return _t(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function O3(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Mr(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return _t(()=>{n.current!==e&&(n.current=e)},t),n}function Gr(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Vo(e){const t=Ji(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Ua(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let oa={};function Yr(e,t){return c.useMemo(()=>{if(t)return t;const n=oa[e]==null?0:oa[e]+1;return oa[e]=n,e+"-"+n},[e,t])}function Cp(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const i=Object.entries(a);for(const[l,u]of i){const f=s[l];f!=null&&(s[l]=f+e*u)}return s},{...t})}}const Vn=Cp(1),_r=Cp(-1);function I3(e){return"clientX"in e&&"clientY"in e}function ec(e){if(!e)return!1;const{KeyboardEvent:t}=nt(e.target);return t&&e instanceof t}function D3(e){if(!e)return!1;const{TouchEvent:t}=nt(e.target);return t&&e instanceof t}function qa(e){if(D3(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return I3(e)?{x:e.clientX,y:e.clientY}:null}const Nr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nr.Translate.toString(e),Nr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),jl="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function L3(e){return e.matches(jl)?e:e.querySelector(jl)}const j3={display:"none"};function k3(e){let{id:t,value:n}=e;return M.createElement("div",{id:t,style:j3},n)}function F3(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return M.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function $3(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ap=c.createContext(null);function H3(e){const t=c.useContext(Ap);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function B3(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:s}=r;e.forEach(a=>{var i;return(i=a[o])==null?void 0:i.call(a,s)})},[e]),t]}const V3={draggable:`
329
+ }`)}const Za=6e4,ao=6e4,Ln=(e,t)=>`${e} ${t}${e===1?"":"s"} ago`;function Ep(e,t=Date.now()){const n=new Date(e),r=Math.max(0,Math.floor((t-n.getTime())/1e3));let o=Math.floor(r/31536e3);return o>=1?Ln(o,"year"):(o=Math.floor(r/2592e3),o>=1?Ln(o,"month"):(o=Math.floor(r/86400),o>=1?Ln(o,"day"):(o=Math.floor(r/3600),o>=1?Ln(o,"hour"):(o=Math.floor(r/60),o>=1?Ln(o,"minute"):Ln(Math.floor(r),"second")))))}function N5(e,t=Date.now()){return e===null||t-e<Za?"just now":Ep(e,t)}function O5(e,t=Date.now()){if(e===null)return ao;const n=Math.max(0,t-e);if(n<Za)return Za-n;const r=n%ao;return r===0?ao:ao-r}function S3({id:e,title:t,tags:n,pinned:r,updatedAt:o,onPinned:s,onDelete:a}){const i=Ep(Number(o));return h.jsxs("div",{className:ae("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[r&&h.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:h.jsxs("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-secondary/70 bg-elevated text-fg-tertiary shadow-[0_8px_18px_-14px_rgba(23,29,38,0.32)]",children:[h.jsx(Xd,{className:"h-3.5 w-3.5",weight:"fill"}),h.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),h.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[h.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:h.jsxs(se,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),h.jsx(X4,{button:h.jsx(ox,{label:"Note actions",size:"sm"}),items:[{name:r?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>a?.()}]})]}),h.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[h.jsx(se,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:h.jsx(Pt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Jn,params:{id:e},children:t||"Untitled"})}),n.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(l=>h.jsx(Pt,{to:Gi,params:{id:l.id},search:{page:1},children:h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:l.name})},l.id))})]})]})]},e)}function R3({isOpen:e,title:t,description:n,references:r,confirmLabel:o,onClose:s,onConfirm:a,confirmVariant:i="primary",isConfirming:l=!1}){return h.jsxs(Ft,{isOpen:e,onClose:s,variant:"inspect",children:[h.jsx(Ft.Header,{title:t,onClose:s}),h.jsx(Ft.Body,{children:h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(Ft.Description,{className:"text-meta font-normal text-fg-secondary",children:n}),h.jsxs("div",{className:"overflow-hidden rounded-[16px] border border-border-subtle bg-hover-subtle/40",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border-subtle px-4 py-3",children:[h.jsx(se,{as:"p",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:"Referenced notes"}),h.jsxs(se,{as:"p",variant:"label",tone:"tertiary",children:[r.length," ",r.length===1?"note":"notes"]})]}),h.jsx("ul",{className:"flex flex-col",children:r.map((u,f)=>h.jsx("li",{className:f>0?"border-t border-border-subtle":void 0,children:h.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[h.jsx(se,{as:"p",variant:"body",weight:"medium",className:"min-w-0 flex-1 break-words",children:u.title||"Untitled note"}),h.jsx(bt,{asChild:!0,variant:"ghost",size:"sm",className:"self-start sm:self-auto",children:h.jsx(Pt,{to:Jn,params:{id:u.id},children:"Open note"})})]})},u.id))})]})]})}),h.jsx(Ft.Footer,{children:h.jsxs(Uw,{children:[h.jsx(bt,{variant:"ghost",size:"sm",onClick:s,disabled:l,children:"Cancel"}),h.jsx(bt,{variant:i,size:"sm",onClick:a,isLoading:l,children:o})]})})]})}var bo={exports:{}},C3=bo.exports,Dl;function A3(){return Dl||(Dl=1,(function(e,t){(function(n,r){e.exports=r()})(C3,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",a="second",i="minute",l="hour",u="day",f="week",d="month",p="quarter",m="year",v="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var k=["th","st","nd","rd"],A=L%100;return"["+L+(k[(A-20)%10]||k[A]||k[0])+"]"}},w=function(L,k,A){var D=String(L);return!D||D.length>=k?L:""+Array(k+1-D.length).join(A)+L},E={s:w,z:function(L){var k=-L.utcOffset(),A=Math.abs(k),D=Math.floor(A/60),j=A%60;return(k<=0?"+":"-")+w(D,2,"0")+":"+w(j,2,"0")},m:function L(k,A){if(k.date()<A.date())return-L(A,k);var D=12*(A.year()-k.year())+(A.month()-k.month()),j=k.clone().add(D,d),_=A-j<0,V=k.clone().add(D+(_?-1:1),d);return+(-(D+(A-j)/(_?j-V:V-j))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:d,y:m,w:f,d:u,D:v,h:l,m:i,s:a,ms:s,Q:p}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},T="en",O={};O[T]=x;var C="$isDayjsObject",S=function(L){return L instanceof H||!(!L||!L[C])},N=function L(k,A,D){var j;if(!k)return T;if(typeof k=="string"){var _=k.toLowerCase();O[_]&&(j=_),A&&(O[_]=A,j=_);var V=k.split("-");if(!j&&V.length>1)return L(V[0])}else{var K=k.name;O[K]=k,j=K}return!D&&j&&(T=j),j||!D&&T},I=function(L,k){if(S(L))return L.clone();var A=typeof k=="object"?k:{};return A.date=L,A.args=arguments,new H(A)},P=E;P.l=N,P.i=S,P.w=function(L,k){return I(L,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var H=(function(){function L(A){this.$L=N(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[C]=!0}var k=L.prototype;return k.parse=function(A){this.$d=(function(D){var j=D.date,_=D.utc;if(j===null)return new Date(NaN);if(P.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var V=j.match(y);if(V){var K=V[2]-1||0,Y=(V[7]||"0").substring(0,3);return _?new Date(Date.UTC(V[1],K,V[3]||1,V[4]||0,V[5]||0,V[6]||0,Y)):new Date(V[1],K,V[3]||1,V[4]||0,V[5]||0,V[6]||0,Y)}}return new Date(j)})(A),this.init()},k.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},k.$utils=function(){return P},k.isValid=function(){return this.$d.toString()!==g},k.isSame=function(A,D){var j=I(A);return this.startOf(D)<=j&&j<=this.endOf(D)},k.isAfter=function(A,D){return I(A)<this.startOf(D)},k.isBefore=function(A,D){return this.endOf(D)<I(A)},k.$g=function(A,D,j){return P.u(A)?this[D]:this.set(j,A)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(A,D){var j=this,_=!!P.u(D)||D,V=P.p(A),K=function(ee,Z){var X=P.w(j.$u?Date.UTC(j.$y,Z,ee):new Date(j.$y,Z,ee),j);return _?X:X.endOf(u)},Y=function(ee,Z){return P.w(j.toDate()[ee].apply(j.toDate("s"),(_?[0,0,0,0]:[23,59,59,999]).slice(Z)),j)},B=this.$W,q=this.$M,U=this.$D,J="set"+(this.$u?"UTC":"");switch(V){case m:return _?K(1,0):K(31,11);case d:return _?K(1,q):K(0,q+1);case f:var $=this.$locale().weekStart||0,F=(B<$?B+7:B)-$;return K(_?U-F:U+(6-F),q);case u:case v:return Y(J+"Hours",0);case l:return Y(J+"Minutes",1);case i:return Y(J+"Seconds",2);case a:return Y(J+"Milliseconds",3);default:return this.clone()}},k.endOf=function(A){return this.startOf(A,!1)},k.$set=function(A,D){var j,_=P.p(A),V="set"+(this.$u?"UTC":""),K=(j={},j[u]=V+"Date",j[v]=V+"Date",j[d]=V+"Month",j[m]=V+"FullYear",j[l]=V+"Hours",j[i]=V+"Minutes",j[a]=V+"Seconds",j[s]=V+"Milliseconds",j)[_],Y=_===u?this.$D+(D-this.$W):D;if(_===d||_===m){var B=this.clone().set(v,1);B.$d[K](Y),B.init(),this.$d=B.set(v,Math.min(this.$D,B.daysInMonth())).$d}else K&&this.$d[K](Y);return this.init(),this},k.set=function(A,D){return this.clone().$set(A,D)},k.get=function(A){return this[P.p(A)]()},k.add=function(A,D){var j,_=this;A=Number(A);var V=P.p(D),K=function(q){var U=I(_);return P.w(U.date(U.date()+Math.round(q*A)),_)};if(V===d)return this.set(d,this.$M+A);if(V===m)return this.set(m,this.$y+A);if(V===u)return K(1);if(V===f)return K(7);var Y=(j={},j[i]=r,j[l]=o,j[a]=n,j)[V]||1,B=this.$d.getTime()+A*Y;return P.w(B,this)},k.subtract=function(A,D){return this.add(-1*A,D)},k.format=function(A){var D=this,j=this.$locale();if(!this.isValid())return j.invalidDate||g;var _=A||"YYYY-MM-DDTHH:mm:ssZ",V=P.z(this),K=this.$H,Y=this.$m,B=this.$M,q=j.weekdays,U=j.months,J=j.meridiem,$=function(Z,X,te,ie){return Z&&(Z[X]||Z(D,_))||te[X].slice(0,ie)},F=function(Z){return P.s(K%12||12,Z,"0")},ee=J||function(Z,X,te){var ie=Z<12?"AM":"PM";return te?ie.toLowerCase():ie};return _.replace(b,(function(Z,X){return X||(function(te){switch(te){case"YY":return String(D.$y).slice(-2);case"YYYY":return P.s(D.$y,4,"0");case"M":return B+1;case"MM":return P.s(B+1,2,"0");case"MMM":return $(j.monthsShort,B,U,3);case"MMMM":return $(U,B);case"D":return D.$D;case"DD":return P.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return $(j.weekdaysMin,D.$W,q,2);case"ddd":return $(j.weekdaysShort,D.$W,q,3);case"dddd":return q[D.$W];case"H":return String(K);case"HH":return P.s(K,2,"0");case"h":return F(1);case"hh":return F(2);case"a":return ee(K,Y,!0);case"A":return ee(K,Y,!1);case"m":return String(Y);case"mm":return P.s(Y,2,"0");case"s":return String(D.$s);case"ss":return P.s(D.$s,2,"0");case"SSS":return P.s(D.$ms,3,"0");case"Z":return V}return null})(Z)||V.replace(":","")}))},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(A,D,j){var _,V=this,K=P.p(D),Y=I(A),B=(Y.utcOffset()-this.utcOffset())*r,q=this-Y,U=function(){return P.m(V,Y)};switch(K){case m:_=U()/12;break;case d:_=U();break;case p:_=U()/3;break;case f:_=(q-B)/6048e5;break;case u:_=(q-B)/864e5;break;case l:_=q/o;break;case i:_=q/r;break;case a:_=q/n;break;default:_=q}return j?_:P.a(_)},k.daysInMonth=function(){return this.endOf(d).$D},k.$locale=function(){return O[this.$L]},k.locale=function(A,D){if(!A)return this.$L;var j=this.clone(),_=N(A,D,!0);return _&&(j.$L=_),j},k.clone=function(){return P.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},L})(),z=H.prototype;return I.prototype=z,[["$ms",s],["$s",a],["$m",i],["$H",l],["$W",u],["$M",d],["$y",m],["$D",v]].forEach((function(L){z[L[1]]=function(k){return this.$g(k,L[0],L[1])}})),I.extend=function(L,k){return L.$i||(L(k,H,I),L.$i=!0),I},I.locale=N,I.isDayjs=S,I.unix=function(L){return I(1e3*L)},I.en=O[T],I.Ls=O,I.p={},I}))})(bo)),bo.exports}var T3=A3();const He=Ir(T3),P3=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear(),s=new Date(r,n,1).getDay();return Math.ceil((t+s)/7)},M3=()=>[{name:"Year",template:"year",replacement:He().format("YYYY")},{name:"Month",template:"month",replacement:He().format("MM")},{name:"Short Month",template:"mon",replacement:He().format("M")},{name:"Day",template:"day",replacement:He().format("DD")},{name:"Short Day",template:"d",replacement:He().format("D")},{name:"Week of Month",template:"week_of_month",replacement:P3().toString()},{name:"Hour 24",template:"hour",replacement:He().format("HH")},{name:"Hour 12",template:"hour_12",replacement:He().format("hh")},{name:"Short Hour 24",template:"h",replacement:He().format("H")},{name:"Short Hour 12",template:"h_12",replacement:He().format("h")},{name:"AM/PM",template:"ampm",replacement:He().format("A")},{name:"Minute",template:"minute",replacement:He().format("mm")},{name:"Short Minute",template:"m",replacement:He().format("m")},{name:"Second",template:"second",replacement:He().format("ss")},{name:"Short Second",template:"s",replacement:He().format("s")}],_3="{%",N3="%}",Ll=e=>e.replace(new RegExp(`${_3}([^}]+)${N3}`,"g"),(t,n)=>M3().find(o=>o.template===n)?.replacement||t),io={title:"Move note to Trash?",description:"This note is referenced by the notes below. Those links may stop opening while this note stays in Trash. If you restore this note later, the links will work again.",confirmLabel:"Move to Trash",confirmVariant:"soft-danger"},Sp=()=>{const e=sf(),t=cf(),n=Gn(),r=En(),[o,s]=c.useState(null),a=async(d="",p="",m)=>{const v=Ll(d),g=Ll(p),y=await b3({title:v,content:g,...m&&{layout:m}});return y.type==="error"?(t(y.errors[0].message),null):(r({to:Jn,params:{id:y.createNote.id}}),y.createNote.id)},i=async(d,p,m)=>{try{const v=await x3(d,!p);if(v.type==="error"){t(v.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:ve.notes.listAll(),exact:!1}),n.invalidateQueries({queryKey:ve.notes.tagListAll(),exact:!1}),n.invalidateQueries({queryKey:ve.notes.pinned(),exact:!0})]),m?.()}catch{t("Failed to update note pin status")}},l=async(d,p)=>{const m=await w3(d);if(m.type==="error"){t(m.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:ve.notes.all(),exact:!1}),n.invalidateQueries({queryKey:ve.tags.all(),exact:!1}),n.invalidateQueries({queryKey:ve.reminders.all(),exact:!1}),n.invalidateQueries({queryKey:ve.images.all(),exact:!1}),n.invalidateQueries({queryKey:["calendar"],exact:!1})]),t("The note has been moved to trash."),p?.()},u=async()=>{if(!o)return;const{id:d,callback:p}=o;s(null),await l(d,p)};return{onCreate:a,onPinned:i,onDelete:async(d,p)=>{const m=await y3(d);if(m.type==="error"){t("Failed to check linked notes before moving this note to Trash.");return}if(n.setQueryData(ve.notes.backReferences(d),m.backReferences),m.backReferences.length>0){s({id:d,callback:p,backReferences:m.backReferences});return}await e("Move this note to trash?")&&await l(d,p)},deleteWarningDialog:h.jsx(R3,{isOpen:!!o,title:io.title,description:io.description,references:o?.backReferences??[],confirmLabel:io.confirmLabel,confirmVariant:io.confirmVariant,onClose:()=>s(null),onConfirm:()=>{u()}})}};function O3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Es=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function er(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Qi(e){return"nodeType"in e}function nt(e){var t,n;return e?er(e)?e:Qi(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Xi(e){const{Document:t}=nt(e);return e instanceof t}function Wr(e){return er(e)?!1:e instanceof nt(e).HTMLElement}function Rp(e){return e instanceof nt(e).SVGElement}function tr(e){return e?er(e)?e.document:Qi(e)?Xi(e)?e:Wr(e)||Rp(e)?e.ownerDocument:document:document:document}const _t=Es?c.useLayoutEffect:c.useEffect;function Ji(e){const t=c.useRef(e);return _t(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function I3(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Mr(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return _t(()=>{n.current!==e&&(n.current=e)},t),n}function Gr(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Vo(e){const t=Ji(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Ua(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let oa={};function Yr(e,t){return c.useMemo(()=>{if(t)return t;const n=oa[e]==null?0:oa[e]+1;return oa[e]=n,e+"-"+n},[e,t])}function Cp(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const i=Object.entries(a);for(const[l,u]of i){const f=s[l];f!=null&&(s[l]=f+e*u)}return s},{...t})}}const Vn=Cp(1),_r=Cp(-1);function D3(e){return"clientX"in e&&"clientY"in e}function ec(e){if(!e)return!1;const{KeyboardEvent:t}=nt(e.target);return t&&e instanceof t}function L3(e){if(!e)return!1;const{TouchEvent:t}=nt(e.target);return t&&e instanceof t}function qa(e){if(L3(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return D3(e)?{x:e.clientX,y:e.clientY}:null}const Nr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nr.Translate.toString(e),Nr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),jl="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function j3(e){return e.matches(jl)?e:e.querySelector(jl)}const k3={display:"none"};function F3(e){let{id:t,value:n}=e;return M.createElement("div",{id:t,style:k3},n)}function $3(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return M.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function H3(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ap=c.createContext(null);function B3(e){const t=c.useContext(Ap);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function V3(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:s}=r;e.forEach(a=>{var i;return(i=a[o])==null?void 0:i.call(a,s)})},[e]),t]}const Z3={draggable:`
330
330
  To pick up a draggable item, press the space bar.
331
331
  While dragging, use the arrow keys to move the item.
332
332
  Press space again to drop the item in its new position, or press escape to cancel.
333
- `},Z3={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function U3(e){let{announcements:t=Z3,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=V3}=e;const{announce:s,announcement:a}=$3(),i=Yr("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),H3(c.useMemo(()=>({onDragStart(d){let{active:p}=d;s(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:m}=d;t.onDragMove&&s(t.onDragMove({active:p,over:m}))},onDragOver(d){let{active:p,over:m}=d;s(t.onDragOver({active:p,over:m}))},onDragEnd(d){let{active:p,over:m}=d;s(t.onDragEnd({active:p,over:m}))},onDragCancel(d){let{active:p,over:m}=d;s(t.onDragCancel({active:p,over:m}))}}),[s,t])),!l)return null;const f=M.createElement(M.Fragment,null,M.createElement(k3,{id:r,value:o.draggable}),M.createElement(F3,{id:i,announcement:a}));return n?$t.createPortal(f,n):f}var Me;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Me||(Me={}));function Zo(){}function kl(e,t){return c.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function q3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const wt=Object.freeze({x:0,y:0});function Tp(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Pp(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function z3(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Fl(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Mp(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function $l(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const K3=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=$l(t,t.left,t.top),s=[];for(const a of r){const{id:i}=a,l=n.get(i);if(l){const u=Tp($l(l),o);s.push({id:i,data:{droppableContainer:a,value:u}})}}return s.sort(Pp)},W3=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Fl(t),s=[];for(const a of r){const{id:i}=a,l=n.get(i);if(l){const u=Fl(l),f=o.reduce((p,m,v)=>p+Tp(u[v],m),0),d=Number((f/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:d}})}}return s.sort(Pp)};function G3(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-r,i=s-n;if(r<o&&n<s){const l=t.width*t.height,u=e.width*e.height,f=a*i,d=f/(l+u-f);return Number(d.toFixed(4))}return 0}const Y3=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:a}=s,i=n.get(a);if(i){const l=G3(i,t);l>0&&o.push({id:a,data:{droppableContainer:s,value:l}})}}return o.sort(z3)};function Q3(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function _p(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:wt}function X3(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...n})}}const J3=X3(1);function eS(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function tS(e,t,n){const r=eS(t);if(!r)return e;const{scaleX:o,scaleY:s,x:a,y:i}=r,l=e.left-a-(1-o)*parseFloat(n),u=e.top-i-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=s?e.height/s:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const nS={ignoreTransform:!1};function nr(e,t){t===void 0&&(t=nS);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=nt(e).getComputedStyle(e);u&&(n=tS(n,u,f))}const{top:r,left:o,width:s,height:a,bottom:i,right:l}=n;return{top:r,left:o,width:s,height:a,bottom:i,right:l}}function Hl(e){return nr(e,{ignoreTransform:!0})}function rS(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function oS(e,t){return t===void 0&&(t=nt(e).getComputedStyle(e)),t.position==="fixed"}function sS(e,t){t===void 0&&(t=nt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function Ss(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Xi(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Wr(o)||Rp(o)||n.includes(o))return n;const s=nt(e).getComputedStyle(o);return o!==e&&sS(o,s)&&n.push(o),oS(o,s)?n:r(o.parentNode)}return e?r(e):n}function Np(e){const[t]=Ss(e,1);return t??null}function sa(e){return!Es||!e?null:er(e)?e:Qi(e)?Xi(e)||e===tr(e).scrollingElement?window:Wr(e)?e:null:null}function Op(e){return er(e)?e.scrollX:e.scrollLeft}function Ip(e){return er(e)?e.scrollY:e.scrollTop}function za(e){return{x:Op(e),y:Ip(e)}}var Oe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Oe||(Oe={}));function Dp(e){return!Es||!e?!1:e===document.scrollingElement}function Lp(e){const t={x:0,y:0},n=Dp(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,i=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:a,isRight:i,maxScroll:r,minScroll:t}}const aS={x:.2,y:.2};function iS(e,t,n,r,o){let{top:s,left:a,right:i,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=aS);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=Lp(e),m={x:0,y:0},v={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!u&&s<=t.top+g.height?(m.y=Oe.Backward,v.y=r*Math.abs((t.top+g.height-s)/g.height)):!f&&l>=t.bottom-g.height&&(m.y=Oe.Forward,v.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!p&&i>=t.right-g.width?(m.x=Oe.Forward,v.x=r*Math.abs((t.right-g.width-i)/g.width)):!d&&a<=t.left+g.width&&(m.x=Oe.Backward,v.x=r*Math.abs((t.left+g.width-a)/g.width)),{direction:m,speed:v}}function cS(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function jp(e){return e.reduce((t,n)=>Vn(t,za(n)),wt)}function lS(e){return e.reduce((t,n)=>t+Op(n),0)}function uS(e){return e.reduce((t,n)=>t+Ip(n),0)}function dS(e,t){if(t===void 0&&(t=nr),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Np(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const fS=[["x",["left","right"],lS],["y",["top","bottom"],uS]];class tc{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ss(n),o=jp(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of fS)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=i(r),f=o[s]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class yr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function hS(e){const{EventTarget:t}=nt(e);return e instanceof t?e:tr(e)}function aa(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var pt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pt||(pt={}));function Bl(e){e.preventDefault()}function pS(e){e.stopPropagation()}var oe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(oe||(oe={}));const kp={start:[oe.Space,oe.Enter],cancel:[oe.Esc],end:[oe.Space,oe.Enter,oe.Tab]},mS=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case oe.Right:return{...n,x:n.x+25};case oe.Left:return{...n,x:n.x-25};case oe.Down:return{...n,y:n.y+25};case oe.Up:return{...n,y:n.y-25}}};class nc{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new yr(tr(n)),this.windowListeners=new yr(nt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&dS(r),n(wt)}handleKeyDown(t){if(ec(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=kp,coordinateGetter:a=mS,scrollBehavior:i="smooth"}=o,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:wt;this.referenceCoordinates||(this.referenceCoordinates=f);const d=a(t,{active:n,context:r.current,currentCoordinates:f});if(d){const p=_r(d,f),m={x:0,y:0},{scrollableAncestors:v}=r.current;for(const g of v){const y=t.code,{isTop:b,isRight:x,isLeft:w,isBottom:E,maxScroll:T,minScroll:O}=Lp(g),C=cS(g),S={x:Math.min(y===oe.Right?C.right-C.width/2:C.right,Math.max(y===oe.Right?C.left:C.left+C.width/2,d.x)),y:Math.min(y===oe.Down?C.bottom-C.height/2:C.bottom,Math.max(y===oe.Down?C.top:C.top+C.height/2,d.y))},N=y===oe.Right&&!x||y===oe.Left&&!w,I=y===oe.Down&&!E||y===oe.Up&&!b;if(N&&S.x!==d.x){const P=g.scrollLeft+p.x,H=y===oe.Right&&P<=T.x||y===oe.Left&&P>=O.x;if(H&&!p.y){g.scrollTo({left:P,behavior:i});return}H?m.x=g.scrollLeft-P:m.x=y===oe.Right?g.scrollLeft-T.x:g.scrollLeft-O.x,m.x&&g.scrollBy({left:-m.x,behavior:i});break}else if(I&&S.y!==d.y){const P=g.scrollTop+p.y,H=y===oe.Down&&P<=T.y||y===oe.Up&&P>=O.y;if(H&&!p.x){g.scrollTo({top:P,behavior:i});return}H?m.y=g.scrollTop-P:m.y=y===oe.Down?g.scrollTop-T.y:g.scrollTop-O.y,m.y&&g.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,Vn(_r(d,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}nc.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=kp,onActivation:o}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Vl(e){return!!(e&&"distance"in e)}function Zl(e){return!!(e&&"delay"in e)}class rc{constructor(t,n,r){var o;r===void 0&&(r=hS(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=tr(a),this.documentListeners=new yr(this.document),this.listeners=new yr(r),this.windowListeners=new yr(nt(a)),this.initialCoordinates=(o=qa(s))!=null?o:wt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,Bl),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,Bl),this.documentListeners.add(pt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zl(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Vl(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(pt.Click,pS,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!o)return;const l=(n=qa(t))!=null?n:wt,u=_r(o,l);if(!r&&i){if(Vl(i)){if(i.tolerance!=null&&aa(u,i.tolerance))return this.handleCancel();if(aa(u,i.distance))return this.handleStart()}if(Zl(i)&&aa(u,i.tolerance))return this.handleCancel();this.handlePending(i,u);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===oe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const gS={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class oc extends rc{constructor(t){const{event:n}=t,r=tr(n.target);super(t,gS,r)}}oc.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const vS={move:{name:"mousemove"},end:{name:"mouseup"}};var Ka;(function(e){e[e.RightClick=2]="RightClick"})(Ka||(Ka={}));class yS extends rc{constructor(t){super(t,vS,tr(t.event.target))}}yS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Ka.RightClick?!1:(r?.({event:n}),!0)}}];const ia={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class bS extends rc{constructor(t){super(t,ia)}static setup(){return window.addEventListener(ia.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ia.move.name,t)};function t(){}}}bS.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var br;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(br||(br={}));var Uo;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Uo||(Uo={}));function xS(e){let{acceleration:t,activator:n=br.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:i=Uo.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const m=ES({delta:d,disabled:!s}),[v,g]=O3(),y=c.useRef({x:0,y:0}),b=c.useRef({x:0,y:0}),x=c.useMemo(()=>{switch(n){case br.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case br.DraggableRect:return o}},[n,o,l]),w=c.useRef(null),E=c.useCallback(()=>{const O=w.current;if(!O)return;const C=y.current.x*b.current.x,S=y.current.y*b.current.y;O.scrollBy(C,S)},[]),T=c.useMemo(()=>i===Uo.TreeOrder?[...u].reverse():u,[i,u]);c.useEffect(()=>{if(!s||!u.length||!x){g();return}for(const O of T){if(r?.(O)===!1)continue;const C=u.indexOf(O),S=f[C];if(!S)continue;const{direction:N,speed:I}=iS(O,S,x,t,p);for(const P of["x","y"])m[P][N[P]]||(I[P]=0,N[P]=0);if(I.x>0||I.y>0){g(),w.current=O,v(E,a),y.current=I,b.current=N;return}}y.current={x:0,y:0},b.current={x:0,y:0},g()},[t,E,r,g,s,a,JSON.stringify(x),JSON.stringify(m),v,u,T,f,JSON.stringify(p)])}const wS={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.Forward]:!1}};function ES(e){let{delta:t,disabled:n}=e;const r=Ua(t);return Gr(o=>{if(n||!r||!o)return wS;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Oe.Backward]:o.x[Oe.Backward]||s.x===-1,[Oe.Forward]:o.x[Oe.Forward]||s.x===1},y:{[Oe.Backward]:o.y[Oe.Backward]||s.y===-1,[Oe.Forward]:o.y[Oe.Forward]||s.y===1}}},[n,t,r])}function SS(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Gr(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function RS(e,t){return c.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var Or;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Or||(Or={}));var Wa;(function(e){e.Optimized="optimized"})(Wa||(Wa={}));const Ul=new Map;function CS(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,a]=c.useState(null),{frequency:i,measure:l,strategy:u}=o,f=c.useRef(e),d=y(),p=Mr(d),m=c.useCallback(function(b){b===void 0&&(b=[]),!p.current&&a(x=>x===null?b:x.concat(b.filter(w=>!x.includes(w))))},[p]),v=c.useRef(null),g=Gr(b=>{if(d&&!n)return Ul;if(!b||b===Ul||f.current!==e||s!=null){const x=new Map;for(let w of e){if(!w)continue;if(s&&s.length>0&&!s.includes(w.id)&&w.rect.current){x.set(w.id,w.rect.current);continue}const E=w.node.current,T=E?new tc(l(E),E):null;w.rect.current=T,T&&x.set(w.id,T)}return x}return b},[e,s,n,d,l]);return c.useEffect(()=>{f.current=e},[e]),c.useEffect(()=>{d||m()},[n,d]),c.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),c.useEffect(()=>{d||typeof i!="number"||v.current!==null||(v.current=setTimeout(()=>{m(),v.current=null},i))},[i,d,m,...r]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:s!=null};function y(){switch(u){case Or.Always:return!1;case Or.BeforeDragging:return n;default:return!n}}}function Fp(e,t){return Gr(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function AS(e,t){return Fp(e,t)}function TS(e){let{callback:t,disabled:n}=e;const r=Ji(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function Rs(e){let{callback:t,disabled:n}=e;const r=Ji(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function PS(e){return new tc(nr(e),e)}function ql(e,t,n){t===void 0&&(t=PS);const[r,o]=c.useState(null);function s(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const a=TS({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),i=Rs({callback:s});return _t(()=>{s(),e?(i?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(i?.disconnect(),a?.disconnect())},[e]),r}function MS(e){const t=Fp(e);return _p(e,t)}const zl=[];function _S(e){const t=c.useRef(e),n=Gr(r=>e?r&&r!==zl&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ss(e):zl,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function NS(e){const[t,n]=c.useState(null),r=c.useRef(e),o=c.useCallback(s=>{const a=sa(s.target);a&&n(i=>i?(i.set(a,za(a)),new Map(i)):null)},[]);return c.useEffect(()=>{const s=r.current;if(e!==s){a(s);const i=e.map(l=>{const u=sa(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,za(u)]):null}).filter(l=>l!=null);n(i.length?new Map(i):null),r.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(l=>{const u=sa(l);u?.removeEventListener("scroll",o)})}},[o,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>Vn(s,a),wt):jp(e):wt,[e,t])}function Kl(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const r=e!==wt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?_r(e,n.current):wt}function OS(e){c.useEffect(()=>{if(!Es)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function IS(e,t){return c.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=a=>{s(a,t)},n},{}),[e,t])}function $p(e){return c.useMemo(()=>e?rS(e):null,[e])}const Wl=[];function DS(e,t){t===void 0&&(t=nr);const[n]=e,r=$p(n?nt(n):null),[o,s]=c.useState(Wl);function a(){s(()=>e.length?e.map(l=>Dp(l)?r:new tc(t(l),l)):Wl)}const i=Rs({callback:a});return _t(()=>{i?.disconnect(),a(),e.forEach(l=>i?.observe(l))},[e]),o}function LS(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Wr(t)?t:e}function jS(e){let{measure:t}=e;const[n,r]=c.useState(null),o=c.useCallback(u=>{for(const{target:f}of u)if(Wr(f)){r(d=>{const p=t(f);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),s=Rs({callback:o}),a=c.useCallback(u=>{const f=LS(u);s?.disconnect(),f&&s?.observe(f),r(f?t(f):null)},[t,s]),[i,l]=Vo(a);return c.useMemo(()=>({nodeRef:i,rect:n,setRef:l}),[n,i,l])}const kS=[{sensor:oc,options:{}},{sensor:nc,options:{}}],FS={current:{}},xo={draggable:{measure:Hl},droppable:{measure:Hl,strategy:Or.WhileDragging,frequency:Wa.Optimized},dragOverlay:{measure:nr}};class xr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const $S={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Zo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:xo,measureDroppableContainers:Zo,windowRect:null,measuringScheduled:!1},HS={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Zo,draggableNodes:new Map,over:null,measureDroppableContainers:Zo},Cs=c.createContext(HS),Hp=c.createContext($S);function BS(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xr}}}function VS(e,t){switch(t.type){case Me.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Me.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Me.DragEnd:case Me.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Me.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new xr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Me.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new xr(e.droppable.containers);return a.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Me.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new xr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function ZS(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c.useContext(Cs),s=Ua(r),a=Ua(n?.id);return c.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!ec(s)||document.activeElement===s.target)return;const i=o.get(a);if(!i)return;const{activatorNode:l,node:u}=i;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=L3(f);if(d){d.focus();break}}})}},[r,t,o,a,s]),null}function US(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function qS(e){return c.useMemo(()=>({draggable:{...xo.draggable,...e?.draggable},droppable:{...xo.droppable,...e?.droppable},dragOverlay:{...xo.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function zS(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=c.useRef(!1),{x:a,y:i}=typeof o=="boolean"?{x:o,y:o}:o;_t(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=_p(f,r);if(a||(d.x=0),i||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=Np(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,a,i,r,n])}const Bp=c.createContext({...wt,scaleX:1,scaleY:1});var Kt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Kt||(Kt={}));const KS=c.memo(function(t){var n,r,o,s;let{id:a,accessibility:i,autoScroll:l=!0,children:u,sensors:f=kS,collisionDetection:d=Y3,measuring:p,modifiers:m,...v}=t;const g=c.useReducer(VS,void 0,BS),[y,b]=g,[x,w]=B3(),[E,T]=c.useState(Kt.Uninitialized),O=E===Kt.Initialized,{draggable:{active:C,nodes:S,translate:N},droppable:{containers:I}}=y,P=C!=null?S.get(C):null,H=c.useRef({initial:null,translated:null}),z=c.useMemo(()=>{var Pe;return C!=null?{id:C,data:(Pe=P?.data)!=null?Pe:FS,rect:H}:null},[C,P]),L=c.useRef(null),[k,A]=c.useState(null),[D,j]=c.useState(null),_=Mr(v,Object.values(v)),V=Yr("DndDescribedBy",a),K=c.useMemo(()=>I.getEnabled(),[I]),Y=qS(p),{droppableRects:B,measureDroppableContainers:q,measuringScheduled:U}=CS(K,{dragging:O,dependencies:[N.x,N.y],config:Y.droppable}),J=SS(S,C),$=c.useMemo(()=>D?qa(D):null,[D]),F=Ns(),ee=AS(J,Y.draggable.measure);zS({activeNode:C!=null?S.get(C):null,config:F.layoutShiftCompensation,initialRect:ee,measure:Y.draggable.measure});const Z=ql(J,Y.draggable.measure,ee),X=ql(J?J.parentElement:null),te=c.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=I.getNodeFor((n=te.current.over)==null?void 0:n.id),ue=jS({measure:Y.dragOverlay.measure}),Qe=(r=ue.nodeRef.current)!=null?r:J,Fe=O?(o=ue.rect)!=null?o:Z:null,qe=!!(ue.nodeRef.current&&ue.rect),ct=MS(qe?null:Z),Le=$p(Qe?nt(Qe):null),Ne=_S(O?ie??J:null),Zt=DS(Ne),Te=US(m,{transform:{x:N.x-ct.x,y:N.y-ct.y,scaleX:1,scaleY:1},activatorEvent:D,active:z,activeNodeRect:Z,containerNodeRect:X,draggingNodeRect:Fe,over:te.current.over,overlayNodeRect:ue.rect,scrollableAncestors:Ne,scrollableAncestorRects:Zt,windowRect:Le}),lt=$?Vn($,N):null,An=NS(Ne),Tn=Kl(An),ce=Kl(An,[Z]),ge=Vn(Te,Tn),Re=Fe?J3(Fe,Te):null,ut=z&&Re?d({active:z,collisionRect:Re,droppableRects:B,droppableContainers:K,pointerCoordinates:lt}):null,It=Mp(ut,"id"),[vt,Dt]=c.useState(null),Ts=qe?Te:Vn(Te,ce),Ps=Q3(Ts,(s=vt?.rect)!=null?s:null,Z),Pn=c.useRef(null),rr=c.useCallback((Pe,$e)=>{let{sensor:Q,options:pe}=$e;if(L.current==null)return;const fe=S.get(L.current);if(!fe)return;const me=Pe.nativeEvent,ze=new Q({active:L.current,activeNode:fe,event:me,options:pe,context:te,onAbort(de){if(!S.get(de))return;const{onDragAbort:Se}=_.current,Ce={id:de};Se?.(Ce),x({type:"onDragAbort",event:Ce})},onPending(de,rt,Se,Ce){if(!S.get(de))return;const{onDragPending:ot}=_.current,Lt={id:de,constraint:rt,initialCoordinates:Se,offset:Ce};ot?.(Lt),x({type:"onDragPending",event:Lt})},onStart(de){const rt=L.current;if(rt==null)return;const Se=S.get(rt);if(!Se)return;const{onDragStart:Ce}=_.current,Ut={activatorEvent:me,active:{id:rt,data:Se.data,rect:H}};$t.unstable_batchedUpdates(()=>{Ce?.(Ut),T(Kt.Initializing),b({type:Me.DragStart,initialCoordinates:de,active:rt}),x({type:"onDragStart",event:Ut}),A(Pn.current),j(me)})},onMove(de){b({type:Me.DragMove,coordinates:de})},onEnd:be(Me.DragEnd),onCancel:be(Me.DragCancel)});Pn.current=ze;function be(de){return async function(){const{active:Se,collisions:Ce,over:Ut,scrollAdjustedTranslate:ot}=te.current;let Lt=null;if(Se&&ot){const{cancelDrop:or}=_.current;Lt={activatorEvent:me,active:Se,collisions:Ce,delta:ot,over:Ut},de===Me.DragEnd&&typeof or=="function"&&await Promise.resolve(or(Lt))&&(de=Me.DragCancel)}L.current=null,$t.unstable_batchedUpdates(()=>{b({type:de}),T(Kt.Uninitialized),Dt(null),A(null),j(null),Pn.current=null;const or=de===Me.DragEnd?"onDragEnd":"onDragCancel";if(Lt){const Os=_.current[or];Os?.(Lt),x({type:or,event:Lt})}})}}},[S]),Ms=c.useCallback((Pe,$e)=>(Q,pe)=>{const fe=Q.nativeEvent,me=S.get(pe);if(L.current!==null||!me||fe.dndKit||fe.defaultPrevented)return;const ze={active:me};Pe(Q,$e.options,ze)===!0&&(fe.dndKit={capturedBy:$e.sensor},L.current=pe,rr(Q,$e))},[S,rr]),Mn=RS(f,Ms);OS(f),_t(()=>{Z&&E===Kt.Initializing&&T(Kt.Initialized)},[Z,E]),c.useEffect(()=>{const{onDragMove:Pe}=_.current,{active:$e,activatorEvent:Q,collisions:pe,over:fe}=te.current;if(!$e||!Q)return;const me={active:$e,activatorEvent:Q,collisions:pe,delta:{x:ge.x,y:ge.y},over:fe};$t.unstable_batchedUpdates(()=>{Pe?.(me),x({type:"onDragMove",event:me})})},[ge.x,ge.y]),c.useEffect(()=>{const{active:Pe,activatorEvent:$e,collisions:Q,droppableContainers:pe,scrollAdjustedTranslate:fe}=te.current;if(!Pe||L.current==null||!$e||!fe)return;const{onDragOver:me}=_.current,ze=pe.get(It),be=ze&&ze.rect.current?{id:ze.id,rect:ze.rect.current,data:ze.data,disabled:ze.disabled}:null,de={active:Pe,activatorEvent:$e,collisions:Q,delta:{x:fe.x,y:fe.y},over:be};$t.unstable_batchedUpdates(()=>{Dt(be),me?.(de),x({type:"onDragOver",event:de})})},[It]),_t(()=>{te.current={activatorEvent:D,active:z,activeNode:J,collisionRect:Re,collisions:ut,droppableRects:B,draggableNodes:S,draggingNode:Qe,draggingNodeRect:Fe,droppableContainers:I,over:vt,scrollableAncestors:Ne,scrollAdjustedTranslate:ge},H.current={initial:Fe,translated:Re}},[z,J,ut,Re,S,Qe,Fe,B,I,vt,Ne,ge]),xS({...F,delta:N,draggingRect:Re,pointerCoordinates:lt,scrollableAncestors:Ne,scrollableAncestorRects:Zt});const Rt=c.useMemo(()=>({active:z,activeNode:J,activeNodeRect:Z,activatorEvent:D,collisions:ut,containerNodeRect:X,dragOverlay:ue,draggableNodes:S,droppableContainers:I,droppableRects:B,over:vt,measureDroppableContainers:q,scrollableAncestors:Ne,scrollableAncestorRects:Zt,measuringConfiguration:Y,measuringScheduled:U,windowRect:Le}),[z,J,Z,D,ut,X,ue,S,I,B,vt,q,Ne,Zt,Y,U,Le]),_s=c.useMemo(()=>({activatorEvent:D,activators:Mn,active:z,activeNodeRect:Z,ariaDescribedById:{draggable:V},dispatch:b,draggableNodes:S,over:vt,measureDroppableContainers:q}),[D,Mn,z,Z,b,V,S,vt,q]);return M.createElement(Ap.Provider,{value:w},M.createElement(Cs.Provider,{value:_s},M.createElement(Hp.Provider,{value:Rt},M.createElement(Bp.Provider,{value:Ps},u)),M.createElement(ZS,{disabled:i?.restoreFocus===!1})),M.createElement(U3,{...i,hiddenTextDescribedById:V}));function Ns(){const Pe=k?.autoScrollEnabled===!1,$e=typeof l=="object"?l.enabled===!1:l===!1,Q=O&&!Pe&&!$e;return typeof l=="object"?{...l,enabled:Q}:{enabled:Q}}}),WS=c.createContext(null),Gl="button",GS="Draggable";function YS(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Yr(GS),{activators:a,activatorEvent:i,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=c.useContext(Cs),{role:m=Gl,roleDescription:v="draggable",tabIndex:g=0}=o??{},y=l?.id===t,b=c.useContext(y?Bp:WS),[x,w]=Vo(),[E,T]=Vo(),O=IS(a,t),C=Mr(n);_t(()=>(d.set(t,{id:t,key:s,node:x,activatorNode:E,data:C}),()=>{const N=d.get(t);N&&N.key===s&&d.delete(t)}),[d,t]);const S=c.useMemo(()=>({role:m,tabIndex:g,"aria-disabled":r,"aria-pressed":y&&m===Gl?!0:void 0,"aria-roledescription":v,"aria-describedby":f.draggable}),[r,m,g,y,v,f.draggable]);return{active:l,activatorEvent:i,activeNodeRect:u,attributes:S,isDragging:y,listeners:r?void 0:O,node:x,over:p,setNodeRef:w,setActivatorNodeRef:T,transform:b}}function QS(){return c.useContext(Hp)}const XS="Droppable",JS={timeout:25};function eR(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Yr(XS),{active:a,dispatch:i,over:l,measureDroppableContainers:u}=c.useContext(Cs),f=c.useRef({disabled:n}),d=c.useRef(!1),p=c.useRef(null),m=c.useRef(null),{disabled:v,updateMeasurementsFor:g,timeout:y}={...JS,...o},b=Mr(g??r),x=c.useCallback(()=>{if(!d.current){d.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),m.current=null},y)},[y]),w=Rs({callback:x,disabled:v||!a}),E=c.useCallback((S,N)=>{w&&(N&&(w.unobserve(N),d.current=!1),S&&w.observe(S))},[w]),[T,O]=Vo(E),C=Mr(t);return c.useEffect(()=>{!w||!T.current||(w.disconnect(),d.current=!1,w.observe(T.current))},[T,w]),c.useEffect(()=>(i({type:Me.RegisterDroppable,element:{id:r,key:s,disabled:n,node:T,rect:p,data:C}}),()=>i({type:Me.UnregisterDroppable,key:s,id:r})),[r]),c.useEffect(()=>{n!==f.current.disabled&&(i({type:Me.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,i]),{active:a,rect:p,isOver:l?.id===r,node:T,over:l,setNodeRef:O}}const O5=e=>{let{transform:t}=e;return{...t,y:0}},tR=e=>{let{transform:t}=e;return{...t,x:0}};function sc(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function nR(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function co(e){return e!==null&&e>=0}function rR(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oR(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const lo={scaleX:1,scaleY:1},I5=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:a}=e;const i=(t=n[o])!=null?t:r;if(!i)return null;const l=sR(n,a,o);if(a===o){const u=n[s];return u?{x:o<s?u.left+u.width-(i.left+i.width):u.left-i.left,y:0,...lo}:null}return a>o&&a<=s?{x:-i.width-l,y:0,...lo}:a<o&&a>=s?{x:i.width+l,y:0,...lo}:{x:0,y:0,...lo}};function sR(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const Vp=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=sc(t,r,n),a=t[o],i=s[o];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},uo={scaleX:1,scaleY:1},aR=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:a}=e;const i=(t=s[n])!=null?t:r;if(!i)return null;if(o===n){const u=s[a];return u?{x:0,y:n<a?u.top+u.height-(i.top+i.height):u.top-i.top,...uo}:null}const l=iR(s,o,n);return o>n&&o<=a?{x:0,y:-i.height-l,...uo}:o<n&&o>=a?{x:0,y:i.height+l,...uo}:{x:0,y:0,...uo}};function iR(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const Zp="Sortable",Up=M.createContext({activeIndex:-1,containerId:Zp,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Vp,disabled:{draggable:!1,droppable:!1}});function cR(e){let{children:t,id:n,items:r,strategy:o=Vp,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:l,over:u,measureDroppableContainers:f}=QS(),d=Yr(Zp,n),p=i.rect!==null,m=c.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),v=a!=null,g=a?m.indexOf(a.id):-1,y=u?m.indexOf(u.id):-1,b=c.useRef(m),x=!rR(m,b.current),w=y!==-1&&g===-1||x,E=oR(s);_t(()=>{x&&v&&f(m)},[x,m,v,f]),c.useEffect(()=>{b.current=m},[m]);const T=c.useMemo(()=>({activeIndex:g,containerId:d,disabled:E,disableTransforms:w,items:m,overIndex:y,useDragOverlay:p,sortedRects:nR(m,l),strategy:o}),[g,d,E.draggable,E.droppable,w,m,y,l,p,o]);return M.createElement(Up.Provider,{value:T},t)}const lR=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return sc(n,r,o).indexOf(t)},uR=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:a,previousItems:i,previousContainerId:l,transition:u}=e;return!u||!r||i!==s&&o===a?!1:n?!0:a!==o&&t===l},dR={duration:200,easing:"ease"},qp="transform",fR=Nr.Transition.toString({property:qp,duration:0,easing:"linear"}),hR={roleDescription:"sortable"};function pR(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,a]=c.useState(null),i=c.useRef(n);return _t(()=>{if(!t&&n!==i.current&&r.current){const l=o.current;if(l){const u=nr(r.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&a(f)}}n!==i.current&&(i.current=n)},[t,n,r,o]),c.useEffect(()=>{s&&a(null)},[s]),s}function mR(e){let{animateLayoutChanges:t=uR,attributes:n,disabled:r,data:o,getNewIndex:s=lR,id:a,strategy:i,resizeObserverConfig:l,transition:u=dR}=e;const{items:f,containerId:d,activeIndex:p,disabled:m,disableTransforms:v,sortedRects:g,overIndex:y,useDragOverlay:b,strategy:x}=c.useContext(Up),w=gR(r,m),E=f.indexOf(a),T=c.useMemo(()=>({sortable:{containerId:d,index:E,items:f},...o}),[d,o,E,f]),O=c.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:C,node:S,isOver:N,setNodeRef:I}=eR({id:a,data:T,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...l}}),{active:P,activatorEvent:H,activeNodeRect:z,attributes:L,setNodeRef:k,listeners:A,isDragging:D,over:j,setActivatorNodeRef:_,transform:V}=YS({id:a,data:T,attributes:{...hR,...n},disabled:w.draggable}),K=N3(I,k),Y=!!P,B=Y&&!v&&co(p)&&co(y),q=!b&&D,U=q&&B?V:null,$=B?U??(i??x)({rects:g,activeNodeRect:z,activeIndex:p,overIndex:y,index:E}):null,F=co(p)&&co(y)?s({id:a,items:f,activeIndex:p,overIndex:y}):E,ee=P?.id,Z=c.useRef({activeId:ee,items:f,newIndex:F,containerId:d}),X=f!==Z.current.items,te=t({active:P,containerId:d,isDragging:D,isSorting:Y,id:a,index:E,items:f,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:u,wasDragging:Z.current.activeId!=null}),ie=pR({disabled:!te,index:E,node:S,rect:C});return c.useEffect(()=>{Y&&Z.current.newIndex!==F&&(Z.current.newIndex=F),d!==Z.current.containerId&&(Z.current.containerId=d),f!==Z.current.items&&(Z.current.items=f)},[Y,F,d,f]),c.useEffect(()=>{if(ee===Z.current.activeId)return;if(ee!=null&&Z.current.activeId==null){Z.current.activeId=ee;return}const Qe=setTimeout(()=>{Z.current.activeId=ee},50);return()=>clearTimeout(Qe)},[ee]),{active:P,activeIndex:p,attributes:L,data:T,rect:C,index:E,newIndex:F,items:f,isOver:N,isSorting:Y,isDragging:D,listeners:A,node:S,overIndex:y,over:j,setNodeRef:K,setActivatorNodeRef:_,setDroppableNodeRef:I,setDraggableNodeRef:k,transform:ie??$,transition:ue()};function ue(){if(ie||X&&Z.current.newIndex===E)return fR;if(!(q&&!ec(H)||!u)&&(Y||te))return Nr.Transition.toString({...u,property:qp})}}function gR(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function qo(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const vR=[oe.Down,oe.Right,oe.Up,oe.Left],yR=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(vR.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=o.get(d.id);if(p)switch(e.code){case oe.Down:r.top<p.top&&l.push(d);break;case oe.Up:r.top>p.top&&l.push(d);break;case oe.Left:r.left>p.left&&l.push(d);break;case oe.Right:r.left<p.left&&l.push(d);break}});const u=W3({collisionRect:r,droppableRects:o,droppableContainers:l});let f=Mp(u,"id");if(f===a?.id&&u.length>1&&(f=u[1].id),f!=null){const d=s.get(n.id),p=s.get(f),m=p?o.get(p.id):null,v=p?.node.current;if(v&&m&&d&&p){const y=Ss(v).some((O,C)=>i[C]!==O),b=zp(d,p),x=bR(d,p),w=y||!b?{x:0,y:0}:{x:x?r.width-m.width:0,y:x?r.height-m.height:0},E={x:m.left,y:m.top};return w.x&&w.y?E:_r(E,w)}}}};function zp(e,t){return!qo(e)||!qo(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function bR(e,t){return!qo(e)||!qo(t)||!zp(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const xR=e=>{const{data:t}=ku({queryKey:ve.notes.list(e.searchParams),async queryFn(){const n=await wp(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)},wR=e=>{const{data:t}=ku({queryKey:ve.notes.pinned(),async queryFn(){const n=await he(`
333
+ `},U3={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function q3(e){let{announcements:t=U3,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Z3}=e;const{announce:s,announcement:a}=H3(),i=Yr("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),B3(c.useMemo(()=>({onDragStart(d){let{active:p}=d;s(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:m}=d;t.onDragMove&&s(t.onDragMove({active:p,over:m}))},onDragOver(d){let{active:p,over:m}=d;s(t.onDragOver({active:p,over:m}))},onDragEnd(d){let{active:p,over:m}=d;s(t.onDragEnd({active:p,over:m}))},onDragCancel(d){let{active:p,over:m}=d;s(t.onDragCancel({active:p,over:m}))}}),[s,t])),!l)return null;const f=M.createElement(M.Fragment,null,M.createElement(F3,{id:r,value:o.draggable}),M.createElement($3,{id:i,announcement:a}));return n?$t.createPortal(f,n):f}var Me;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Me||(Me={}));function Zo(){}function kl(e,t){return c.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function z3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const wt=Object.freeze({x:0,y:0});function Tp(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Pp(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function K3(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Fl(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Mp(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function $l(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const W3=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=$l(t,t.left,t.top),s=[];for(const a of r){const{id:i}=a,l=n.get(i);if(l){const u=Tp($l(l),o);s.push({id:i,data:{droppableContainer:a,value:u}})}}return s.sort(Pp)},G3=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Fl(t),s=[];for(const a of r){const{id:i}=a,l=n.get(i);if(l){const u=Fl(l),f=o.reduce((p,m,v)=>p+Tp(u[v],m),0),d=Number((f/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:d}})}}return s.sort(Pp)};function Y3(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-r,i=s-n;if(r<o&&n<s){const l=t.width*t.height,u=e.width*e.height,f=a*i,d=f/(l+u-f);return Number(d.toFixed(4))}return 0}const Q3=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:a}=s,i=n.get(a);if(i){const l=Y3(i,t);l>0&&o.push({id:a,data:{droppableContainer:s,value:l}})}}return o.sort(K3)};function X3(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function _p(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:wt}function J3(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...n})}}const eS=J3(1);function tS(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function nS(e,t,n){const r=tS(t);if(!r)return e;const{scaleX:o,scaleY:s,x:a,y:i}=r,l=e.left-a-(1-o)*parseFloat(n),u=e.top-i-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=s?e.height/s:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const rS={ignoreTransform:!1};function nr(e,t){t===void 0&&(t=rS);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=nt(e).getComputedStyle(e);u&&(n=nS(n,u,f))}const{top:r,left:o,width:s,height:a,bottom:i,right:l}=n;return{top:r,left:o,width:s,height:a,bottom:i,right:l}}function Hl(e){return nr(e,{ignoreTransform:!0})}function oS(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function sS(e,t){return t===void 0&&(t=nt(e).getComputedStyle(e)),t.position==="fixed"}function aS(e,t){t===void 0&&(t=nt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function Ss(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Xi(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Wr(o)||Rp(o)||n.includes(o))return n;const s=nt(e).getComputedStyle(o);return o!==e&&aS(o,s)&&n.push(o),sS(o,s)?n:r(o.parentNode)}return e?r(e):n}function Np(e){const[t]=Ss(e,1);return t??null}function sa(e){return!Es||!e?null:er(e)?e:Qi(e)?Xi(e)||e===tr(e).scrollingElement?window:Wr(e)?e:null:null}function Op(e){return er(e)?e.scrollX:e.scrollLeft}function Ip(e){return er(e)?e.scrollY:e.scrollTop}function za(e){return{x:Op(e),y:Ip(e)}}var Oe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Oe||(Oe={}));function Dp(e){return!Es||!e?!1:e===document.scrollingElement}function Lp(e){const t={x:0,y:0},n=Dp(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,i=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:a,isRight:i,maxScroll:r,minScroll:t}}const iS={x:.2,y:.2};function cS(e,t,n,r,o){let{top:s,left:a,right:i,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=iS);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=Lp(e),m={x:0,y:0},v={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!u&&s<=t.top+g.height?(m.y=Oe.Backward,v.y=r*Math.abs((t.top+g.height-s)/g.height)):!f&&l>=t.bottom-g.height&&(m.y=Oe.Forward,v.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!p&&i>=t.right-g.width?(m.x=Oe.Forward,v.x=r*Math.abs((t.right-g.width-i)/g.width)):!d&&a<=t.left+g.width&&(m.x=Oe.Backward,v.x=r*Math.abs((t.left+g.width-a)/g.width)),{direction:m,speed:v}}function lS(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function jp(e){return e.reduce((t,n)=>Vn(t,za(n)),wt)}function uS(e){return e.reduce((t,n)=>t+Op(n),0)}function dS(e){return e.reduce((t,n)=>t+Ip(n),0)}function fS(e,t){if(t===void 0&&(t=nr),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Np(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const hS=[["x",["left","right"],uS],["y",["top","bottom"],dS]];class tc{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ss(n),o=jp(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of hS)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=i(r),f=o[s]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class yr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function pS(e){const{EventTarget:t}=nt(e);return e instanceof t?e:tr(e)}function aa(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var pt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pt||(pt={}));function Bl(e){e.preventDefault()}function mS(e){e.stopPropagation()}var oe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(oe||(oe={}));const kp={start:[oe.Space,oe.Enter],cancel:[oe.Esc],end:[oe.Space,oe.Enter,oe.Tab]},gS=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case oe.Right:return{...n,x:n.x+25};case oe.Left:return{...n,x:n.x-25};case oe.Down:return{...n,y:n.y+25};case oe.Up:return{...n,y:n.y-25}}};class nc{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new yr(tr(n)),this.windowListeners=new yr(nt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&fS(r),n(wt)}handleKeyDown(t){if(ec(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=kp,coordinateGetter:a=gS,scrollBehavior:i="smooth"}=o,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:wt;this.referenceCoordinates||(this.referenceCoordinates=f);const d=a(t,{active:n,context:r.current,currentCoordinates:f});if(d){const p=_r(d,f),m={x:0,y:0},{scrollableAncestors:v}=r.current;for(const g of v){const y=t.code,{isTop:b,isRight:x,isLeft:w,isBottom:E,maxScroll:T,minScroll:O}=Lp(g),C=lS(g),S={x:Math.min(y===oe.Right?C.right-C.width/2:C.right,Math.max(y===oe.Right?C.left:C.left+C.width/2,d.x)),y:Math.min(y===oe.Down?C.bottom-C.height/2:C.bottom,Math.max(y===oe.Down?C.top:C.top+C.height/2,d.y))},N=y===oe.Right&&!x||y===oe.Left&&!w,I=y===oe.Down&&!E||y===oe.Up&&!b;if(N&&S.x!==d.x){const P=g.scrollLeft+p.x,H=y===oe.Right&&P<=T.x||y===oe.Left&&P>=O.x;if(H&&!p.y){g.scrollTo({left:P,behavior:i});return}H?m.x=g.scrollLeft-P:m.x=y===oe.Right?g.scrollLeft-T.x:g.scrollLeft-O.x,m.x&&g.scrollBy({left:-m.x,behavior:i});break}else if(I&&S.y!==d.y){const P=g.scrollTop+p.y,H=y===oe.Down&&P<=T.y||y===oe.Up&&P>=O.y;if(H&&!p.x){g.scrollTo({top:P,behavior:i});return}H?m.y=g.scrollTop-P:m.y=y===oe.Down?g.scrollTop-T.y:g.scrollTop-O.y,m.y&&g.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,Vn(_r(d,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}nc.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=kp,onActivation:o}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Vl(e){return!!(e&&"distance"in e)}function Zl(e){return!!(e&&"delay"in e)}class rc{constructor(t,n,r){var o;r===void 0&&(r=pS(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=tr(a),this.documentListeners=new yr(this.document),this.listeners=new yr(r),this.windowListeners=new yr(nt(a)),this.initialCoordinates=(o=qa(s))!=null?o:wt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,Bl),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,Bl),this.documentListeners.add(pt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zl(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Vl(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(pt.Click,mS,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!o)return;const l=(n=qa(t))!=null?n:wt,u=_r(o,l);if(!r&&i){if(Vl(i)){if(i.tolerance!=null&&aa(u,i.tolerance))return this.handleCancel();if(aa(u,i.distance))return this.handleStart()}if(Zl(i)&&aa(u,i.tolerance))return this.handleCancel();this.handlePending(i,u);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===oe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const vS={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class oc extends rc{constructor(t){const{event:n}=t,r=tr(n.target);super(t,vS,r)}}oc.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const yS={move:{name:"mousemove"},end:{name:"mouseup"}};var Ka;(function(e){e[e.RightClick=2]="RightClick"})(Ka||(Ka={}));class bS extends rc{constructor(t){super(t,yS,tr(t.event.target))}}bS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Ka.RightClick?!1:(r?.({event:n}),!0)}}];const ia={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class xS extends rc{constructor(t){super(t,ia)}static setup(){return window.addEventListener(ia.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ia.move.name,t)};function t(){}}}xS.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var br;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(br||(br={}));var Uo;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Uo||(Uo={}));function wS(e){let{acceleration:t,activator:n=br.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:i=Uo.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const m=SS({delta:d,disabled:!s}),[v,g]=I3(),y=c.useRef({x:0,y:0}),b=c.useRef({x:0,y:0}),x=c.useMemo(()=>{switch(n){case br.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case br.DraggableRect:return o}},[n,o,l]),w=c.useRef(null),E=c.useCallback(()=>{const O=w.current;if(!O)return;const C=y.current.x*b.current.x,S=y.current.y*b.current.y;O.scrollBy(C,S)},[]),T=c.useMemo(()=>i===Uo.TreeOrder?[...u].reverse():u,[i,u]);c.useEffect(()=>{if(!s||!u.length||!x){g();return}for(const O of T){if(r?.(O)===!1)continue;const C=u.indexOf(O),S=f[C];if(!S)continue;const{direction:N,speed:I}=cS(O,S,x,t,p);for(const P of["x","y"])m[P][N[P]]||(I[P]=0,N[P]=0);if(I.x>0||I.y>0){g(),w.current=O,v(E,a),y.current=I,b.current=N;return}}y.current={x:0,y:0},b.current={x:0,y:0},g()},[t,E,r,g,s,a,JSON.stringify(x),JSON.stringify(m),v,u,T,f,JSON.stringify(p)])}const ES={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.Forward]:!1}};function SS(e){let{delta:t,disabled:n}=e;const r=Ua(t);return Gr(o=>{if(n||!r||!o)return ES;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Oe.Backward]:o.x[Oe.Backward]||s.x===-1,[Oe.Forward]:o.x[Oe.Forward]||s.x===1},y:{[Oe.Backward]:o.y[Oe.Backward]||s.y===-1,[Oe.Forward]:o.y[Oe.Forward]||s.y===1}}},[n,t,r])}function RS(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Gr(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function CS(e,t){return c.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var Or;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Or||(Or={}));var Wa;(function(e){e.Optimized="optimized"})(Wa||(Wa={}));const Ul=new Map;function AS(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,a]=c.useState(null),{frequency:i,measure:l,strategy:u}=o,f=c.useRef(e),d=y(),p=Mr(d),m=c.useCallback(function(b){b===void 0&&(b=[]),!p.current&&a(x=>x===null?b:x.concat(b.filter(w=>!x.includes(w))))},[p]),v=c.useRef(null),g=Gr(b=>{if(d&&!n)return Ul;if(!b||b===Ul||f.current!==e||s!=null){const x=new Map;for(let w of e){if(!w)continue;if(s&&s.length>0&&!s.includes(w.id)&&w.rect.current){x.set(w.id,w.rect.current);continue}const E=w.node.current,T=E?new tc(l(E),E):null;w.rect.current=T,T&&x.set(w.id,T)}return x}return b},[e,s,n,d,l]);return c.useEffect(()=>{f.current=e},[e]),c.useEffect(()=>{d||m()},[n,d]),c.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),c.useEffect(()=>{d||typeof i!="number"||v.current!==null||(v.current=setTimeout(()=>{m(),v.current=null},i))},[i,d,m,...r]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:s!=null};function y(){switch(u){case Or.Always:return!1;case Or.BeforeDragging:return n;default:return!n}}}function Fp(e,t){return Gr(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function TS(e,t){return Fp(e,t)}function PS(e){let{callback:t,disabled:n}=e;const r=Ji(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function Rs(e){let{callback:t,disabled:n}=e;const r=Ji(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function MS(e){return new tc(nr(e),e)}function ql(e,t,n){t===void 0&&(t=MS);const[r,o]=c.useState(null);function s(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const a=PS({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),i=Rs({callback:s});return _t(()=>{s(),e?(i?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(i?.disconnect(),a?.disconnect())},[e]),r}function _S(e){const t=Fp(e);return _p(e,t)}const zl=[];function NS(e){const t=c.useRef(e),n=Gr(r=>e?r&&r!==zl&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ss(e):zl,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function OS(e){const[t,n]=c.useState(null),r=c.useRef(e),o=c.useCallback(s=>{const a=sa(s.target);a&&n(i=>i?(i.set(a,za(a)),new Map(i)):null)},[]);return c.useEffect(()=>{const s=r.current;if(e!==s){a(s);const i=e.map(l=>{const u=sa(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,za(u)]):null}).filter(l=>l!=null);n(i.length?new Map(i):null),r.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(l=>{const u=sa(l);u?.removeEventListener("scroll",o)})}},[o,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>Vn(s,a),wt):jp(e):wt,[e,t])}function Kl(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const r=e!==wt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?_r(e,n.current):wt}function IS(e){c.useEffect(()=>{if(!Es)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function DS(e,t){return c.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=a=>{s(a,t)},n},{}),[e,t])}function $p(e){return c.useMemo(()=>e?oS(e):null,[e])}const Wl=[];function LS(e,t){t===void 0&&(t=nr);const[n]=e,r=$p(n?nt(n):null),[o,s]=c.useState(Wl);function a(){s(()=>e.length?e.map(l=>Dp(l)?r:new tc(t(l),l)):Wl)}const i=Rs({callback:a});return _t(()=>{i?.disconnect(),a(),e.forEach(l=>i?.observe(l))},[e]),o}function jS(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Wr(t)?t:e}function kS(e){let{measure:t}=e;const[n,r]=c.useState(null),o=c.useCallback(u=>{for(const{target:f}of u)if(Wr(f)){r(d=>{const p=t(f);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),s=Rs({callback:o}),a=c.useCallback(u=>{const f=jS(u);s?.disconnect(),f&&s?.observe(f),r(f?t(f):null)},[t,s]),[i,l]=Vo(a);return c.useMemo(()=>({nodeRef:i,rect:n,setRef:l}),[n,i,l])}const FS=[{sensor:oc,options:{}},{sensor:nc,options:{}}],$S={current:{}},xo={draggable:{measure:Hl},droppable:{measure:Hl,strategy:Or.WhileDragging,frequency:Wa.Optimized},dragOverlay:{measure:nr}};class xr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const HS={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Zo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:xo,measureDroppableContainers:Zo,windowRect:null,measuringScheduled:!1},BS={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Zo,draggableNodes:new Map,over:null,measureDroppableContainers:Zo},Cs=c.createContext(BS),Hp=c.createContext(HS);function VS(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xr}}}function ZS(e,t){switch(t.type){case Me.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Me.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Me.DragEnd:case Me.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Me.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new xr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Me.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new xr(e.droppable.containers);return a.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Me.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new xr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function US(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c.useContext(Cs),s=Ua(r),a=Ua(n?.id);return c.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!ec(s)||document.activeElement===s.target)return;const i=o.get(a);if(!i)return;const{activatorNode:l,node:u}=i;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=j3(f);if(d){d.focus();break}}})}},[r,t,o,a,s]),null}function qS(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function zS(e){return c.useMemo(()=>({draggable:{...xo.draggable,...e?.draggable},droppable:{...xo.droppable,...e?.droppable},dragOverlay:{...xo.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function KS(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=c.useRef(!1),{x:a,y:i}=typeof o=="boolean"?{x:o,y:o}:o;_t(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=_p(f,r);if(a||(d.x=0),i||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=Np(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,a,i,r,n])}const Bp=c.createContext({...wt,scaleX:1,scaleY:1});var Kt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Kt||(Kt={}));const WS=c.memo(function(t){var n,r,o,s;let{id:a,accessibility:i,autoScroll:l=!0,children:u,sensors:f=FS,collisionDetection:d=Q3,measuring:p,modifiers:m,...v}=t;const g=c.useReducer(ZS,void 0,VS),[y,b]=g,[x,w]=V3(),[E,T]=c.useState(Kt.Uninitialized),O=E===Kt.Initialized,{draggable:{active:C,nodes:S,translate:N},droppable:{containers:I}}=y,P=C!=null?S.get(C):null,H=c.useRef({initial:null,translated:null}),z=c.useMemo(()=>{var Pe;return C!=null?{id:C,data:(Pe=P?.data)!=null?Pe:$S,rect:H}:null},[C,P]),L=c.useRef(null),[k,A]=c.useState(null),[D,j]=c.useState(null),_=Mr(v,Object.values(v)),V=Yr("DndDescribedBy",a),K=c.useMemo(()=>I.getEnabled(),[I]),Y=zS(p),{droppableRects:B,measureDroppableContainers:q,measuringScheduled:U}=AS(K,{dragging:O,dependencies:[N.x,N.y],config:Y.droppable}),J=RS(S,C),$=c.useMemo(()=>D?qa(D):null,[D]),F=Ns(),ee=TS(J,Y.draggable.measure);KS({activeNode:C!=null?S.get(C):null,config:F.layoutShiftCompensation,initialRect:ee,measure:Y.draggable.measure});const Z=ql(J,Y.draggable.measure,ee),X=ql(J?J.parentElement:null),te=c.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=I.getNodeFor((n=te.current.over)==null?void 0:n.id),ue=kS({measure:Y.dragOverlay.measure}),Qe=(r=ue.nodeRef.current)!=null?r:J,Fe=O?(o=ue.rect)!=null?o:Z:null,qe=!!(ue.nodeRef.current&&ue.rect),ct=_S(qe?null:Z),Le=$p(Qe?nt(Qe):null),Ne=NS(O?ie??J:null),Zt=LS(Ne),Te=qS(m,{transform:{x:N.x-ct.x,y:N.y-ct.y,scaleX:1,scaleY:1},activatorEvent:D,active:z,activeNodeRect:Z,containerNodeRect:X,draggingNodeRect:Fe,over:te.current.over,overlayNodeRect:ue.rect,scrollableAncestors:Ne,scrollableAncestorRects:Zt,windowRect:Le}),lt=$?Vn($,N):null,An=OS(Ne),Tn=Kl(An),ce=Kl(An,[Z]),ge=Vn(Te,Tn),Re=Fe?eS(Fe,Te):null,ut=z&&Re?d({active:z,collisionRect:Re,droppableRects:B,droppableContainers:K,pointerCoordinates:lt}):null,It=Mp(ut,"id"),[vt,Dt]=c.useState(null),Ts=qe?Te:Vn(Te,ce),Ps=X3(Ts,(s=vt?.rect)!=null?s:null,Z),Pn=c.useRef(null),rr=c.useCallback((Pe,$e)=>{let{sensor:Q,options:pe}=$e;if(L.current==null)return;const fe=S.get(L.current);if(!fe)return;const me=Pe.nativeEvent,ze=new Q({active:L.current,activeNode:fe,event:me,options:pe,context:te,onAbort(de){if(!S.get(de))return;const{onDragAbort:Se}=_.current,Ce={id:de};Se?.(Ce),x({type:"onDragAbort",event:Ce})},onPending(de,rt,Se,Ce){if(!S.get(de))return;const{onDragPending:ot}=_.current,Lt={id:de,constraint:rt,initialCoordinates:Se,offset:Ce};ot?.(Lt),x({type:"onDragPending",event:Lt})},onStart(de){const rt=L.current;if(rt==null)return;const Se=S.get(rt);if(!Se)return;const{onDragStart:Ce}=_.current,Ut={activatorEvent:me,active:{id:rt,data:Se.data,rect:H}};$t.unstable_batchedUpdates(()=>{Ce?.(Ut),T(Kt.Initializing),b({type:Me.DragStart,initialCoordinates:de,active:rt}),x({type:"onDragStart",event:Ut}),A(Pn.current),j(me)})},onMove(de){b({type:Me.DragMove,coordinates:de})},onEnd:be(Me.DragEnd),onCancel:be(Me.DragCancel)});Pn.current=ze;function be(de){return async function(){const{active:Se,collisions:Ce,over:Ut,scrollAdjustedTranslate:ot}=te.current;let Lt=null;if(Se&&ot){const{cancelDrop:or}=_.current;Lt={activatorEvent:me,active:Se,collisions:Ce,delta:ot,over:Ut},de===Me.DragEnd&&typeof or=="function"&&await Promise.resolve(or(Lt))&&(de=Me.DragCancel)}L.current=null,$t.unstable_batchedUpdates(()=>{b({type:de}),T(Kt.Uninitialized),Dt(null),A(null),j(null),Pn.current=null;const or=de===Me.DragEnd?"onDragEnd":"onDragCancel";if(Lt){const Os=_.current[or];Os?.(Lt),x({type:or,event:Lt})}})}}},[S]),Ms=c.useCallback((Pe,$e)=>(Q,pe)=>{const fe=Q.nativeEvent,me=S.get(pe);if(L.current!==null||!me||fe.dndKit||fe.defaultPrevented)return;const ze={active:me};Pe(Q,$e.options,ze)===!0&&(fe.dndKit={capturedBy:$e.sensor},L.current=pe,rr(Q,$e))},[S,rr]),Mn=CS(f,Ms);IS(f),_t(()=>{Z&&E===Kt.Initializing&&T(Kt.Initialized)},[Z,E]),c.useEffect(()=>{const{onDragMove:Pe}=_.current,{active:$e,activatorEvent:Q,collisions:pe,over:fe}=te.current;if(!$e||!Q)return;const me={active:$e,activatorEvent:Q,collisions:pe,delta:{x:ge.x,y:ge.y},over:fe};$t.unstable_batchedUpdates(()=>{Pe?.(me),x({type:"onDragMove",event:me})})},[ge.x,ge.y]),c.useEffect(()=>{const{active:Pe,activatorEvent:$e,collisions:Q,droppableContainers:pe,scrollAdjustedTranslate:fe}=te.current;if(!Pe||L.current==null||!$e||!fe)return;const{onDragOver:me}=_.current,ze=pe.get(It),be=ze&&ze.rect.current?{id:ze.id,rect:ze.rect.current,data:ze.data,disabled:ze.disabled}:null,de={active:Pe,activatorEvent:$e,collisions:Q,delta:{x:fe.x,y:fe.y},over:be};$t.unstable_batchedUpdates(()=>{Dt(be),me?.(de),x({type:"onDragOver",event:de})})},[It]),_t(()=>{te.current={activatorEvent:D,active:z,activeNode:J,collisionRect:Re,collisions:ut,droppableRects:B,draggableNodes:S,draggingNode:Qe,draggingNodeRect:Fe,droppableContainers:I,over:vt,scrollableAncestors:Ne,scrollAdjustedTranslate:ge},H.current={initial:Fe,translated:Re}},[z,J,ut,Re,S,Qe,Fe,B,I,vt,Ne,ge]),wS({...F,delta:N,draggingRect:Re,pointerCoordinates:lt,scrollableAncestors:Ne,scrollableAncestorRects:Zt});const Rt=c.useMemo(()=>({active:z,activeNode:J,activeNodeRect:Z,activatorEvent:D,collisions:ut,containerNodeRect:X,dragOverlay:ue,draggableNodes:S,droppableContainers:I,droppableRects:B,over:vt,measureDroppableContainers:q,scrollableAncestors:Ne,scrollableAncestorRects:Zt,measuringConfiguration:Y,measuringScheduled:U,windowRect:Le}),[z,J,Z,D,ut,X,ue,S,I,B,vt,q,Ne,Zt,Y,U,Le]),_s=c.useMemo(()=>({activatorEvent:D,activators:Mn,active:z,activeNodeRect:Z,ariaDescribedById:{draggable:V},dispatch:b,draggableNodes:S,over:vt,measureDroppableContainers:q}),[D,Mn,z,Z,b,V,S,vt,q]);return M.createElement(Ap.Provider,{value:w},M.createElement(Cs.Provider,{value:_s},M.createElement(Hp.Provider,{value:Rt},M.createElement(Bp.Provider,{value:Ps},u)),M.createElement(US,{disabled:i?.restoreFocus===!1})),M.createElement(q3,{...i,hiddenTextDescribedById:V}));function Ns(){const Pe=k?.autoScrollEnabled===!1,$e=typeof l=="object"?l.enabled===!1:l===!1,Q=O&&!Pe&&!$e;return typeof l=="object"?{...l,enabled:Q}:{enabled:Q}}}),GS=c.createContext(null),Gl="button",YS="Draggable";function QS(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Yr(YS),{activators:a,activatorEvent:i,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=c.useContext(Cs),{role:m=Gl,roleDescription:v="draggable",tabIndex:g=0}=o??{},y=l?.id===t,b=c.useContext(y?Bp:GS),[x,w]=Vo(),[E,T]=Vo(),O=DS(a,t),C=Mr(n);_t(()=>(d.set(t,{id:t,key:s,node:x,activatorNode:E,data:C}),()=>{const N=d.get(t);N&&N.key===s&&d.delete(t)}),[d,t]);const S=c.useMemo(()=>({role:m,tabIndex:g,"aria-disabled":r,"aria-pressed":y&&m===Gl?!0:void 0,"aria-roledescription":v,"aria-describedby":f.draggable}),[r,m,g,y,v,f.draggable]);return{active:l,activatorEvent:i,activeNodeRect:u,attributes:S,isDragging:y,listeners:r?void 0:O,node:x,over:p,setNodeRef:w,setActivatorNodeRef:T,transform:b}}function XS(){return c.useContext(Hp)}const JS="Droppable",eR={timeout:25};function tR(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Yr(JS),{active:a,dispatch:i,over:l,measureDroppableContainers:u}=c.useContext(Cs),f=c.useRef({disabled:n}),d=c.useRef(!1),p=c.useRef(null),m=c.useRef(null),{disabled:v,updateMeasurementsFor:g,timeout:y}={...eR,...o},b=Mr(g??r),x=c.useCallback(()=>{if(!d.current){d.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),m.current=null},y)},[y]),w=Rs({callback:x,disabled:v||!a}),E=c.useCallback((S,N)=>{w&&(N&&(w.unobserve(N),d.current=!1),S&&w.observe(S))},[w]),[T,O]=Vo(E),C=Mr(t);return c.useEffect(()=>{!w||!T.current||(w.disconnect(),d.current=!1,w.observe(T.current))},[T,w]),c.useEffect(()=>(i({type:Me.RegisterDroppable,element:{id:r,key:s,disabled:n,node:T,rect:p,data:C}}),()=>i({type:Me.UnregisterDroppable,key:s,id:r})),[r]),c.useEffect(()=>{n!==f.current.disabled&&(i({type:Me.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,i]),{active:a,rect:p,isOver:l?.id===r,node:T,over:l,setNodeRef:O}}const I5=e=>{let{transform:t}=e;return{...t,y:0}},nR=e=>{let{transform:t}=e;return{...t,x:0}};function sc(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function rR(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function co(e){return e!==null&&e>=0}function oR(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function sR(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const lo={scaleX:1,scaleY:1},D5=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:a}=e;const i=(t=n[o])!=null?t:r;if(!i)return null;const l=aR(n,a,o);if(a===o){const u=n[s];return u?{x:o<s?u.left+u.width-(i.left+i.width):u.left-i.left,y:0,...lo}:null}return a>o&&a<=s?{x:-i.width-l,y:0,...lo}:a<o&&a>=s?{x:i.width+l,y:0,...lo}:{x:0,y:0,...lo}};function aR(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const Vp=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=sc(t,r,n),a=t[o],i=s[o];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},uo={scaleX:1,scaleY:1},iR=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:a}=e;const i=(t=s[n])!=null?t:r;if(!i)return null;if(o===n){const u=s[a];return u?{x:0,y:n<a?u.top+u.height-(i.top+i.height):u.top-i.top,...uo}:null}const l=cR(s,o,n);return o>n&&o<=a?{x:0,y:-i.height-l,...uo}:o<n&&o>=a?{x:0,y:i.height+l,...uo}:{x:0,y:0,...uo}};function cR(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const Zp="Sortable",Up=M.createContext({activeIndex:-1,containerId:Zp,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Vp,disabled:{draggable:!1,droppable:!1}});function lR(e){let{children:t,id:n,items:r,strategy:o=Vp,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:l,over:u,measureDroppableContainers:f}=XS(),d=Yr(Zp,n),p=i.rect!==null,m=c.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),v=a!=null,g=a?m.indexOf(a.id):-1,y=u?m.indexOf(u.id):-1,b=c.useRef(m),x=!oR(m,b.current),w=y!==-1&&g===-1||x,E=sR(s);_t(()=>{x&&v&&f(m)},[x,m,v,f]),c.useEffect(()=>{b.current=m},[m]);const T=c.useMemo(()=>({activeIndex:g,containerId:d,disabled:E,disableTransforms:w,items:m,overIndex:y,useDragOverlay:p,sortedRects:rR(m,l),strategy:o}),[g,d,E.draggable,E.droppable,w,m,y,l,p,o]);return M.createElement(Up.Provider,{value:T},t)}const uR=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return sc(n,r,o).indexOf(t)},dR=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:a,previousItems:i,previousContainerId:l,transition:u}=e;return!u||!r||i!==s&&o===a?!1:n?!0:a!==o&&t===l},fR={duration:200,easing:"ease"},qp="transform",hR=Nr.Transition.toString({property:qp,duration:0,easing:"linear"}),pR={roleDescription:"sortable"};function mR(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,a]=c.useState(null),i=c.useRef(n);return _t(()=>{if(!t&&n!==i.current&&r.current){const l=o.current;if(l){const u=nr(r.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&a(f)}}n!==i.current&&(i.current=n)},[t,n,r,o]),c.useEffect(()=>{s&&a(null)},[s]),s}function gR(e){let{animateLayoutChanges:t=dR,attributes:n,disabled:r,data:o,getNewIndex:s=uR,id:a,strategy:i,resizeObserverConfig:l,transition:u=fR}=e;const{items:f,containerId:d,activeIndex:p,disabled:m,disableTransforms:v,sortedRects:g,overIndex:y,useDragOverlay:b,strategy:x}=c.useContext(Up),w=vR(r,m),E=f.indexOf(a),T=c.useMemo(()=>({sortable:{containerId:d,index:E,items:f},...o}),[d,o,E,f]),O=c.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:C,node:S,isOver:N,setNodeRef:I}=tR({id:a,data:T,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...l}}),{active:P,activatorEvent:H,activeNodeRect:z,attributes:L,setNodeRef:k,listeners:A,isDragging:D,over:j,setActivatorNodeRef:_,transform:V}=QS({id:a,data:T,attributes:{...pR,...n},disabled:w.draggable}),K=O3(I,k),Y=!!P,B=Y&&!v&&co(p)&&co(y),q=!b&&D,U=q&&B?V:null,$=B?U??(i??x)({rects:g,activeNodeRect:z,activeIndex:p,overIndex:y,index:E}):null,F=co(p)&&co(y)?s({id:a,items:f,activeIndex:p,overIndex:y}):E,ee=P?.id,Z=c.useRef({activeId:ee,items:f,newIndex:F,containerId:d}),X=f!==Z.current.items,te=t({active:P,containerId:d,isDragging:D,isSorting:Y,id:a,index:E,items:f,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:u,wasDragging:Z.current.activeId!=null}),ie=mR({disabled:!te,index:E,node:S,rect:C});return c.useEffect(()=>{Y&&Z.current.newIndex!==F&&(Z.current.newIndex=F),d!==Z.current.containerId&&(Z.current.containerId=d),f!==Z.current.items&&(Z.current.items=f)},[Y,F,d,f]),c.useEffect(()=>{if(ee===Z.current.activeId)return;if(ee!=null&&Z.current.activeId==null){Z.current.activeId=ee;return}const Qe=setTimeout(()=>{Z.current.activeId=ee},50);return()=>clearTimeout(Qe)},[ee]),{active:P,activeIndex:p,attributes:L,data:T,rect:C,index:E,newIndex:F,items:f,isOver:N,isSorting:Y,isDragging:D,listeners:A,node:S,overIndex:y,over:j,setNodeRef:K,setActivatorNodeRef:_,setDroppableNodeRef:I,setDraggableNodeRef:k,transform:ie??$,transition:ue()};function ue(){if(ie||X&&Z.current.newIndex===E)return hR;if(!(q&&!ec(H)||!u)&&(Y||te))return Nr.Transition.toString({...u,property:qp})}}function vR(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function qo(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const yR=[oe.Down,oe.Right,oe.Up,oe.Left],bR=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(yR.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=o.get(d.id);if(p)switch(e.code){case oe.Down:r.top<p.top&&l.push(d);break;case oe.Up:r.top>p.top&&l.push(d);break;case oe.Left:r.left>p.left&&l.push(d);break;case oe.Right:r.left<p.left&&l.push(d);break}});const u=G3({collisionRect:r,droppableRects:o,droppableContainers:l});let f=Mp(u,"id");if(f===a?.id&&u.length>1&&(f=u[1].id),f!=null){const d=s.get(n.id),p=s.get(f),m=p?o.get(p.id):null,v=p?.node.current;if(v&&m&&d&&p){const y=Ss(v).some((O,C)=>i[C]!==O),b=zp(d,p),x=xR(d,p),w=y||!b?{x:0,y:0}:{x:x?r.width-m.width:0,y:x?r.height-m.height:0},E={x:m.left,y:m.top};return w.x&&w.y?E:_r(E,w)}}}};function zp(e,t){return!qo(e)||!qo(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function xR(e,t){return!qo(e)||!qo(t)||!zp(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const wR=e=>{const{data:t}=ku({queryKey:ve.notes.list(e.searchParams),async queryFn(){const n=await wp(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)},ER=e=>{const{data:t}=ku({queryKey:ve.notes.pinned(),async queryFn(){const n=await he(`
334
334
  query FetchPinnedNotes {
335
335
  pinnedNotes {
336
336
  id
@@ -338,7 +338,7 @@ __NOTE_ADDITIONAL_FIELDS__ id
338
338
  order
339
339
  }
340
340
  }
341
- `);if(n.type==="error")throw n;return n.pinnedNotes}});return h.jsx(h.Fragment,{children:e.render(t)})};function ER({query:e="",limit:t=50,offset:n=0}={}){return he(`query FetchTags(
341
+ `);if(n.type==="error")throw n;return n.pinnedNotes}});return h.jsx(h.Fragment,{children:e.render(t)})};function SR({query:e="",limit:t=50,offset:n=0}={}){return he(`query FetchTags(
342
342
  $searchFilter: SearchFilterInput,
343
343
  $pagination: PaginationInput
344
344
  ) {
@@ -353,9 +353,9 @@ __NOTE_ADDITIONAL_FIELDS__ id
353
353
  referenceCount
354
354
  }
355
355
  }
356
- }`,{searchFilter:{query:e},pagination:{limit:t,offset:n}})}function D5({name:e=""}){return he(`mutation CreateTag($name: String!) {
356
+ }`,{searchFilter:{query:e},pagination:{limit:t,offset:n}})}function L5({name:e=""}){return he(`mutation CreateTag($name: String!) {
357
357
  createTag(name: $name) {
358
358
  id
359
359
  name
360
360
  }
361
- }`,{name:e})}const SR="focus-ring-soft flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-default/70 outline-none transition-colors hover:text-fg-default active:cursor-grabbing touch-none",RR="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors";function CR({id:e,title:t,isActive:n=!1,children:r}){const{attributes:o,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:u,isDragging:f}=mR({id:e}),d={transform:Nr.Transform.toString(l),transition:u,opacity:f?.5:1};return h.jsxs("div",{ref:a,style:d,className:ae("group flex min-h-[40px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n&&"bg-hover-subtle"),children:[h.jsx("button",{type:"button",ref:i,"aria-label":`Reorder note ${t??"Untitled"}`,...o,...s,className:ae(SR,f?"cursor-grabbing":"cursor-grab"),children:h.jsx(Vv,{className:"size-4"})}),h.jsx(se,{as:"div",truncate:!0,variant:"body",weight:"medium",className:"min-w-0 flex-1",children:r})]})}function AR({notes:e,pathname:t,pinnedItems:n,setPinnedItems:r,handleDragEnd:o,sensors:s}){c.useEffect(()=>{r(e)},[e,r]);const a=n.length>0?n:e;return a.length===0?null:h.jsx(KS,{sensors:s,collisionDetection:K3,onDragEnd:o,modifiers:[tR],children:h.jsx(cR,{items:a.map(i=>i.id),strategy:aR,children:a.map(i=>h.jsx(CR,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:h.jsx(Pt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ae(RR,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:bg-hover-subtle hover:text-fg-default"),to:Jn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const TR=()=>{const e=ts({select:i=>i.pathname}),t=Gn(),[n,r]=c.useState([]),o=Zg({mutationFn:w3,onSuccess:()=>{t.invalidateQueries({queryKey:ve.notes.pinned(),exact:!0})}}),s=q3(kl(oc,{activationConstraint:{distance:8}}),kl(nc,{coordinateGetter:yR})),a=i=>{const{active:l,over:u}=i;u&&l.id!==u.id&&r(f=>{const d=f.findIndex(v=>v.id===l.id),p=f.findIndex(v=>v.id===u.id),m=sc(f,d,p);return o.mutate(m.map((v,g)=>({id:v.id,order:g}))),m})};return h.jsx("div",{className:"flex flex-col gap-1",children:h.jsx(mp,{fallback:h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ht,{height:"40px",opacity:.4}),h.jsx(Ht,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>h.jsx(Yi,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:h.jsx(wR,{render:i=>i.length>0?h.jsx(AR,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:r,handleDragEnd:a,sensors:s}):h.jsx(se,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note to keep it in view while the rest of the workspace changes."})})})})},PR="mb-2.5 flex items-center justify-between gap-3 px-1",MR="flex min-w-0 items-center gap-2",_R="inline-flex h-4 w-4 shrink-0 items-center justify-center text-fg-tertiary",NR=({title:e,icon:t,detail:n})=>h.jsxs("div",{className:PR,children:[h.jsxs("div",{className:MR,children:[t?h.jsx("span",{className:_R,children:t}):null,h.jsx(se,{variant:"label",weight:"medium",tone:"tertiary",children:e})]}),n?h.jsx(se,{as:"div",variant:"meta",weight:"medium",tone:"tertiary",children:n}):null]}),OR="flex flex-col gap-3.5 p-3 pt-2",IR="focus-ring-soft surface-base group flex w-full items-center justify-between gap-2.5 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",DR="flex items-center gap-2.5",LR="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",jR="flex flex-col",kR="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",FR=()=>{const{onCreate:e}=Sp();return h.jsxs("div",{className:OR,children:[h.jsxs("button",{type:"button",className:IR,onClick:()=>e(),children:[h.jsxs("span",{className:DR,children:[h.jsx("span",{className:LR,children:h.jsx(Gv,{className:"h-4.5 w-4.5",weight:"bold"})}),h.jsxs("span",{className:jR,children:[h.jsx(se,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),h.jsx(se,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),h.jsx(vr,{className:kR,weight:"bold"})]}),h.jsxs("section",{className:"pt-1",children:[h.jsx(NR,{title:"Pinned",icon:h.jsx(Xd,{className:"h-4 w-4",weight:"fill"})}),h.jsx(TR,{})]})]})},$R=e=>{const[t,n]=c.useState(!1),r=c.useRef(null),o=c.useRef(!0),s=c.useRef(0),a=c.useCallback(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);c.useEffect(()=>(o.current=!0,()=>{o.current=!1,a()}),[a]);const i=c.useCallback(l=>{s.current+=1;const u=s.current;a(),o.current&&n(!0),r.current=setTimeout(()=>{r.current=null,Promise.resolve().then(l).catch(()=>{}).finally(()=>{o.current&&s.current===u&&n(!1)})},e)},[a,e]);return[t,i]},HR="flex flex-col gap-2.5",BR="surface-base overflow-hidden",VR="grid-search-bar grid items-center border-b border-transparent px-2.5 py-1.5 transition-colors",ZR="border-border-subtle/70 bg-muted/25",UR="hover:bg-hover-subtle/60",Yl="flex h-10 items-center justify-center text-fg-tertiary transition-colors hover:text-fg-default sm:h-8",qR="h-10 w-full bg-transparent py-2 text-meta text-fg-default outline-none placeholder:text-fg-placeholder sm:h-8 sm:py-1.5",zR="px-1 py-1.5",KR="px-2 pb-0.5 pt-1",WR="px-2 pb-0.5 pt-1.5",GR="flex min-h-10 items-center gap-2 rounded-[10px] px-2.5 py-2 transition-colors hover:bg-hover-subtle sm:min-h-0 sm:px-2 sm:py-1.5",YR="min-w-0 flex-1",QR="flex flex-wrap gap-1.5 px-1.5 py-1",XR="inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-2 py-0.75 sm:py-0.5",JR="mt-1 border-t border-border-subtle/50 px-2 pb-0.5 pt-1.5",eC="flex min-h-9 items-center gap-1.5 text-fg-secondary transition-colors hover:text-fg-default",tC=()=>{const e=En(),[t,n]=c.useState(""),[r,o]=c.useState([]),[s,a]=c.useState([]),[,i]=$R(500);c.useEffect(()=>{if(t.length<=0){i(()=>{}),o([]),a([]);return}i(()=>{wp({query:t,limit:5}).then(d=>{d.type==="success"&&o(d.allNotes.notes)}),ER({query:t,limit:5}).then(d=>{d.type==="success"&&a(d.allTags.tags)})})},[t,i]);const l=d=>{d?.preventDefault(),e({to:dp,search:{query:t,page:1}})},u=()=>{n("")},f=r.length>0||s.length>0;return h.jsx("div",{className:"p-3",children:h.jsx("form",{className:HR,onSubmit:l,children:h.jsxs("div",{className:BR,children:[h.jsxs("div",{className:`${VR} ${f?ZR:UR}`,children:[h.jsx("button",{type:"submit",className:Yl,children:h.jsx(Wv,{className:"h-4.5 w-4.5",weight:"bold"})}),h.jsx("input",{type:"text",placeholder:"Search notes or tags",value:t,onChange:d=>n(d.target.value),className:qR}),t&&h.jsx("button",{type:"button",className:Yl,onClick:u,children:h.jsx(rf,{className:"h-4 w-4",weight:"bold"})})]}),f&&h.jsxs("div",{className:zR,children:[r.length>0&&h.jsxs("div",{children:[s.length>0&&h.jsx(se,{as:"div",variant:"label",weight:"medium",tone:"tertiary",className:KR,children:"Notes"}),r.map(({id:d,title:p})=>h.jsxs(Pt,{to:Jn,params:{id:d},className:GR,children:[h.jsx(qv,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),h.jsx(se,{as:"span",truncate:!0,variant:"meta",weight:"medium",className:YR,children:p||"Untitled"})]},d))]}),s.length>0&&h.jsxs("div",{children:[r.length>0&&h.jsx(se,{as:"div",variant:"label",weight:"medium",tone:"tertiary",className:WR,children:"Tags"}),h.jsx("div",{className:QR,children:s.map(({id:d,name:p})=>h.jsx(Pt,{to:Gi,params:{id:d},search:{page:1},children:h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:XR,children:p})},d))})]}),h.jsx("div",{className:JR,children:h.jsxs("button",{type:"submit",className:eC,children:[h.jsx(se,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:"View all results"}),h.jsx(vr,{className:"h-3.5 w-3.5",weight:"bold"})]})})]})]})})})},nC=[{name:"Notes",path:Kr,icon:Kd},{name:"Views",path:ip,icon:Uv},{name:"Graph",path:up,icon:Jv},{name:"Calendar",path:cp,icon:$v},{name:"Reminders",path:lp,icon:Fv},{name:"Tags",path:fp,icon:Xv},{name:"Setting",path:hp,icon:zv}],rC=()=>{const e=ts({select:t=>t.pathname});return h.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:nC.map((t,n)=>{const r=e===t.path||t.path!==Kr&&e.startsWith(`${t.path}/`);return h.jsxs(c.Fragment,{children:[n>0&&h.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),h.jsx(Pt,{to:t.path,children:h.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[h.jsx(t.icon,{className:"size-5",weight:r?"fill":"regular"}),h.jsx(se,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:t.name})]})})]},t.path)})})},oC=({children:e})=>h.jsx(s3,{sidebar:h.jsxs(h.Fragment,{children:[h.jsx(h3,{}),h.jsx(tC,{}),h.jsx(YE,{}),h.jsx(FR,{})]}),topNavigation:h.jsx(rC,{}),children:e}),sC=["updatedAt","createdAt"],aC=["asc","desc"],iC=["create","update"],As=e=>Array.isArray(e)?e[0]:e,wn=(e,t,{min:n=1,max:r=Number.MAX_SAFE_INTEGER}={})=>{const o=As(e),s=typeof o=="number"?o:typeof o=="string"?Number(o):Number.NaN;return!Number.isInteger(s)||s<n||s>r?t:s},cC=(e,t,n)=>{const r=wn(e,Number.NaN);return t.includes(r)?r:n},lC=(e,t=!1)=>{const n=As(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},Kp=(e,t="")=>{const n=As(e);return typeof n=="string"?n:t},Ga=(e,t,n)=>{const r=As(e);return typeof r!="string"?n:t.includes(r)?r:n},uC=e=>({page:wn(e.page,1),limit:cC(e.limit,Wi,xs),sortBy:Ga(e.sortBy,sC,"updatedAt"),sortOrder:Ga(e.sortOrder,aC,"desc"),pinnedFirst:lC(e.pinnedFirst,!1)}),Cn=e=>({page:wn(e.page,1)}),dC=e=>({page:wn(e.page,1),query:Kp(e.query,"")}),fC=e=>({year:wn(e.year,He().year(),{min:1970,max:9999}),month:wn(e.month,He().month()+1,{min:1,max:12}),type:Ga(e.type,iC,"create")}),hC=e=>({page:wn(e.page,1),sectionId:Kp(e.sectionId,"")}),Ql=zm(Kr);function pC(){const e=Ql.useNavigate(),{limit:t,page:n,sortBy:r,sortOrder:o,pinnedFirst:s}=Ql.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=Sp(),u=f=>{e({search:d=>({...d,...f})})};return h.jsxs(ws,{title:"",variant:"none",children:[h.jsxs("div",{className:"flex flex-col gap-5",children:[h.jsx(zw,{itemsPerPage:t,onItemsPerPageChange:f=>u({limit:f,page:1}),sortBy:r,onSortByChange:f=>u({sortBy:f,page:1}),sortOrder:o,onSortOrderChange:f=>u({sortOrder:f,page:1}),pinnedFirst:s,onPinnedFirstChange:f=>u({pinnedFirst:f,page:1})}),h.jsx(mp,{fallback:h.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[h.jsx(Ht,{height:"112px"}),h.jsx(Ht,{height:"112px"}),h.jsx(Ht,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,r,o,s],children:h.jsx(xR,{searchParams:{offset:(n-1)*t,limit:t,sortBy:r,sortOrder:o,pinnedFirst:s},render:({notes:f,totalCount:d})=>h.jsx(wl,{fallback:h.jsx(lh,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"grid-auto-cards grid gap-5",children:f.map(p=>h.jsx(E3,{...p,onPinned:()=>i(p.id,p.pinned),onDelete:()=>a(p.id)},p.id))}),h.jsx(wl,{fallback:null,children:d&&t<d&&h.jsx(dh,{page:n,last:Math.ceil(d/t),onChange:p=>{u({page:p})}})})]})})})})]}),l]})}const De=Ym({component:()=>h.jsx(oC,{children:h.jsx(Eu,{})}),errorComponent:kE,notFoundComponent:FE}),mC=Ie({getParentRoute:()=>De,path:Kr,component:pC,validateSearch:uC}),gC=Ie({getParentRoute:()=>De,path:cp,component:Ue(()=>Ze(()=>import("./Calendar-BuHuea3u.js"),__vite__mapDeps([0,1,2,3,4]))),pendingComponent:()=>h.jsx(ke,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:fC}),vC=Ie({getParentRoute:()=>De,path:ip,component:Ue(()=>Ze(()=>import("./Views-BLUk_24_.js"),__vite__mapDeps([5,1,2,3,6,7,8]))),pendingComponent:()=>h.jsx(ke,{title:"Loading views",description:"Preparing your saved dashboards."})}),yC=Ie({getParentRoute:()=>De,path:lp,component:Ue(()=>Ze(()=>import("./Reminders-06CF__C2.js"),__vite__mapDeps([9,1,2,3,10]))),pendingComponent:()=>h.jsx(ke,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:Cn}),bC=Ie({getParentRoute:()=>De,path:up,component:Ue(()=>Ze(()=>import("./Graph-BddGuIWA.js"),__vite__mapDeps([11,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading graph",description:"Preparing the linked note constellation."})}),xC=Ie({getParentRoute:()=>De,path:dp,component:Ue(()=>Ze(()=>import("./Search-DtLyJR_o.js"),__vite__mapDeps([12,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:dC}),wC=Ie({getParentRoute:()=>De,path:fp,component:Ue(()=>Ze(()=>import("./Tag-KGPO2bT9.js"),__vite__mapDeps([13,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:Cn}),EC=Ie({getParentRoute:()=>De,path:Jn,component:Ue(()=>Ze(()=>import("./Note-Dl6-yoQO.js"),__vite__mapDeps([14,1,2,3,4,7,10,8,15]))),pendingComponent:()=>h.jsx(ke,{title:"Loading note",description:"Preparing the editor and note content."})}),SC=Ie({getParentRoute:()=>De,path:Gi,component:Ue(()=>Ze(()=>import("./TagNotes-CkmcnqM6.js"),__vite__mapDeps([16,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:Cn}),RC=Ie({getParentRoute:()=>De,path:PE,component:Ue(()=>Ze(()=>import("./ViewNotes-Khdg4Ynn.js"),__vite__mapDeps([17,1,2,3,6]))),pendingComponent:()=>h.jsx(ke,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:hC}),CC=Ie({getParentRoute:()=>De,path:hp,component:Ue(()=>Ze(()=>import("./index-CbhzIgIR.js"),__vite__mapDeps([18,1,2,3,19,20]))),pendingComponent:()=>h.jsx(ke,{title:"Loading settings",description:"Preparing workspace preferences."})}),AC=Ie({getParentRoute:()=>De,path:ME,component:Ue(()=>Ze(()=>import("./mcp-CHthNSpj.js"),__vite__mapDeps([21,1,2,3,7]))),pendingComponent:()=>h.jsx(ke,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),TC=Ie({getParentRoute:()=>De,path:_E,component:Ue(()=>Ze(()=>import("./trash-Dw2FQsut.js"),__vite__mapDeps([22,1,2,3,7]))),pendingComponent:()=>h.jsx(ke,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:Cn}),PC=Ie({getParentRoute:()=>De,path:NE,component:Ue(()=>Ze(()=>import("./manage-image-mHebal-S.js"),__vite__mapDeps([23,1,2,3,15,24,7,19]))),pendingComponent:()=>h.jsx(ke,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:Cn}),MC=Ie({getParentRoute:()=>De,path:OE,component:Ue(()=>Ze(()=>import("./manage-image-detail-CImm-cQJ.js"),__vite__mapDeps([25,1,2,3,15,24,7,19,20]))),pendingComponent:()=>h.jsx(ke,{title:"Loading image detail",description:"Preparing references for the selected image."})}),_C=Ie({getParentRoute:()=>De,path:DE,component:Ue(()=>Ze(()=>import("./properties-DRB3IoO1.js"),__vite__mapDeps([26,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:Cn}),NC=Ie({getParentRoute:()=>De,path:IE,component:Ue(()=>Ze(()=>import("./placeholder-BMXsrVZ1.js"),__vite__mapDeps([27,1,2,3,7,8]))),pendingComponent:()=>h.jsx(ke,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:Cn}),OC=De.addChildren([mC,vC,gC,yC,bC,xC,wC,EC,SC,RC,CC,AC,TC,PC,MC,NC,_C]),IC=og({routeTree:OC,defaultPendingComponent:()=>h.jsx(ke,{title:"Loading page",description:"Preparing the next route."})});function DC(){const e=Bo(n=>n.setSystemTheme),t=Bo(n=>n.setTheme);return c.useEffect(()=>{const n=Ho();return n&&t(n),l1.listenThemeChange(r=>{Ho()||e(r?"dark":"light")},n==null)},[e,t]),h.jsx(Y8,{children:h.jsx(ig,{router:IC})})}Bo.setState({theme:GE()});O8();s1.createRoot(document.getElementById("root")).render(h.jsx(M.StrictMode,{children:h.jsx(DC,{})}));export{Nr as $,q3 as A,bt as B,cp as C,X4 as D,kl as E,yR as F,oc as G,m5 as H,ex as I,lh as J,nc as K,Pt as L,Ft as M,Jn as N,KS as O,ws as P,O5 as Q,K3 as R,yo as S,se as T,cR as U,PE as V,I5 as W,tR as X,aR as Y,mR as Z,Vv as _,Fv as a,f3 as a$,mp as a0,dh as a1,lp as a2,Yi as a3,En as a4,Bo as a5,ku as a6,M5 as a7,rf as a8,xR as a9,Ll as aA,b5 as aB,q4 as aC,z4 as aD,ah as aE,Q4 as aF,ch as aG,ih as aH,DE as aI,zv as aJ,Xv as aK,f5 as aL,E3 as aM,ME as aN,NE as aO,IE as aP,Gv as aQ,ye as aR,tw as aS,C5 as aT,T5 as aU,P5 as aV,S3 as aW,A5 as aX,OE as aY,Ba as aZ,p5 as a_,dp as aa,xs as ab,wl as ac,Gi as ad,fp as ae,Ge as af,w5 as ag,Zg as ah,R5 as ai,S5 as aj,E5 as ak,v3 as al,Hv as am,Kv as an,wp as ao,D5 as ap,x5 as aq,l5 as ar,h5 as as,N5 as at,K8 as au,Sp as av,_E as aw,Xd as ax,_5 as ay,y3 as az,$v as b,d5 as b0,g5 as b1,v5 as b2,y5 as b3,P3 as b4,M3 as b5,_3 as b6,je as b7,ae as c,He as d,Fn as e,zs as f,vr as g,he as h,Ht as i,zm as j,Gn as k,ox as l,cf as m,uh as n,pw as o,Ae as p,ve as q,mw as r,qv as s,Ep as t,Vg as u,kf as v,rw as w,Uw as x,sf as y,ER as z};
361
+ }`,{name:e})}const RR="focus-ring-soft flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-default/70 outline-none transition-colors hover:text-fg-default active:cursor-grabbing touch-none",CR="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors";function AR({id:e,title:t,isActive:n=!1,children:r}){const{attributes:o,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:u,isDragging:f}=gR({id:e}),d={transform:Nr.Transform.toString(l),transition:u,opacity:f?.5:1};return h.jsxs("div",{ref:a,style:d,className:ae("group flex min-h-[40px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n&&"bg-hover-subtle"),children:[h.jsx("button",{type:"button",ref:i,"aria-label":`Reorder note ${t??"Untitled"}`,...o,...s,className:ae(RR,f?"cursor-grabbing":"cursor-grab"),children:h.jsx(Vv,{className:"size-4"})}),h.jsx(se,{as:"div",truncate:!0,variant:"body",weight:"medium",className:"min-w-0 flex-1",children:r})]})}function TR({notes:e,pathname:t,pinnedItems:n,setPinnedItems:r,handleDragEnd:o,sensors:s}){c.useEffect(()=>{r(e)},[e,r]);const a=n.length>0?n:e;return a.length===0?null:h.jsx(WS,{sensors:s,collisionDetection:W3,onDragEnd:o,modifiers:[nR],children:h.jsx(lR,{items:a.map(i=>i.id),strategy:iR,children:a.map(i=>h.jsx(AR,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:h.jsx(Pt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ae(CR,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:bg-hover-subtle hover:text-fg-default"),to:Jn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const PR=()=>{const e=ts({select:i=>i.pathname}),t=Gn(),[n,r]=c.useState([]),o=Zg({mutationFn:E3,onSuccess:()=>{t.invalidateQueries({queryKey:ve.notes.pinned(),exact:!0})}}),s=z3(kl(oc,{activationConstraint:{distance:8}}),kl(nc,{coordinateGetter:bR})),a=i=>{const{active:l,over:u}=i;u&&l.id!==u.id&&r(f=>{const d=f.findIndex(v=>v.id===l.id),p=f.findIndex(v=>v.id===u.id),m=sc(f,d,p);return o.mutate(m.map((v,g)=>({id:v.id,order:g}))),m})};return h.jsx("div",{className:"flex flex-col gap-1",children:h.jsx(mp,{fallback:h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ht,{height:"40px",opacity:.4}),h.jsx(Ht,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>h.jsx(Yi,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:h.jsx(ER,{render:i=>i.length>0?h.jsx(TR,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:r,handleDragEnd:a,sensors:s}):h.jsx(se,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note to keep it in view while the rest of the workspace changes."})})})})},MR="mb-2.5 flex items-center justify-between gap-3 px-1",_R="flex min-w-0 items-center gap-2",NR="inline-flex h-4 w-4 shrink-0 items-center justify-center text-fg-tertiary",OR=({title:e,icon:t,detail:n})=>h.jsxs("div",{className:MR,children:[h.jsxs("div",{className:_R,children:[t?h.jsx("span",{className:NR,children:t}):null,h.jsx(se,{variant:"label",weight:"medium",tone:"tertiary",children:e})]}),n?h.jsx(se,{as:"div",variant:"meta",weight:"medium",tone:"tertiary",children:n}):null]}),IR="flex flex-col gap-3.5 p-3 pt-2",DR="focus-ring-soft surface-base group flex w-full items-center justify-between gap-2.5 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",LR="flex items-center gap-2.5",jR="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",kR="flex flex-col",FR="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",$R=()=>{const{onCreate:e}=Sp();return h.jsxs("div",{className:IR,children:[h.jsxs("button",{type:"button",className:DR,onClick:()=>e(),children:[h.jsxs("span",{className:LR,children:[h.jsx("span",{className:jR,children:h.jsx(Gv,{className:"h-4.5 w-4.5",weight:"bold"})}),h.jsxs("span",{className:kR,children:[h.jsx(se,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),h.jsx(se,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),h.jsx(vr,{className:FR,weight:"bold"})]}),h.jsxs("section",{className:"pt-1",children:[h.jsx(OR,{title:"Pinned",icon:h.jsx(Xd,{className:"h-4 w-4",weight:"fill"})}),h.jsx(PR,{})]})]})},HR=e=>{const[t,n]=c.useState(!1),r=c.useRef(null),o=c.useRef(!0),s=c.useRef(0),a=c.useCallback(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);c.useEffect(()=>(o.current=!0,()=>{o.current=!1,a()}),[a]);const i=c.useCallback(l=>{s.current+=1;const u=s.current;a(),o.current&&n(!0),r.current=setTimeout(()=>{r.current=null,Promise.resolve().then(l).catch(()=>{}).finally(()=>{o.current&&s.current===u&&n(!1)})},e)},[a,e]);return[t,i]},BR="flex flex-col gap-2.5",VR="surface-base overflow-hidden",ZR="grid-search-bar grid items-center border-b border-transparent px-2.5 py-1.5 transition-colors",UR="border-border-subtle/70 bg-muted/25",qR="hover:bg-hover-subtle/60",Yl="flex h-10 items-center justify-center text-fg-tertiary transition-colors hover:text-fg-default sm:h-8",zR="h-10 w-full bg-transparent py-2 text-meta text-fg-default outline-none placeholder:text-fg-placeholder sm:h-8 sm:py-1.5",KR="px-1 py-1.5",WR="px-2 pb-0.5 pt-1",GR="px-2 pb-0.5 pt-1.5",YR="flex min-h-10 items-center gap-2 rounded-[10px] px-2.5 py-2 transition-colors hover:bg-hover-subtle sm:min-h-0 sm:px-2 sm:py-1.5",QR="min-w-0 flex-1",XR="flex flex-wrap gap-1.5 px-1.5 py-1",JR="inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-2 py-0.75 sm:py-0.5",eC="mt-1 border-t border-border-subtle/50 px-2 pb-0.5 pt-1.5",tC="flex min-h-9 items-center gap-1.5 text-fg-secondary transition-colors hover:text-fg-default",nC=()=>{const e=En(),[t,n]=c.useState(""),[r,o]=c.useState([]),[s,a]=c.useState([]),[,i]=HR(500);c.useEffect(()=>{if(t.length<=0){i(()=>{}),o([]),a([]);return}i(()=>{wp({query:t,limit:5}).then(d=>{d.type==="success"&&o(d.allNotes.notes)}),SR({query:t,limit:5}).then(d=>{d.type==="success"&&a(d.allTags.tags)})})},[t,i]);const l=d=>{d?.preventDefault(),e({to:dp,search:{query:t,page:1}})},u=()=>{n("")},f=r.length>0||s.length>0;return h.jsx("div",{className:"p-3",children:h.jsx("form",{className:BR,onSubmit:l,children:h.jsxs("div",{className:VR,children:[h.jsxs("div",{className:`${ZR} ${f?UR:qR}`,children:[h.jsx("button",{type:"submit",className:Yl,children:h.jsx(Wv,{className:"h-4.5 w-4.5",weight:"bold"})}),h.jsx("input",{type:"text",placeholder:"Search notes or tags",value:t,onChange:d=>n(d.target.value),className:zR}),t&&h.jsx("button",{type:"button",className:Yl,onClick:u,children:h.jsx(rf,{className:"h-4 w-4",weight:"bold"})})]}),f&&h.jsxs("div",{className:KR,children:[r.length>0&&h.jsxs("div",{children:[s.length>0&&h.jsx(se,{as:"div",variant:"label",weight:"medium",tone:"tertiary",className:WR,children:"Notes"}),r.map(({id:d,title:p})=>h.jsxs(Pt,{to:Jn,params:{id:d},className:YR,children:[h.jsx(qv,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),h.jsx(se,{as:"span",truncate:!0,variant:"meta",weight:"medium",className:QR,children:p||"Untitled"})]},d))]}),s.length>0&&h.jsxs("div",{children:[r.length>0&&h.jsx(se,{as:"div",variant:"label",weight:"medium",tone:"tertiary",className:GR,children:"Tags"}),h.jsx("div",{className:XR,children:s.map(({id:d,name:p})=>h.jsx(Pt,{to:Gi,params:{id:d},search:{page:1},children:h.jsx(se,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:JR,children:p})},d))})]}),h.jsx("div",{className:eC,children:h.jsxs("button",{type:"submit",className:tC,children:[h.jsx(se,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:"View all results"}),h.jsx(vr,{className:"h-3.5 w-3.5",weight:"bold"})]})})]})]})})})},rC=[{name:"Notes",path:Kr,icon:Kd},{name:"Views",path:ip,icon:Uv},{name:"Graph",path:up,icon:Jv},{name:"Calendar",path:cp,icon:$v},{name:"Reminders",path:lp,icon:Fv},{name:"Tags",path:fp,icon:Xv},{name:"Setting",path:hp,icon:zv}],oC=()=>{const e=ts({select:t=>t.pathname});return h.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:rC.map((t,n)=>{const r=e===t.path||t.path!==Kr&&e.startsWith(`${t.path}/`);return h.jsxs(c.Fragment,{children:[n>0&&h.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),h.jsx(Pt,{to:t.path,children:h.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[h.jsx(t.icon,{className:"size-5",weight:r?"fill":"regular"}),h.jsx(se,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:t.name})]})})]},t.path)})})},sC=({children:e})=>h.jsx(a3,{sidebar:h.jsxs(h.Fragment,{children:[h.jsx(p3,{}),h.jsx(nC,{}),h.jsx(YE,{}),h.jsx($R,{})]}),topNavigation:h.jsx(oC,{}),children:e}),aC=["updatedAt","createdAt"],iC=["asc","desc"],cC=["create","update"],As=e=>Array.isArray(e)?e[0]:e,wn=(e,t,{min:n=1,max:r=Number.MAX_SAFE_INTEGER}={})=>{const o=As(e),s=typeof o=="number"?o:typeof o=="string"?Number(o):Number.NaN;return!Number.isInteger(s)||s<n||s>r?t:s},lC=(e,t,n)=>{const r=wn(e,Number.NaN);return t.includes(r)?r:n},uC=(e,t=!1)=>{const n=As(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},Kp=(e,t="")=>{const n=As(e);return typeof n=="string"?n:t},Ga=(e,t,n)=>{const r=As(e);return typeof r!="string"?n:t.includes(r)?r:n},dC=e=>({page:wn(e.page,1),limit:lC(e.limit,Wi,xs),sortBy:Ga(e.sortBy,aC,"updatedAt"),sortOrder:Ga(e.sortOrder,iC,"desc"),pinnedFirst:uC(e.pinnedFirst,!1)}),Cn=e=>({page:wn(e.page,1)}),fC=e=>({page:wn(e.page,1),query:Kp(e.query,"")}),hC=e=>({year:wn(e.year,He().year(),{min:1970,max:9999}),month:wn(e.month,He().month()+1,{min:1,max:12}),type:Ga(e.type,cC,"create")}),pC=e=>({page:wn(e.page,1),sectionId:Kp(e.sectionId,"")}),Ql=zm(Kr);function mC(){const e=Ql.useNavigate(),{limit:t,page:n,sortBy:r,sortOrder:o,pinnedFirst:s}=Ql.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=Sp(),u=f=>{e({search:d=>({...d,...f})})};return h.jsxs(ws,{title:"",variant:"none",children:[h.jsxs("div",{className:"flex flex-col gap-5",children:[h.jsx(zw,{itemsPerPage:t,onItemsPerPageChange:f=>u({limit:f,page:1}),sortBy:r,onSortByChange:f=>u({sortBy:f,page:1}),sortOrder:o,onSortOrderChange:f=>u({sortOrder:f,page:1}),pinnedFirst:s,onPinnedFirstChange:f=>u({pinnedFirst:f,page:1})}),h.jsx(mp,{fallback:h.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[h.jsx(Ht,{height:"112px"}),h.jsx(Ht,{height:"112px"}),h.jsx(Ht,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,r,o,s],children:h.jsx(wR,{searchParams:{offset:(n-1)*t,limit:t,sortBy:r,sortOrder:o,pinnedFirst:s},render:({notes:f,totalCount:d})=>h.jsx(wl,{fallback:h.jsx(lh,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"grid-auto-cards grid gap-5",children:f.map(p=>h.jsx(S3,{...p,onPinned:()=>i(p.id,p.pinned),onDelete:()=>a(p.id)},p.id))}),h.jsx(wl,{fallback:null,children:d&&t<d&&h.jsx(dh,{page:n,last:Math.ceil(d/t),onChange:p=>{u({page:p})}})})]})})})})]}),l]})}const De=Ym({component:()=>h.jsx(sC,{children:h.jsx(Eu,{})}),errorComponent:kE,notFoundComponent:FE}),gC=Ie({getParentRoute:()=>De,path:Kr,component:mC,validateSearch:dC}),vC=Ie({getParentRoute:()=>De,path:cp,component:Ue(()=>Ze(()=>import("./Calendar-BqlwdVTC.js"),__vite__mapDeps([0,1,2,3,4]))),pendingComponent:()=>h.jsx(ke,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:hC}),yC=Ie({getParentRoute:()=>De,path:ip,component:Ue(()=>Ze(()=>import("./Views-7eBt89wS.js"),__vite__mapDeps([5,1,2,3,6,7,8]))),pendingComponent:()=>h.jsx(ke,{title:"Loading views",description:"Preparing your saved dashboards."})}),bC=Ie({getParentRoute:()=>De,path:lp,component:Ue(()=>Ze(()=>import("./Reminders-huKwxqd6.js"),__vite__mapDeps([9,1,2,3,10]))),pendingComponent:()=>h.jsx(ke,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:Cn}),xC=Ie({getParentRoute:()=>De,path:up,component:Ue(()=>Ze(()=>import("./Graph-BMciMgqf.js"),__vite__mapDeps([11,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading graph",description:"Preparing the linked note constellation."})}),wC=Ie({getParentRoute:()=>De,path:dp,component:Ue(()=>Ze(()=>import("./Search-BsSLNGNy.js"),__vite__mapDeps([12,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:fC}),EC=Ie({getParentRoute:()=>De,path:fp,component:Ue(()=>Ze(()=>import("./Tag-e0SLJ_ZM.js"),__vite__mapDeps([13,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:Cn}),SC=Ie({getParentRoute:()=>De,path:Jn,component:Ue(()=>Ze(()=>import("./Note-DlOYlFsr.js"),__vite__mapDeps([14,1,2,3,4,7,10,8,15]))),pendingComponent:()=>h.jsx(ke,{title:"Loading note",description:"Preparing the editor and note content."})}),RC=Ie({getParentRoute:()=>De,path:Gi,component:Ue(()=>Ze(()=>import("./TagNotes-BazFumXJ.js"),__vite__mapDeps([16,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:Cn}),CC=Ie({getParentRoute:()=>De,path:PE,component:Ue(()=>Ze(()=>import("./ViewNotes-Bs9GD1Xm.js"),__vite__mapDeps([17,1,2,3,6]))),pendingComponent:()=>h.jsx(ke,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:pC}),AC=Ie({getParentRoute:()=>De,path:hp,component:Ue(()=>Ze(()=>import("./index-Dg5dH_cy.js"),__vite__mapDeps([18,1,2,3,19,20]))),pendingComponent:()=>h.jsx(ke,{title:"Loading settings",description:"Preparing workspace preferences."})}),TC=Ie({getParentRoute:()=>De,path:ME,component:Ue(()=>Ze(()=>import("./mcp-DFrfTamn.js"),__vite__mapDeps([21,1,2,3,7]))),pendingComponent:()=>h.jsx(ke,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),PC=Ie({getParentRoute:()=>De,path:_E,component:Ue(()=>Ze(()=>import("./trash-iAbrwiEg.js"),__vite__mapDeps([22,1,2,3,7]))),pendingComponent:()=>h.jsx(ke,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:Cn}),MC=Ie({getParentRoute:()=>De,path:NE,component:Ue(()=>Ze(()=>import("./manage-image-DiRFDinY.js"),__vite__mapDeps([23,1,2,3,15,24,7,19]))),pendingComponent:()=>h.jsx(ke,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:Cn}),_C=Ie({getParentRoute:()=>De,path:OE,component:Ue(()=>Ze(()=>import("./manage-image-detail-B6crq-X5.js"),__vite__mapDeps([25,1,2,3,15,24,7,19,20]))),pendingComponent:()=>h.jsx(ke,{title:"Loading image detail",description:"Preparing references for the selected image."})}),NC=Ie({getParentRoute:()=>De,path:DE,component:Ue(()=>Ze(()=>import("./properties-D8v-iyhQ.js"),__vite__mapDeps([26,1,2,3]))),pendingComponent:()=>h.jsx(ke,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:Cn}),OC=Ie({getParentRoute:()=>De,path:IE,component:Ue(()=>Ze(()=>import("./placeholder-B-uiiS2o.js"),__vite__mapDeps([27,1,2,3,7,8]))),pendingComponent:()=>h.jsx(ke,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:Cn}),IC=De.addChildren([gC,yC,vC,bC,xC,wC,EC,SC,RC,CC,AC,TC,PC,MC,_C,OC,NC]),DC=og({routeTree:IC,defaultPendingComponent:()=>h.jsx(ke,{title:"Loading page",description:"Preparing the next route."})});function LC(){const e=Bo(n=>n.setSystemTheme),t=Bo(n=>n.setTheme);return c.useEffect(()=>{const n=Ho();return n&&t(n),l1.listenThemeChange(r=>{Ho()||e(r?"dark":"light")},n==null)},[e,t]),h.jsx(Y8,{children:h.jsx(ig,{router:DC})})}Bo.setState({theme:GE()});O8();s1.createRoot(document.getElementById("root")).render(h.jsx(M.StrictMode,{children:h.jsx(LC,{})}));export{Nr as $,z3 as A,bt as B,cp as C,X4 as D,kl as E,bR as F,oc as G,g5 as H,ex as I,lh as J,nc as K,Pt as L,Ft as M,Jn as N,WS as O,ws as P,I5 as Q,W3 as R,yo as S,se as T,lR as U,PE as V,D5 as W,nR as X,iR as Y,gR as Z,Vv as _,Fv as a,h3 as a$,mp as a0,dh as a1,lp as a2,Yi as a3,En as a4,Bo as a5,ku as a6,_5 as a7,rf as a8,wR as a9,Ll as aA,x5 as aB,q4 as aC,z4 as aD,ah as aE,Q4 as aF,ch as aG,ih as aH,DE as aI,zv as aJ,Xv as aK,h5 as aL,S3 as aM,ME as aN,NE as aO,IE as aP,Gv as aQ,ye as aR,tw as aS,A5 as aT,P5 as aU,M5 as aV,R3 as aW,T5 as aX,OE as aY,Ba as aZ,m5 as a_,dp as aa,xs as ab,wl as ac,Gi as ad,fp as ae,Ge as af,E5 as ag,Zg as ah,C5 as ai,R5 as aj,S5 as ak,y3 as al,Hv as am,Kv as an,wp as ao,L5 as ap,w5 as aq,u5 as ar,p5 as as,O5 as at,K8 as au,Sp as av,_E as aw,Xd as ax,N5 as ay,b3 as az,$v as b,f5 as b0,v5 as b1,y5 as b2,b5 as b3,M3 as b4,_3 as b5,N3 as b6,je as b7,ae as c,He as d,Fn as e,zs as f,vr as g,he as h,Ht as i,zm as j,Gn as k,ox as l,cf as m,uh as n,pw as o,Ae as p,ve as q,mw as r,qv as s,Ep as t,Vg as u,kf as v,rw as w,Uw as x,sf as y,SR as z};