ocean-brain 0.8.1 → 0.8.2

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 (78) hide show
  1. package/README.md +113 -0
  2. package/dist/mcp.js +230 -291
  3. package/package.json +5 -5
  4. package/server/client/dist/assets/ArrowRight.es-g2YZTklZ.js +1 -0
  5. package/server/client/dist/assets/Calendar-BP6HTuSn.js +25 -0
  6. package/server/client/dist/assets/Callout-B_IPSF_5.js +1 -0
  7. package/server/client/dist/assets/Copy.es-CNxe4ujr.js +1 -0
  8. package/server/client/dist/assets/Graph-D9GeO71k.js +1 -0
  9. package/server/client/dist/assets/Graph-Xha3fwhp.js +46 -0
  10. package/server/client/dist/assets/Image-BLEjLUqd.js +1 -0
  11. package/server/client/dist/assets/Image.es-DnON8cv2.js +1 -0
  12. package/server/client/dist/assets/Note-DjrCYtat.js +24 -0
  13. package/server/client/dist/assets/NotePropertiesPanel-2DgXEM4B.js +2 -0
  14. package/server/client/dist/assets/Plus.es-CQ8wn2is.js +1 -0
  15. package/server/client/dist/assets/Reminders-B4l3KdlK.js +1 -0
  16. package/server/client/dist/assets/Search-BN5sf7bE.js +1 -0
  17. package/server/client/dist/assets/SurfaceCard-BZm73nyS.js +1 -0
  18. package/server/client/dist/assets/Tag-oSnmViVp.js +1 -0
  19. package/server/client/dist/assets/TagNotes-BDTCcJcL.js +1 -0
  20. package/server/client/dist/assets/Trash.es-0aPpA-3S.js +1 -0
  21. package/server/client/dist/assets/ViewNotes-CiZtGJNE.js +1 -0
  22. package/server/client/dist/assets/{ViewSectionDialog-brTrsF6G.js → ViewSectionDialog-Ctl_694Y.js} +17 -17
  23. package/server/client/dist/assets/Views-D-zlatYD.js +1 -0
  24. package/server/client/dist/assets/app-DmqIOMWF.css +1 -0
  25. package/server/client/dist/assets/app-cTRcKMGc.js +26 -0
  26. package/server/client/dist/assets/floating-ui.react-dom-wWLZ1CdM.js +1 -0
  27. package/server/client/dist/assets/{image.api-CYsjXiMr.js → image.api-CVuuvTBk.js} +1 -1
  28. package/server/client/dist/assets/index-DKJChPr4.js +1 -0
  29. package/server/client/dist/assets/manage-image-BZjaxp-f.js +1 -0
  30. package/server/client/dist/assets/manage-image-detail-DPv0FQ2m.js +1 -0
  31. package/server/client/dist/assets/{mcp-Dd98N9Hq.js → mcp-CT_9IV2c.js} +2 -2
  32. package/server/client/dist/assets/mcp-admin-adapter-xAuyZc_M.js +1 -0
  33. package/server/client/dist/assets/note-core-Buwzyxi7.js +13 -0
  34. package/server/client/dist/assets/note-runtime-CPDVOFEo.js +168 -0
  35. package/server/client/dist/assets/note-ui-CHI-tzj-.js +2 -0
  36. package/server/client/dist/assets/{index-DPI6YoDt.css → note-ui-DL8owV-U.css} +1 -1
  37. package/server/client/dist/assets/note.api-D_00ZzJC.js +356 -0
  38. package/server/client/dist/assets/placeholder-DbdGiYGL.js +34 -0
  39. package/server/client/dist/assets/preload-helper-BXl3LOEh.js +1 -0
  40. package/server/client/dist/assets/properties-D447wsWk.js +1 -0
  41. package/server/client/dist/assets/route-preload.js +2 -0
  42. package/server/client/dist/assets/{tag.api-CwmC8crB.js → tag.api-CX0SE06J.js} +1 -1
  43. package/server/client/dist/assets/time-B3pt8vt4.js +9 -0
  44. package/server/client/dist/assets/trash-8sH7EZgc.js +1 -0
  45. package/server/client/dist/assets/url-BSnWpmJx.js +1 -0
  46. package/server/client/dist/assets/{useReminderMutate-DuVKxpBh.js → useReminderMutate-CLK1tHvT.js} +4 -4
  47. package/server/client/dist/index.html +10 -5
  48. package/server/dist/app.js +1 -1
  49. package/server/dist/modules/blocknote.js +262 -75
  50. package/server/dist/modules/error-handler.js +8 -0
  51. package/server/client/dist/assets/ArrowRight.es-CbA8ey6a.js +0 -1
  52. package/server/client/dist/assets/Calendar-CgWgr1BV.js +0 -25
  53. package/server/client/dist/assets/Callout-DKruIT0f.js +0 -1
  54. package/server/client/dist/assets/Copy.es-DFbgpaNJ.js +0 -1
  55. package/server/client/dist/assets/Graph-kCltGRlY.js +0 -1
  56. package/server/client/dist/assets/Image-7W0DZwMo.js +0 -1
  57. package/server/client/dist/assets/Image.es-5pXLx9TU.js +0 -1
  58. package/server/client/dist/assets/Note-BW6Np_5g.js +0 -20
  59. package/server/client/dist/assets/Plus.es-B0sg64VJ.js +0 -1
  60. package/server/client/dist/assets/Reminders-C10fHQcl.js +0 -1
  61. package/server/client/dist/assets/Search-tf2nV4v0.js +0 -1
  62. package/server/client/dist/assets/SurfaceCard-pydtvHfu.js +0 -1
  63. package/server/client/dist/assets/Tag-uCoYbISy.js +0 -1
  64. package/server/client/dist/assets/TagNotes-CqOcQiRw.js +0 -1
  65. package/server/client/dist/assets/Trash.es-w32Goxfa.js +0 -1
  66. package/server/client/dist/assets/ViewNotes-slPXXoOY.js +0 -1
  67. package/server/client/dist/assets/Views-B_wsb-XJ.js +0 -1
  68. package/server/client/dist/assets/graph-vendor-BAF95C0g.js +0 -46
  69. package/server/client/dist/assets/index-BR05aSXr.js +0 -342
  70. package/server/client/dist/assets/index-D83QbOcw.js +0 -1
  71. package/server/client/dist/assets/manage-image-BYIhWu56.js +0 -1
  72. package/server/client/dist/assets/manage-image-detail-6KgmQvbN.js +0 -1
  73. package/server/client/dist/assets/mcp-admin-adapter-DOgBsYpl.js +0 -1
  74. package/server/client/dist/assets/note-core-CMGUaW1v.js +0 -176
  75. package/server/client/dist/assets/note-vendor-Hoz9Q4-4.js +0 -54
  76. package/server/client/dist/assets/placeholder-siHGg9aK.js +0 -34
  77. package/server/client/dist/assets/properties-CyVRKgcT.js +0 -1
  78. package/server/client/dist/assets/trash-wojQBK9Z.js +0 -1
@@ -0,0 +1,26 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-BP6HTuSn.js","assets/floating-ui.react-dom-wWLZ1CdM.js","assets/note.api-D_00ZzJC.js","assets/url-BSnWpmJx.js","assets/time-B3pt8vt4.js","assets/Callout-B_IPSF_5.js","assets/preload-helper-BXl3LOEh.js","assets/Graph-D9GeO71k.js","assets/Views-D-zlatYD.js","assets/tag.api-CX0SE06J.js","assets/ViewSectionDialog-Ctl_694Y.js","assets/SurfaceCard-BZm73nyS.js","assets/ArrowRight.es-g2YZTklZ.js","assets/Plus.es-CQ8wn2is.js","assets/Reminders-B4l3KdlK.js","assets/useReminderMutate-CLK1tHvT.js","assets/Graph-Xha3fwhp.js","assets/Search-BN5sf7bE.js","assets/Tag-oSnmViVp.js","assets/Note-DjrCYtat.js","assets/NotePropertiesPanel-2DgXEM4B.js","assets/note-ui-CHI-tzj-.js","assets/note-core-Buwzyxi7.js","assets/note-runtime-CPDVOFEo.js","assets/note-ui-DL8owV-U.css","assets/image.api-CVuuvTBk.js","assets/Copy.es-CNxe4ujr.js","assets/TagNotes-BDTCcJcL.js","assets/ViewNotes-CiZtGJNE.js","assets/index-DKJChPr4.js","assets/mcp-admin-adapter-xAuyZc_M.js","assets/Image.es-DnON8cv2.js","assets/Trash.es-0aPpA-3S.js","assets/mcp-CT_9IV2c.js","assets/trash-8sH7EZgc.js","assets/manage-image-BZjaxp-f.js","assets/Image-BLEjLUqd.js","assets/manage-image-detail-DPv0FQ2m.js","assets/properties-D447wsWk.js","assets/placeholder-DbdGiYGL.js"])))=>i.map(i=>d[i]);
2
+ import{j as p,r as c,b as q,a as dt}from"./floating-ui.react-dom-wWLZ1CdM.js";import{s as Is,N as Ns,p as Ts,a as Ds,b as js,u as Vs,d as Os,e as ks,f as nr,g as Hs,n as Fs,h as Zs,i as ho,t as Bs,m as $s,M as zs,R as Us}from"./time-B3pt8vt4.js";import{f as ze,i as vt,a as ne,b as X,c as bt,d as We,t as or,j as Ks,e as qs,g as Gs,p as Ws,h as Xs,r as Ys,k as Qs,l as Ue,m as fo,n as Js,o as mn,D as ea,q as po,s as ae,u as mo,v as ct,w as ta,x as na,y as Ct,z as oa,A as H,B as go,C as ra,E as sa,F as aa,G as ia,H as Se,I as rr,J as ca,K as vo,L as pe,M as gn,N as Dt,O as kn,P as la,Q as ua,R as Ve,S as Xe,T as O,U as Hn,V as da,W as ha,X as fa,Y as pa,Z as Y,_ as vn,$ as sr,a0 as lt,a1 as ar,a2 as ma,a3 as ga,a4 as va,a5 as ie,a6 as Fn,a7 as ir,a8 as ba,a9 as cr,aa as lr,ab as ya,ac as Ke,ad as yt,ae as xa,af as ur,ag as dr,ah as wa,ai as Sa,aj as Ra,ak as Ea,al as Ca,am as Ma,an as Pa,ao as _a,ap as B,aq as Mn,ar as bo,as as Aa}from"./note.api-D_00ZzJC.js";import{_ as z}from"./preload-helper-BXl3LOEh.js";import{N as en,S as hr,H as tn,V as fr,G as pr,C as mr,R as gr,T as vr,a as br,b as yr,c as La,d as Ia,e as Na,f as Ta,g as Da,h as ja,i as Va}from"./url-BSnWpmJx.js";import{f as Oa,G as ka}from"./Graph-D9GeO71k.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const Zn={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},xr=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,Bn=(e,t,n=!0)=>{const o=xr(e);n&&t(o?.matches||!1);const r=s=>{t?.(s.matches)};return o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},Ha=(e,t=!0)=>Bn(Zn.DARK,e,t),Fa=(e,t,n=!0)=>Bn(Zn.RESPONSIVE(e),t,n),Za={MEDIA_QUERY:Zn,listenThemeChange:Ha,listenResponsiveChange:Fa,createMediaQuery:xr,listenMediaQueryChange:Bn};var D=(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))(D||{});function wr({update:e,notify:t,unwatched:n}){return{link:o,unlink:r,propagate:s,checkDirty:a,shallowPropagate:i};function o(l,d,h){const f=d.depsTail;if(f!==void 0&&f.dep===l)return;const m=f!==void 0?f.nextDep:d.deps;if(m!==void 0&&m.dep===l){m.version=h,d.depsTail=m;return}const v=l.subsTail;if(v!==void 0&&v.version===h&&v.sub===d)return;const g=d.depsTail=l.subsTail={version:h,dep:l,sub:d,prevDep:f,nextDep:m,prevSub:v,nextSub:void 0};m!==void 0&&(m.prevDep=g),f!==void 0?f.nextDep=g:d.deps=g,v!==void 0?v.nextSub=g:l.subs=g}function r(l,d=l.sub){const h=l.dep,f=l.prevDep,m=l.nextDep,v=l.nextSub,g=l.prevSub;return m!==void 0?m.prevDep=f:d.depsTail=f,f!==void 0?f.nextDep=m:d.deps=m,v!==void 0?v.prevSub=g:h.subsTail=g,g!==void 0?g.nextSub=v:(h.subs=v)===void 0&&n(h),m}function s(l){let d=l.nextSub,h;e:do{const f=l.sub;let m=f.flags;if(m&60?m&12?m&4?!(m&48)&&u(l,f)?(f.flags=m|40,m&=1):m=0:f.flags=m&-9|32:m=0:f.flags=m|32,m&2&&t(f),m&1){const v=f.subs;if(v!==void 0){const g=(l=v).nextSub;g!==void 0&&(h={value:d,prev:h},d=g);continue}}if((l=d)!==void 0){d=l.nextSub;continue}for(;h!==void 0;)if(l=h.value,h=h.prev,l!==void 0){d=l.nextSub;continue e}break}while(!0)}function a(l,d){let h,f=0,m=!1;e:do{const v=l.dep,g=v.flags;if(d.flags&16)m=!0;else if((g&17)===17){if(e(v)){const b=v.subs;b.nextSub!==void 0&&i(b),m=!0}}else if((g&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(h={value:l,prev:h}),l=v.deps,d=v,++f;continue}if(!m){const b=l.nextDep;if(b!==void 0){l=b;continue}}for(;f--;){const b=d.subs,y=b.nextSub!==void 0;if(y?(l=h.value,h=h.prev):l=b,m){if(e(d)){y&&i(b),d=l.sub;continue}m=!1}else d.flags&=-33;d=l.sub;const w=l.nextDep;if(w!==void 0){l=w;continue e}}return m}while(!0)}function i(l){do{const d=l.sub,h=d.flags;(h&48)===32&&(d.flags=h|16,(h&6)===2&&t(d))}while((l=l.nextSub)!==void 0)}function u(l,d){let h=d.depsTail;for(;h!==void 0;){if(h===l)return!0;h=h.prevDep}return!1}}let $n=0,De=0,ht=0;const we=[],{link:Ud,unlink:Sr,propagate:Kd,checkDirty:Ba,shallowPropagate:qd}=wr({update(e){return e.depsTail!==void 0?Ka(e):qa(e)},notify(e){let t=ht,n=t;do if(we[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(ht=t;n<--t;){const o=we[n];we[n++]=we[t],we[t]=o}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,nn(e)):Xa.call(e)}});function $a(){return $n}function za(){++$n}function Ua(){--$n||Wa()}function Ka(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,nn(e)}}function qa(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Ga(e){const t=e.flags;if(t&16||t&32&&Ba(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,nn(e)}}else e.flags=2}function Wa(){try{for(;De<ht;){const e=we[De];we[De++]=void 0,Ga(e)}}finally{for(;De<ht;){const e=we[De];we[De++]=void 0,e.flags|=10}De=0,ht=0}}function Xa(){this.depsTail=void 0,this.flags=0,nn(this);const e=this.subs;e!==void 0&&Sr(e)}function nn(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Sr(n,e)}function zn(e,t,n){const o=typeof e=="object",r=o?e:void 0;return{next:(o?e.next:e)?.bind(r),error:(o?e.error:t)?.bind(r),complete:(o?e.complete:n)?.bind(r)}}const Pn=[];let Zt=0;const{link:yo,unlink:Ya,propagate:Qa,checkDirty:Rr,shallowPropagate:xo}=wr({update(e){return e._update()},notify(e){Pn[_n++]=e,e.flags&=~D.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=D.Mutable|D.Dirty,zt(e))}});let jt=0,_n=0,fe;function zt(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Ya(n,e)}function Er(){if(!($a()>0)){for(;jt<_n;){const e=Pn[jt];Pn[jt++]=void 0,e.notify()}jt=0,_n=0}}function Cr(e,t){const n=typeof e=="function",o=e,r={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?D.None:D.Mutable,get(){return fe!==void 0&&yo(r,fe,Zt),r._snapshot},subscribe(s){const a=zn(s),i={current:!1},u=Ja(()=>{r.get(),i.current?a.next?.(r._snapshot):i.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(s){const a=fe,i=Object.is;if(n)fe=r,++Zt,r.depsTail=void 0;else if(s===void 0)return!1;n&&(r.flags=D.Mutable|D.RecursedCheck);try{const u=r._snapshot,l=typeof s=="function"?s(u):s===void 0&&n?o(u):s;return u===void 0||!i(u,l)?(r._snapshot=l,!0):!1}finally{fe=a,n&&(r.flags&=~D.RecursedCheck),zt(r)}}};return n?(r.flags=D.Mutable|D.Dirty,r.get=function(){const s=r.flags;if(s&D.Dirty||s&D.Pending&&Rr(r.deps,r)){if(r._update()){const a=r.subs;a!==void 0&&xo(a)}}else s&D.Pending&&(r.flags=s&~D.Pending);return fe!==void 0&&yo(r,fe,Zt),r._snapshot}):r.set=function(s){if(r._update(s)){const a=r.subs;a!==void 0&&(Qa(a),xo(a),Er())}},r}function Ja(e){const t=()=>{const o=fe;fe=n,++Zt,n.depsTail=void 0,n.flags=D.Watching|D.RecursedCheck;try{return e()}finally{fe=o,n.flags&=~D.RecursedCheck,zt(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:D.Watching|D.RecursedCheck,notify(){const o=this.flags;o&D.Dirty||o&D.Pending&&Rr(this.deps,this)?t():this.flags=D.Watching},stop(){this.flags=D.None,this.depsTail=void 0,zt(this)}};return t(),n}class ei{constructor(t){this.atom=Cr(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(zn(t))}}class ti{constructor(t){this.atom=Cr(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(zn(t))}}function ni(e){return typeof e=="function"?new ti(e):new ei(e)}function oi(e){try{za(),e()}finally{Ua(),Er()}}const Ie="__TSR_index",wo="popstate",So="beforeunload";function ri(e){let t=e.getLocation();const n=new Set,o=a=>{t=e.getLocation(),n.forEach(i=>i({location:t,action:a}))},r=a=>{e.notifyOnIndexChange??!0?o(a):t=e.getLocation()},s=async({task:a,navigateOpts:i,...u})=>{if(i?.ignoreBlocker??!1){a();return}const d=e.getBlockers?.()??[],h=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&d.length&&h)for(const f of d){const m=Ut(u.path,u.state);if(await f.blockerFn({currentLocation:t,nextLocation:m,action:u.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,u)=>{const l=t.state[Ie];i=Ro(l+1,i),s({task:()=>{e.pushState(a,i),o({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:a,state:i})},replace:(a,i,u)=>{const l=t.state[Ie];i=Ro(l,i),s({task:()=>{e.replaceState(a,i),o({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:a,state:i})},go:(a,i)=>{s({task:()=>{e.go(a),r({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Ie]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const i=e.getBlockers?.()??[];return e.setBlockers([...i,a]),()=>{const u=e.getBlockers?.()??[];e.setBlockers?.(u.filter(l=>l!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:o}}function Ro(e,t){t||(t={});const n=Un();return{...t,key:n,__TSR_key:n,[Ie]:e}}function si(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,o=t.history.replaceState;let r=[];const s=()=>r,a=x=>r=x,i=(x=>x),u=(()=>Ut(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const x=Un();t.history.replaceState({[Ie]:0,key:x,__TSR_key:x},"")}let l=u(),d,h=!1,f=!1,m=!1,v=!1;const g=()=>l;let b,y;const w=()=>{b&&(E._ignoreSubscribers=!0,(b.isPush?t.history.pushState:t.history.replaceState)(b.state,"",b.href),E._ignoreSubscribers=!1,b=void 0,y=void 0,d=void 0)},R=(x,C,I)=>{const P=i(C);y||(d=l),l=Ut(C,I),b={href:P,state:I,isPush:b?.isPush||x==="push"},y||(y=Promise.resolve().then(()=>w()))},S=x=>{l=u(),E.notify({type:x})},M=async()=>{if(f){f=!1;return}const x=u(),C=x.state[Ie]-l.state[Ie],I=C===1,P=C===-1,A=!I&&!P||h;h=!1;const K=A?"GO":P?"BACK":"FORWARD",T=A?{type:"GO",index:C}:{type:P?"BACK":"FORWARD"};if(m)m=!1;else{const le=s();if(typeof document<"u"&&le.length){for(const G of le)if(await G.blockerFn({currentLocation:l,nextLocation:x,action:K})){f=!0,t.history.go(1),E.notify(T);return}}}l=u(),E.notify(T)},_=x=>{if(v){v=!1;return}let C=!1;const I=s();if(typeof document<"u"&&I.length)for(const P of I){const A=P.enableBeforeUnload??!0;if(A===!0){C=!0;break}if(typeof A=="function"&&A()===!0){C=!0;break}}if(C)return x.preventDefault(),x.returnValue=""},E=ri({getLocation:g,getLength:()=>t.history.length,pushState:(x,C)=>R("push",x,C),replaceState:(x,C)=>R("replace",x,C),back:x=>(x&&(m=!0),v=!0,t.history.back()),forward:x=>{x&&(m=!0),v=!0,t.history.forward()},go:x=>{h=!0,t.history.go(x)},createHref:x=>i(x),flush:w,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(So,_,{capture:!0}),t.removeEventListener(wo,M)},onBlocked:()=>{d&&l!==d&&(l=d)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(So,_,{capture:!0}),t.addEventListener(wo,M),t.history.pushState=function(...x){const C=n.apply(t.history,x);return E._ignoreSubscribers||S("PUSH"),C},t.history.replaceState=function(...x){const C=o.apply(t.history,x);return E._ignoreSubscribers||S("REPLACE"),C},E}function ai(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ut(e,t){const n=ai(e),o=n.indexOf("#"),r=n.indexOf("?"),s=Un();return{href:n,pathname:n.substring(0,o>0?r>0?Math.min(o,r):o:r>0?r:n.length),hash:o>-1?n.substring(o):"",search:r>-1?n.slice(r,o===-1?void 0:o):"",state:t||{[Ie]:0,key:s,__TSR_key:s}}}function Un(){return(Math.random()+1).toString(36).substring(7)}const ii=!1;function ft(e){let t;return oi(()=>{t=e()}),t}function ci(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const An="tsr-scroll-restoration-v1_3",li=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function ui(){const e=ci();if(!e)return null;const t=e.getItem(An);let n=t?JSON.parse(t):{};return{state:n,set:o=>{n=ze(o,n)||n;try{e.setItem(An,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Vt=ui(),di=e=>e.state.__TSR_key||e.href;function hi(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 Kt=!1;function fi({storageKey:e,key:t,behavior:n,shouldScrollRestoration:o,scrollToTopSelectors:r,location:s}){let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(l){console.error(l);return}const i=t||window.history.state?.__TSR_key,u=a[i];Kt=!0;e:{if(o&&u&&Object.keys(u).length>0){for(const h in u){const f=u[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=f.scrollX,m.scrollTop=f.scrollY)}}break e}const l=(s??window.location).hash.split("#",2)[1];if(l){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(l);f&&f.scrollIntoView(h)}break e}const d={top:0,left:0,behavior:n};if(window.scrollTo(d),r)for(const h of r){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(d)}}Kt=!1}function pi(e,t){if(!Vt||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Vt))return;e.isScrollRestorationSetup=!0,Kt=!1;const o=e.options.getScrollRestorationKey||di;window.history.scrollRestoration="manual";const r=s=>{if(Kt||!e.isScrollRestoring)return;let a="";if(s.target===document||s.target===window)a="window";else{const u=s.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=hi(s.target)}const i=o(e.state.location);Vt.set(u=>{const l=u[i]||={},d=l[a]||={};if(a==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(d.scrollX=h.scrollLeft||0,d.scrollY=h.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",li(r,100),!0),e.subscribe("onRendered",s=>{const a=o(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(fi({storageKey:An,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Vt.set(i=>(i[a]||={},i)))})}function mi(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 gi(e,t=String){const n=new URLSearchParams;for(const o in e){const r=e[o];r!==void 0&&n.set(o,t(r))}return n.toString()}function bn(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function vi(e){const t=new URLSearchParams(e),n={};for(const[o,r]of t.entries()){const s=n[o];s==null?n[o]=bn(r):Array.isArray(s)?s.push(bn(r)):n[o]=[s,bn(r)]}return n}const bi=xi(JSON.parse),yi=wi(JSON.stringify,JSON.parse);function xi(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=vi(t);for(const o in n){const r=n[o];if(typeof r=="string")try{n[o]=e(r)}catch{}}return n}}function wi(e,t){const n=typeof t=="function";function o(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(n&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const s=gi(r,o);return s?`?${s}`:""}}const Ln=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},on=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),qe=(e,t,n=!0)=>{const o={...e.router.options.context??{}},r=n?t:t-1;for(let s=0;s<=r;s++){const a=e.matches[s];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(o,i.__routeContext,i.__beforeLoadContext)}return o},Eo=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,o=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),r=o>=0?o:0;let s=n?e.matches.findIndex(a=>a.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=r);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:r},Le=(e,t,n)=>{if(!(!ne(n)&&!X(n)))throw ne(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,o=>({...o,status:ne(n)?"redirected":o.status==="pending"?"success":o.status,context:qe(e,t.index),isFetching:!1,error:n})),X(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ne(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Mr=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ut=(e,t,n,o)=>{const{id:r,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=o,e.firstBadMatchIndex??=t,Le(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(i){n=i,Le(e,e.router.getMatch(r),n)}e.updateMatch(r,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&&!ne(n)&&!X(n)&&(e.serialError??=n)},Pr=(e,t,n,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const r=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!on(e,t)&&(n.options.loader||n.options.beforeLoad||Ar(n))&&typeof r=="number"&&r!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{Ln(e)},r);o._nonReactive.pendingTimeout=a}},Si=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Pr(e,t,n,o);const r=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Le(e,s,s.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},Ri=(e,t,n,o)=>{const r=e.router.getMatch(t),s=r._nonReactive.loadPromise;r._nonReactive.loadPromise=We(()=>{s?.resolve()});const{paramsError:a,searchError:i}=r;a&&ut(e,n,a,"PARSE_PARAMS"),i&&ut(e,n,i,"VALIDATE_SEARCH"),Pr(e,t,o,r);const u=new AbortController;let l=!1;const d=()=>{l||(l=!0,e.updateMatch(t,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:u})))},h=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!o.options.beforeLoad){ft(()=>{d(),h()});return}r._nonReactive.beforeLoadPromise=We();const f={...qe(e,n,!1),...r.__routeContext},{search:m,params:v,cause:g}=r,b=on(e,t),y={search:m,abortController:u,params:v,preload:b,context:f,location:e.location,navigate:S=>e.router.navigate({...S,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":g,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},w=S=>{if(S===void 0){ft(()=>{d(),h()});return}(ne(S)||X(S))&&(d(),ut(e,n,S,"BEFORE_LOAD")),ft(()=>{d(),e.updateMatch(t,M=>({...M,__beforeLoadContext:S})),h()})};let R;try{if(R=o.options.beforeLoad(y),vt(R))return d(),R.catch(S=>{ut(e,n,S,"BEFORE_LOAD")}).then(w)}catch(S){d(),ut(e,n,S,"BEFORE_LOAD")}w(R)},Ei=(e,t)=>{const{id:n,routeId:o}=e.matches[t],r=e.router.looseRoutesById[o],s=()=>i(),a=()=>Ri(e,n,t,r),i=()=>{if(Mr(e,n))return;const u=Si(e,n,r);return vt(u)?u.then(a):a()};return s()},Ci=(e,t,n)=>{const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([n.options.head?.(r),n.options.scripts?.(r),n.options.headers?.(r)]).then(([s,a,i])=>{const u=s?.meta,l=s?.links,d=s?.scripts,h=s?.styles;return{meta:u,links:l,headScripts:d,headers:i,scripts:a,styles:h}})},_r=(e,t,n,o,r)=>{const s=t[o-1],{params:a,loaderDeps:i,abortController:u,cause:l}=e.router.getMatch(n),d=qe(e,o),h=on(e,n);return{params:a,deps:i,preload:!!h,parentMatchPromise:s,abortController:u,context:d,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":l,route:r,...e.router.options.additionalContext}},Co=async(e,t,n,o,r)=>{try{const s=e.router.getMatch(n);try{(!(ii??e.router.isServer)||s.ssr===!0)&&qt(r);const a=r.options.loader?.(_r(e,t,n,o,r)),i=r.options.loader&&vt(a);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,d=>({...d,isFetching:"loader"})),r.options.loader){const d=i?await a:a;Le(e,e.router.getMatch(n),d),d!==void 0&&e.updateMatch(n,h=>({...h,loaderData:d}))}r._lazyPromise&&await r._lazyPromise;const l=s._nonReactive.minPendingPromise;l&&await l,r._componentsPromise&&await r._componentsPromise,e.updateMatch(n,d=>({...d,error:void 0,context:qe(e,o),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,l=>({...l,status:l.status==="pending"?"success":l.status,isFetching:!1,context:qe(e,o)}));return}const u=s._nonReactive.minPendingPromise;u&&await u,X(a)&&await r.options.notFoundComponent?.preload?.(),Le(e,e.router.getMatch(n),a);try{r.options.onError?.(a)}catch(l){i=l,Le(e,e.router.getMatch(n),l)}e.updateMatch(n,l=>({...l,error:i,context:qe(e,o),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Le(e,a,s)}},Mi=async(e,t,n)=>{async function o(h,f,m,v){const g=Date.now()-f.updatedAt,b=h?v.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??e.router.options.defaultStaleTime??0,y=v.options.shouldReload,w=typeof y=="function"?y(_r(e,t,r,n,v)):y,{status:R,invalid:S}=m;a=R==="success"&&(S||(w??g>b)),h&&v.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{try{await Co(e,t,r,n,v);const M=e.router.getMatch(r);M._nonReactive.loaderPromise?.resolve(),M._nonReactive.loadPromise?.resolve(),M._nonReactive.loaderPromise=void 0}catch(M){ne(M)&&await e.router.navigate(M.options)}})()):(R!=="success"||a&&e.sync)&&await Co(e,t,r,n,v))}const{id:r,routeId:s}=e.matches[n];let a=!1,i=!1;const u=e.router.looseRoutesById[s];if(!Mr(e,r)){const h=e.router.getMatch(r),f=on(e,r);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const m=e.router.getMatch(r),v=m._nonReactive.error||m.error;v&&Le(e,m,v),m.status==="pending"&&await o(f,h,m,u)}else{const m=f&&!e.router.state.matches.some(g=>g.id===r),v=e.router.getMatch(r);v._nonReactive.loaderPromise=We(),m!==v.preload&&e.updateMatch(r,g=>({...g,preload:m})),await o(f,h,v,u)}}const l=e.router.getMatch(r);i||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,i||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;const d=i?l.isFetching:!1;return d!==l.isFetching||l.invalid!==!1?(e.updateMatch(r,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(r)):l};async function Mo(e){const t=e,n=[];t.router.state.matches.some(f=>f._forcePending)&&Ln(t);let o;for(let f=0;f<t.matches.length;f++){try{const m=Ei(t,f);vt(m)&&await m}catch(m){if(ne(m))throw m;if(X(m))o=m;else if(!t.preload)throw m;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,s=o&&!t.preload?Eo(t,o):void 0,a=o&&t.preload?0:s!==void 0?Math.min(s+1,r):r;let i,u;for(let f=0;f<a;f++)n.push(Mi(t,n,f));try{await Promise.all(n)}catch{const f=await Promise.allSettled(n);for(const m of f){if(m.status!=="rejected")continue;const v=m.reason;if(ne(v))throw v;X(v)?i??=v:u??=v}if(u!==void 0)throw u}const l=i??(o&&!t.preload?o:void 0);let d=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!l&&o&&t.preload)return t.matches;if(l){const f=Eo(t,l);bt(f!==void 0);const m=t.matches[f],v=t.router.looseRoutesById[m.routeId],g=t.router.options?.defaultNotFoundComponent;!v.options.notFoundComponent&&g&&(v.options.notFoundComponent=g),l.routeId=m.routeId;const b=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,y=>({...y,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:l},isFetching:!1})),d=f,await qt(v)}else if(!t.preload){const f=t.matches[0];f.globalNotFound||t.router.getMatch(f.id)?.globalNotFound&&t.updateMatch(f.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const f=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await qt(f)}for(let f=0;f<=d;f++){const m=t.matches[f],{id:v,routeId:g}=m,b=t.router.looseRoutesById[g];try{const y=Ci(t,v,b);if(y){const w=await y;t.updateMatch(v,R=>({...R,...w}))}}catch(y){console.error(`Error executing head for route ${g}:`,y)}}const h=Ln(t);if(vt(h)&&await h,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function qt(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...o}=t.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const o of Lr){const r=e.options[o]?.preload;r&&n.push(r())}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 Ar(e){for(const t of Lr)if(e.options[t]?.preload)return!0;return!1}const Lr=["component","errorComponent","pendingComponent","notFoundComponent"];function Pi(e){return{input:({url:t})=>{for(const n of e)t=In(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ir(e[n],t);return t}}}function _i(e){const t=or(e.basepath),n=`/${t}`,o=`${n}/`,r=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?o:o.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===r?a.pathname="/":i.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=Ks(["/",t,a.pathname]),a)}}function In(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 Ir(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 je(e){const t=e.resolvedLocation,n=e.location,o=t?.pathname!==n.pathname,r=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:o,hrefChanged:r,hashChanged:s}}function Ai(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class Li{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 o=this.options,r=this.basepath??o?.basepath??"/",s=this.basepath===void 0,a=o?.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=qs(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=si()),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 f;this.resolvePathCache=Gs(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=ni(Ni(this.latestLocation)),pi(this));let i=!1;const u=this.options.basepath??"/",l=this.options.rewrite;if(s||r!==u||a!==l){this.basepath=u;const f=[],m=or(u);m&&m!=="/"&&f.push(_i({basepath:u})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Pi(f),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(f=>({...f,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=Ws(this.routeTree,this.options.caseSensitive,(o,r)=>{o.init({originalIndex:r})});return this.options.routeMasks&&Xs(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const r={eventType:n,fn:o};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const r=({pathname:u,search:l,hash:d,href:h,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const w=this.options.parseSearch(l),R=this.options.stringifySearch(w);return{href:u+R+d,publicHref:h,pathname:ct(u).path,external:!1,searchStr:R,search:ae(o?.search,w),hash:ct(d.slice(1)).path,state:ae(o?.state,f)}}const m=new URL(h,this.origin),v=In(this.rewrite,m),g=this.options.parseSearch(v.search),b=this.options.stringifySearch(g);return v.search=b,{href:v.href.replace(v.origin,""),publicHref:h,pathname:ct(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:ae(o?.search,g),hash:ct(v.hash.slice(1)).path,state:ae(o?.state,f)}},s=r(n),{__tempLocation:a,__tempKey:i}=s.state;if(a&&(!i||i===this.tempLocationKey)){const u=r(a);return u.state.key=s.state.key,u.state.__TSR_key=s.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:s}}return s},this.resolvePathWithBase=(n,o)=>Ys({base:n,to:Qs(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,r)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},r):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>Ti({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),o=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...o]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const o=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);s.from;const u=s.unsafeRelative==="path"?a.pathname:s.from??i.fullPath,l=this.resolvePathWithBase(u,"."),d=i.search,h={...i.params},f=s.to?this.resolvePathWithBase(l,`${s.to}`):this.resolvePathWithBase(l,"."),m=s.params===!1||s.params===null?{}:(s.params??!0)===!0?h:Object.assign(h,ze(s.params,h)),v=this.getMatchedRoutes(f);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 A=P.options.params?.stringify??P.options.stringifyParams;if(A)try{Object.assign(m,A(m))}catch{}}const y=n.leaveParams?f:ct(po({path:f,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=d;if(n._includeValidateSearch&&this.options.search?.strict){const P={};g.forEach(A=>{if(A.options.validateSearch)try{Object.assign(P,Bt(A.options.validateSearch,{...P,...w}))}catch{}}),w=P}w=Di({search:w,dest:s,destRoutes:g,_includeValidateSearch:n._includeValidateSearch}),w=ae(d,w);const R=this.options.stringifySearch(w),S=s.hash===!0?a.hash:s.hash?ze(s.hash,a.hash):void 0,M=S?`#${S}`:"";let _=s.state===!0?a.state:s.state?ze(s.state,a.state):{};_=ae(a.state,_);const E=`${y}${R}${M}`;let x,C,I=!1;if(this.rewrite){const P=new URL(E,this.origin),A=Ir(this.rewrite,P);x=P.href.replace(P.origin,""),A.origin!==this.origin?(C=A.href,I=!0):C=A.pathname+A.search+A.hash}else x=oa(E),C=x;return{publicHref:C,href:x,pathname:y,search:w,searchStr:R,state:_,hash:S??"",external:I,unmaskOnReload:s.unmaskOnReload}},r=(s={},a)=>{const i=o(s);let u=a?o(a):void 0;if(!u){const l={};if(this.options.routeMasks){const d=ta(i.pathname,this.processedTree);if(d){Object.assign(l,d.rawParams);const{from:h,params:f,...m}=d.route,v=f===!1||f===null?{}:(f??!0)===!0?l:Object.assign(l,ze(f,l));a={from:n.from,...m,params:v},u=o(a)}}}return u&&(i.maskedLocation=u),i};return n.mask?r(n,{from:n.from,...n.mask}):r(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...r})=>{const s=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(d=>{r.state[d]=this.latestLocation.state[d]});const l=mn(r.state,this.latestLocation.state);return u.forEach(d=>{delete r.state[d]}),l},a=Ue(this.latestLocation.href)===Ue(r.href),i=this.commitLocationPromise;if(this.commitLocationPromise=We(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:u,hashScrollIntoView:l,...d}=r;u&&(d={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[r.replace?"replace":"push"](d.publicHref,d.state,{ignoreBlocker:o})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:r,viewTransition:s,ignoreBlocker:a,href:i,...u}={})=>{if(i){const h=this.history.location.state.__TSR_index,f=Ut(i,{__TSR_index:n?h:h+1}),m=new URL(f.pathname,this.origin),v=In(this.rewrite,m);u.to=v.pathname,u.search=this.options.parseSearch(f.search),u.hash=f.hash.slice(1)}const l=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const d=this.commitLocation({...l,viewTransition:s,replace:n,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:n,reloadDocument:o,href:r,publicHref:s,...a})=>{let i=!1;if(r)try{new URL(`${r}`),i=!0}catch{}if(i&&!o&&(o=!0),o){if(n!==void 0||!r){const l=this.buildLocation({to:n,...a});r=r??l.publicHref,s=s??l.publicHref}const u=!i&&s?s:r;if(fo(u,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const h of d)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:o.cachedMatches.filter(r=>!n.some(s=>s.id===r.id))}))},this.load=async n=>{let o,r,s;for(s=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();const u=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...je({resolvedLocation:l,location:u})}),this.emit({type:"onBeforeLoad",...je({resolvedLocation:l,location:u})}),await Mo({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let d=[],h=[],f=[],m=[];ft(()=>{this.__store.setState(v=>{const g=v.matches,b=v.pendingMatches||v.matches;return d=g.filter(y=>!b.some(w=>w.id===y.id)),h=g.filter(y=>!b.some(w=>w.routeId===y.routeId)),f=b.filter(y=>!g.some(w=>w.routeId===y.routeId)),m=b.filter(y=>g.some(w=>w.routeId===y.routeId)),{...v,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...v.cachedMatches,...d.filter(y=>y.status!=="error"&&y.status!=="notFound"&&y.status!=="redirected")]}}),this.clearExpiredCache()}),[[h,"onLeave"],[f,"onEnter"],[m,"onStay"]].forEach(([v,g])=>{v.forEach(b=>{this.looseRoutesById[b.routeId].options[g]?.(b)})})})})}})}catch(u){ne(u)?(o=u,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):X(u)&&(r=u),this.__store.setState(l=>({...l,statusCode:o?o.status:r?404:l.matches.some(d=>d.status==="error")?500:200,redirect:o}))}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 o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.state.resolvedLocation,i=typeof o.types=="function"?o.types(je({resolvedLocation:a,location:s})):o.types;if(i===!1){n();return}r={update:n,types:i}}else r=n;document.startViewTransition(r)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const r=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":"";r&&(r==="cachedMatches"?this.__store.setState(s=>({...s,cachedMatches:Ai(s.cachedMatches.map(a=>a.id===n?o(a):a))})):this.__store.setState(s=>({...s,[r]:s[r]?.map(a=>a.id===n?o(a):a)})))})},this.getMatch=n=>{const o=r=>r.id===n;return this.state.cachedMatches.find(o)??this.state.pendingMatches?.find(o)??this.state.matches.find(o)},this.invalidate=n=>{const o=r=>n?.filter?.(r)??!0?{...r,invalid:!0,...n?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(o),cachedMatches:r.cachedMatches.map(o),pendingMatches:r.pendingMatches?.map(o)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const r=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(r);n.options.href=s,n.headers.set("Location",s)}else if(o)try{const r=new URL(o);if(this.origin&&r.origin===this.origin){const s=r.pathname+r.search+r.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&fo(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 o=n?.filter;o!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(s=>!o(s))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=o=>{const r=this.looseRoutesById[o.routeId];if(!r.options.loader)return!0;const s=(o.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:Date.now()-o.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=qt,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let r=this.matchRoutes(o,{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)]);ft(()=>{r.forEach(i=>{a.has(i.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,i]}))})});try{return r=await Mo({router:this,matches:r,location:o,preload:!0,updateMatch:(i,u)=>{s.has(i)?r=r.map(l=>l.id===i?u(l):l):this.updateMatch(i,u)}}),r}catch(i){if(ne(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:o});X(i)||console.error(i);return}},this.matchRoute=(n,o)=>{const r={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(r);if(o?.pending&&this.state.status!=="pending")return!1;const i=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,u=Js(s.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!u||n.params&&!mn(u.rawParams,n.params,{partial:!0})?!1:o?.includeSearch??!0?mn(i.search,s.search,{partial:!0})?u.rawParams:!1:u.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??yi,parseSearch:t.parseSearch??bi,protocolAllowlist:t.protocolAllowlist??ea}),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:o}){this.routesById=t,this.routesByPath=n,this.processedTree=o;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}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 o=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:s,parsedParams:a}=o;let{matchedRoutes:i}=o,u=!1;(r?r.path!=="/"&&s["**"]:Ue(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:u=!0);const l=u?Vi(this.options.notFoundMode,i):void 0,d=new Array(i.length),h=new Map(this.state.matches.map(f=>[f.routeId,f]));for(let f=0;f<i.length;f++){const m=i[f],v=d[f-1];let g,b,y;{const T=v?.search??t.search,le=v?._strictSearch??void 0;try{const G=Bt(m.options.validateSearch,{...T})??void 0;g={...T,...G},b={...le,...G},y=void 0}catch(G){let V=G;if(G instanceof Gt||(V=new Gt(G.message,{cause:G})),n?.throwOnError)throw V;g=T,b={},y=V}}const w=m.options.loaderDeps?.({search:g})??"",R=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:M}=po({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),_=m.id+S+R,E=this.getMatch(_),x=h.get(m.id),C=E?._strictParams??M;let I;if(!E)try{Po(m,M,a,C)}catch(T){if(X(T)||ne(T)?I=T:I=new Ii(T.message,{cause:T}),n?.throwOnError)throw I}Object.assign(s,C);const P=x?"stay":"enter";let A;if(E)A={...E,cause:P,params:x?.params??s,_strictParams:C,search:x?ae(x.search,g):ae(E.search,g),_strictSearch:b};else{const T=m.options.loader||m.options.beforeLoad||m.lazyFn||Ar(m)?"pending":"success";A={id:_,ssr:m.options.ssr,index:f,routeId:m.id,params:x?.params??s,_strictParams:C,pathname:S,updatedAt:Date.now(),search:x?ae(x.search,g):g,_strictSearch:b,searchError:void 0,status:T,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:We()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:x?ae(x.loaderDeps,w):w,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||(A.globalNotFound=l===m.id),A.searchError=y;const K=this.getParentContext(v);A.context={...K,...A.__routeContext,...A.__beforeLoadContext},d[f]=A}for(let f=0;f<d.length;f++){const m=d[f],v=this.looseRoutesById[m.routeId],g=this.getMatch(m.id),b=h.get(m.routeId);if(m.params=b?ae(b.params,s):s,!g){const y=d[f-1],w=this.getParentContext(y);if(v.options.context){const R={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:S=>this.navigate({...S,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:v.id};m.__routeContext=v.options.context(R)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:o,parsedParams:r}=this.getMatchedRoutes(t.pathname),s=mo(n),a={...t.search};for(const d of n)try{Object.assign(a,Bt(d.options.validateSearch,a))}catch{}const i=mo(this.state.matches),u=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let l;if(u)l=i.params;else{const d={...o};for(const h of n)try{Po(h,o,r??{},d)}catch{}l=d}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:l}}}class Gt extends Error{}class Ii extends Error{}function Ni(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Bt(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Gt("Async validation not supported");if(n.issues)throw new Gt(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 Ti({pathname:e,routesById:t,processedTree:n}){const o={},r=Ue(e);let s,a;const i=na(r,n,!0);return i&&(s=i.route,Object.assign(o,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[Ct]],routeParams:o,foundRoute:s,parsedParams:a}}function Di({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return ji(n)(e,t,o??!1)}function ji(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const s=({search:a,next:i})=>{let u=a;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(u=r.options.preSearchFilters.reduce((d,h)=>h(d),a));const l=i(u);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((d,h)=>h(d),l):l};t.middlewares.push(s)}if(r.options.validateSearch){const s=({search:a,next:i})=>{const u=i(a);if(!t._includeValidateSearch)return u;try{return{...u,...Bt(r.options.validateSearch,u)??void 0}}catch{return u}};t.middlewares.push(s)}}const n=({search:r})=>{const s=t.dest;return s.search?s.search===!0?r:ze(s.search,r):{}};t.middlewares.push(n);const o=(r,s,a)=>{if(r>=a.length)return s;const i=a[r];return i({search:s,next:l=>o(r+1,l,a)})};return function(s,a,i){return t.dest=a,t._includeValidateSearch=i,o(0,s,t.middlewares)}}function Vi(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return Ct}function Po(e,t,n,o){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(o[s]=n[s]);else{const s=r(o);Object.assign(o,s)}}function Kn(e){const t=e.errorComponent??qn;return p.jsx(Oi,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?c.createElement(t,{error:n,reset:o}):e.children})}class Oi 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 qn({error:e}){const[t,n]=c.useState(!1);return p.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[p.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),p.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),p.jsx("div",{style:{height:".25rem"}}),t?p.jsx("div",{children:p.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?p.jsx("code",{children:e.message}):null})}):null]})}function _o(e){return typeof e=="object"?new Ao(e,{silent:!0}).createRoute(e):new Ao(e,{silent:!0}).createRoute}class Ao{constructor(t,n){this.path=t,this.createRoute=o=>{const r=H(o);return r.isRoot=!1,r},this.silent=n?.silent}}class Lo{constructor(t){this.useMatch=n=>go({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>go({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>ra({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>sa({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>aa({...n,from:this.options.id}),this.useLoaderData=n=>ia({...n,from:this.options.id}),this.useNavigate=()=>{const n=Se();return rr({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Io(e){return typeof e=="object"?new Lo(e):t=>new Lo({id:e,...t})}function U(e,t){let n,o,r,s;const a=()=>(n||(n=e().then(u=>{n=void 0,o=u.default}).catch(u=>{if(r=u,ca(r)&&r instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const l=`tanstack_router_reload:${r.message}`;sessionStorage.getItem(l)||(sessionStorage.setItem(l,"1"),s=!0)}})),n),i=function(l){if(s)throw window.location.reload(),new Promise(()=>{});if(r)throw r;if(!o)if(vo)vo(a());else throw a();return c.createElement(o,l)};return i.preload=a,i}function ki(){const e=Se(),t=c.useRef({router:e,mounted:!1}),[n,o]=c.useState(!1),{hasPendingMatches:r,isLoading:s}=pe({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),a=gn(s),i=s||n||r,u=gn(i),l=s||r,d=gn(l);return e.startTransition=h=>{o(!0),c.startTransition(()=>{h(),o(!1)})},c.useEffect(()=>{const h=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ue(e.latestLocation.publicHref)!==Ue(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{h()}},[e,e.history]),Dt(()=>{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(f){console.error(f)}})()},[e]),Dt(()=>{a&&!s&&e.emit({type:"onLoad",...je(e.state)})},[a,e,s]),Dt(()=>{d&&!l&&e.emit({type:"onBeforeRouteMount",...je(e.state)})},[l,d,e]),Dt(()=>{if(u&&!i){const h=je(e.state);e.emit({type:"onResolved",...h}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),h.hrefChanged&&mi(e)}},[i,u,e]),null}function Hi(e){const t=pe({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(Kn,{getResetKey:()=>t,onCatch:(n,o)=>{if(X(n))e.onCatch?.(n,o);else throw n},errorComponent:({error:n})=>{if(X(n))return e.fallback?.(n);throw n},children:e.children})}function Fi(){return p.jsx("p",{children:"Not Found"})}function $e(e){return p.jsx(p.Fragment,{children:e.children})}function Nr(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):p.jsx(Fi,{})}function Zi(){return Se().isScrollRestoring,null}const Tr=c.memo(function({matchId:t}){const n=Se(),o=pe({select:g=>{const b=g.matches.findIndex(w=>w.id===t),y=g.matches[b];return bt(y),{routeId:y.routeId,ssr:y.ssr,_displayPending:y._displayPending,resetKey:g.loadedAt,parentRouteId:g.matches[b-1]?.routeId}},structuralSharing:!0}),r=n.routesById[o.routeId],s=r.options.pendingComponent??n.options.defaultPendingComponent,a=s?p.jsx(s,{}):null,i=r.options.errorComponent??n.options.defaultErrorComponent,u=r.options.onCatch??n.options.defaultOnCatch,l=r.isRoot?r.options.notFoundComponent??n.options.notFoundRoute?.options.component:r.options.notFoundComponent,d=o.ssr===!1||o.ssr==="data-only",h=(!r.isRoot||r.options.wrapInSuspense||d)&&(r.options.wrapInSuspense??s??(r.options.errorComponent?.preload||d))?c.Suspense:$e,f=i?Kn:$e,m=l?Hi:$e,v=r.isRoot?r.options.shellComponent??$e:$e;return p.jsxs(v,{children:[p.jsx(kn.Provider,{value:t,children:p.jsx(h,{fallback:a,children:p.jsx(f,{getResetKey:()=>o.resetKey,errorComponent:i||qn,onCatch:(g,b)=>{if(X(g))throw g;u?.(g,b)},children:p.jsx(m,{fallback:g=>{if(!l||g.routeId&&g.routeId!==o.routeId||!g.routeId&&!r.isRoot)throw g;return c.createElement(l,g)},children:d||o._displayPending?p.jsx(la,{fallback:a,children:p.jsx(No,{matchId:t})}):p.jsx(No,{matchId:t})})})})}),o.parentRouteId===Ct&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(Bi,{}),p.jsx(Zi,{})]}):null]})});function Bi(){const e=Se(),t=c.useRef(void 0);return p.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...je(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const No=c.memo(function({matchId:t}){const n=Se(),{match:o,key:r,routeId:s}=pe({select:u=>{const l=u.matches.find(v=>v.id===t),d=l.routeId,f=(n.routesById[d].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:d,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:d,match:{id:l.id,status:l.status,error:l.error,invalid:l.invalid,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),a=n.routesById[s],i=c.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?p.jsx(u,{},r):p.jsx(Dr,{})},[r,a.options.component,n.options.defaultComponent]);if(o._displayPending)throw n.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw n.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const u=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(u){const l=n.getMatch(o.id);if(l&&!l._nonReactive.minPendingPromise){const d=We();l._nonReactive.minPendingPromise=d,setTimeout(()=>{d.resolve(),l._nonReactive.minPendingPromise=void 0},u)}}throw n.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return bt(X(o.error)),Nr(n,a,o.error);if(o.status==="redirected")throw bt(ne(o.error)),n.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return i}),Dr=c.memo(function(){const t=Se(),n=c.useContext(kn),o=pe({select:l=>l.matches.find(d=>d.id===n)?.routeId}),r=t.routesById[o],s=pe({select:l=>{const h=l.matches.find(f=>f.id===n);return bt(h),h.globalNotFound}}),a=pe({select:l=>{const d=l.matches,h=d.findIndex(f=>f.id===n);return d[h+1]?.id}}),i=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Nr(t,r,void 0);if(!a)return null;const u=p.jsx(Tr,{matchId:a});return o===Ct?p.jsx(c.Suspense,{fallback:i,children:u}):u});function $i(){const e=Se(),n=e.routesById[Ct].options.pendingComponent??e.options.defaultPendingComponent,o=n?p.jsx(n,{}):null,r=typeof document<"u"&&e.ssr?$e:c.Suspense,s=p.jsxs(r,{fallback:o,children:[p.jsx(ki,{}),p.jsx(zi,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:s}):s}function zi(){const e=Se(),t=pe({select:r=>r.matches[0]?.id}),n=pe({select:r=>r.loadedAt}),o=t?p.jsx(Tr,{matchId:t}):null;return p.jsx(kn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:p.jsx(Kn,{getResetKey:()=>n,errorComponent:qn,onCatch:void 0,children:o})})}const Ui=e=>new Ki(e);class Ki extends Li{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=_o,globalThis.createLazyFileRoute=Io):typeof window<"u"&&(window.createFileRoute=_o,window.createLazyFileRoute=Io);function qi({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=p.jsx(ua.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:o}):o}function Gi({router:e,...t}){return p.jsx(qi,{router:e,...t,children:p.jsx($i,{})})}function rn(e){return pe({select:t=>e?.select?e.select(t.location):t.location})}const Wi=new Map([["bold",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,28H188V24a12,12,0,0,0-24,0v4H92V24a12,12,0,0,0-24,0v4H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28ZM68,52a12,12,0,0,0,24,0h72a12,12,0,0,0,24,0h16V76H52V52ZM52,204V100H204V204Zm60-80v56a12,12,0,0,1-24,0V143.32a12,12,0,0,1-9.37-22l16-8A12,12,0,0,1,112,124Zm61.49,33.88L163.9,168H168a12,12,0,0,1,0,24H136a12,12,0,0,1-8.71-20.25L155.45,142a4,4,0,0,0,.55-2,4,4,0,0,0-7.47-2,12,12,0,0,1-20.78-12A28,28,0,0,1,180,140a27.77,27.77,0,0,1-5.64,16.86A10.63,10.63,0,0,1,173.49,157.88Z"}))],["duotone",c.createElement(c.Fragment,null,c.createElement("path",{d:"M216,48V88H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),c.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["fill",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM112,184a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm56-8a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136a23.76,23.76,0,0,1-4.84,14.45L152,176ZM48,80V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80Z"}))],["light",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,34H182V24a6,6,0,0,0-12,0V34H86V24a6,6,0,0,0-12,0V34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM48,46H74V56a6,6,0,0,0,12,0V46h84V56a6,6,0,0,0,12,0V46h26a2,2,0,0,1,2,2V82H46V48A2,2,0,0,1,48,46ZM208,210H48a2,2,0,0,1-2-2V94H210V208A2,2,0,0,1,208,210Zm-98-90v64a6,6,0,0,1-12,0V129.71l-7.32,3.66a6,6,0,1,1-5.36-10.74l16-8A6,6,0,0,1,110,120Zm59.57,29.25L148,178h20a6,6,0,0,1,0,12H136a6,6,0,0,1-4.8-9.6L160,142a10,10,0,1,0-16.65-11A6,6,0,1,1,133,125a22,22,0,1,1,36.62,24.26Z"}))],["regular",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["thin",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,36H180V24a4,4,0,0,0-8,0V36H84V24a4,4,0,0,0-8,0V36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM48,44H76V56a4,4,0,0,0,8,0V44h88V56a4,4,0,0,0,8,0V44h28a4,4,0,0,1,4,4V84H44V48A4,4,0,0,1,48,44ZM208,212H48a4,4,0,0,1-4-4V92H212V208A4,4,0,0,1,208,212ZM108,120v64a4,4,0,0,1-8,0V126.47l-10.21,5.11a4,4,0,0,1-3.58-7.16l16-8A4,4,0,0,1,108,120Zm60,28-24,32h24a4,4,0,0,1,0,8H136a4,4,0,0,1-3.2-6.4l28.78-38.37A11.88,11.88,0,0,0,164,136a12,12,0,0,0-22.4-6,4,4,0,0,1-6.92-4A20,20,0,0,1,172,136,19.79,19.79,0,0,1,168,148Z"}))]]),Xi=new Map([["bold",c.createElement(c.Fragment,null,c.createElement("path",{d:"M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z"}))],["duotone",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,32V224a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V32A16,16,0,0,1,64,16H192A16,16,0,0,1,208,32Z",opacity:"0.2"}),c.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["fill",c.createElement(c.Fragment,null,c.createElement("path",{d:"M192,16H64A16,16,0,0,0,48,32V224a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V32A16,16,0,0,0,192,16ZM100,200a12,12,0,1,1,12-12A12,12,0,0,1,100,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,80Zm56,120a12,12,0,1,1,12-12A12,12,0,0,1,156,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,80Z"}))],["light",c.createElement(c.Fragment,null,c.createElement("path",{d:"M102,60A10,10,0,1,1,92,50,10,10,0,0,1,102,60Zm62,10a10,10,0,1,0-10-10A10,10,0,0,0,164,70ZM92,118a10,10,0,1,0,10,10A10,10,0,0,0,92,118Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,118ZM92,186a10,10,0,1,0,10,10A10,10,0,0,0,92,186Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,186Z"}))],["regular",c.createElement(c.Fragment,null,c.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["thin",c.createElement(c.Fragment,null,c.createElement("path",{d:"M100,60a8,8,0,1,1-8-8A8,8,0,0,1,100,60Zm64,8a8,8,0,1,0-8-8A8,8,0,0,0,164,68ZM92,120a8,8,0,1,0,8,8A8,8,0,0,0,92,120Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,120ZM92,188a8,8,0,1,0,8,8A8,8,0,0,0,92,188Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,188Z"}))]]),Yi=new Map([["bold",c.createElement(c.Fragment,null,c.createElement("path",{d:"M251,123.13c-.37-.81-9.13-20.26-28.48-39.61C196.63,57.67,164,44,128,44S59.37,57.67,33.51,83.52C14.16,102.87,5.4,122.32,5,123.13a12.08,12.08,0,0,0,0,9.75c.37.82,9.13,20.26,28.49,39.61C59.37,198.34,92,212,128,212s68.63-13.66,94.48-39.51c19.36-19.35,28.12-38.79,28.49-39.61A12.08,12.08,0,0,0,251,123.13Zm-46.06,33C183.47,177.27,157.59,188,128,188s-55.47-10.73-76.91-31.88A130.36,130.36,0,0,1,29.52,128,130.45,130.45,0,0,1,51.09,99.89C72.54,78.73,98.41,68,128,68s55.46,10.73,76.91,31.89A130.36,130.36,0,0,1,226.48,128,130.45,130.45,0,0,1,204.91,156.12ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,148Z"}))],["duotone",c.createElement(c.Fragment,null,c.createElement("path",{d:"M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Zm0,112a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),c.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"}))],["fill",c.createElement(c.Fragment,null,c.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",c.createElement(c.Fragment,null,c.createElement("path",{d:"M245.48,125.57c-.34-.78-8.66-19.23-27.24-37.81C201,70.54,171.38,50,128,50S55,70.54,37.76,87.76c-18.58,18.58-26.9,37-27.24,37.81a6,6,0,0,0,0,4.88c.34.77,8.66,19.22,27.24,37.8C55,185.47,84.62,206,128,206s73-20.53,90.24-37.75c18.58-18.58,26.9-37,27.24-37.8A6,6,0,0,0,245.48,125.57ZM128,194c-31.38,0-58.78-11.42-81.45-33.93A134.77,134.77,0,0,1,22.69,128,134.56,134.56,0,0,1,46.55,95.94C69.22,73.42,96.62,62,128,62s58.78,11.42,81.45,33.94A134.56,134.56,0,0,1,233.31,128C226.94,140.21,195,194,128,194Zm0-112a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Z"}))],["regular",c.createElement(c.Fragment,null,c.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"}))],["thin",c.createElement(c.Fragment,null,c.createElement("path",{d:"M243.66,126.38c-.34-.76-8.52-18.89-26.83-37.2C199.87,72.22,170.7,52,128,52S56.13,72.22,39.17,89.18c-18.31,18.31-26.49,36.44-26.83,37.2a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17s71.87-20.21,88.83-37.17c18.31-18.31,26.49-36.43,26.83-37.2A4.08,4.08,0,0,0,243.66,126.38Zm-32.7,35c-23.07,23-51,34.62-83,34.62s-59.89-11.65-83-34.62A135.71,135.71,0,0,1,20.44,128,135.69,135.69,0,0,1,45,94.62C68.11,71.65,96,60,128,60s59.89,11.65,83,34.62A135.79,135.79,0,0,1,235.56,128,135.71,135.71,0,0,1,211,161.38ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z"}))]]),Qi=new Map([["bold",c.createElement(c.Fragment,null,c.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z"}))],["duotone",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),c.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["fill",c.createElement(c.Fragment,null,c.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z"}))],["light",c.createElement(c.Fragment,null,c.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"}))],["regular",c.createElement(c.Fragment,null,c.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["thin",c.createElement(c.Fragment,null,c.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z"}))]]),Ji=new Map([["bold",c.createElement(c.Fragment,null,c.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,80H140V60h56ZM116,60v56H60V60ZM60,140h56v56H60Zm80,56V140h56v56Z"}))],["duotone",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),c.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["fill",c.createElement(c.Fragment,null,c.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H136V44a4,4,0,0,1,4-4h60A16,16,0,0,1,216,56ZM116,40H56A16,16,0,0,0,40,56v60a4,4,0,0,0,4,4h76V44A4,4,0,0,0,116,40Zm96,96H136v76a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136ZM40,140v60a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V136H44A4,4,0,0,0,40,140Z"}))],["light",c.createElement(c.Fragment,null,c.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z"}))],["regular",c.createElement(c.Fragment,null,c.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["thin",c.createElement(c.Fragment,null,c.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,12v68H132V52h68A4,4,0,0,1,204,56ZM56,52h68v72H52V56A4,4,0,0,1,56,52ZM52,200V132h72v72H56A4,4,0,0,1,52,200Zm148,4H132V132h72v68A4,4,0,0,1,200,204Z"}))]]),ec=new Map([["bold",c.createElement(c.Fragment,null,c.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",c.createElement(c.Fragment,null,c.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),c.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",c.createElement(c.Fragment,null,c.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",c.createElement(c.Fragment,null,c.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",c.createElement(c.Fragment,null,c.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",c.createElement(c.Fragment,null,c.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),tc=new Map([["bold",c.createElement(c.Fragment,null,c.createElement("path",{d:"M128,128a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24h68A12,12,0,0,1,128,128ZM48,76H180a12,12,0,0,0,0-24H48a12,12,0,0,0,0,24Zm52,104H48a12,12,0,0,0,0,24h52a12,12,0,0,0,0-24Zm132.49-20.49a12,12,0,0,0-17,0L196,179V112a12,12,0,0,0-24,0v67l-19.51-19.52a12,12,0,0,0-17,17l40,40a12,12,0,0,0,17,0l40-40A12,12,0,0,0,232.49,159.51Z"}))],["duotone",c.createElement(c.Fragment,null,c.createElement("path",{d:"M224,80v88l-24,24H48V64H208A16,16,0,0,1,224,80Z",opacity:"0.2"}),c.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["fill",c.createElement(c.Fragment,null,c.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,72h96a8,8,0,0,1,0,16H72a8,8,0,0,1,0-16Zm40,112H72a8,8,0,0,1,0-16h40a8,8,0,0,1,0,16Zm8-48H72a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm77.66,29.66-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L160,164.69V120a8,8,0,0,1,16,0v44.69l10.34-10.35a8,8,0,0,1,11.32,11.32Z"}))],["light",c.createElement(c.Fragment,null,c.createElement("path",{d:"M126,128a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12h72A6,6,0,0,1,126,128ZM48,70H184a6,6,0,0,0,0-12H48a6,6,0,0,0,0,12Zm56,116H48a6,6,0,0,0,0,12h56a6,6,0,0,0,0-12Zm124.24-22.24a6,6,0,0,0-8.48,0L190,193.51V112a6,6,0,0,0-12,0v81.51l-29.76-29.75a6,6,0,0,0-8.48,8.48l40,40a6,6,0,0,0,8.48,0l40-40A6,6,0,0,0,228.24,163.76Z"}))],["regular",c.createElement(c.Fragment,null,c.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["thin",c.createElement(c.Fragment,null,c.createElement("path",{d:"M124,128a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8h72A4,4,0,0,1,124,128ZM48,68H184a4,4,0,0,0,0-8H48a4,4,0,0,0,0,8Zm56,120H48a4,4,0,0,0,0,8h56a4,4,0,0,0,0-8Zm122.83-22.83a4,4,0,0,0-5.66,0L188,198.34V112a4,4,0,0,0-8,0v86.34l-33.17-33.17a4,4,0,0,0-5.66,5.66l40,40a4,4,0,0,0,5.66,0l40-40A4,4,0,0,0,226.83,165.17Z"}))]]),jr=c.forwardRef((e,t)=>c.createElement(Ve,{ref:t,...e,weights:Wi}));jr.displayName="CalendarIcon";const nc=jr,Vr=c.forwardRef((e,t)=>c.createElement(Ve,{ref:t,...e,weights:Xi}));Vr.displayName="DotsSixVerticalIcon";const oc=Vr,Or=c.forwardRef((e,t)=>c.createElement(Ve,{ref:t,...e,weights:Yi}));Or.displayName="EyeIcon";const rc=Or,kr=c.forwardRef((e,t)=>c.createElement(Ve,{ref:t,...e,weights:Qi}));kr.displayName="FileTextIcon";const To=kr,Hr=c.forwardRef((e,t)=>c.createElement(Ve,{ref:t,...e,weights:Ji}));Hr.displayName="GridFourIcon";const Fr=Hr,Zr=c.forwardRef((e,t)=>c.createElement(Ve,{ref:t,...e,weights:ec}));Zr.displayName="PencilSimpleIcon";const sc=Zr,Br=c.forwardRef((e,t)=>c.createElement(Ve,{ref:t,...e,weights:tc}));Br.displayName="SortAscendingIcon";const ac=Br,Gn="/login",ic="/api/auth/";let Do=!1;const cc=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${Gn}?next=${encodeURIComponent(t)}`},lc=e=>{if(!Xe.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(ic)&&t!==Gn},$r=(e=window.location)=>{Do||e.pathname===Gn||(Do=!0,e.assign(cc(e)))},uc="X-Ocean-Brain-Session-Generation";let jo=!1,Ot;const dc=e=>!!(e.authRequired&&!e.authenticated),hc=e=>{const t=e.headers.get(uc);return t?Ot?Ot===t?!1:(Ot=t,!0):(Ot=t,!1):!1},fc=(e=window.location)=>{jo||(jo=!0,e.reload())},Wt=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return"unavailable";const n=hc(t),o=await t.json();return dc(o)?($r(),"expired"):n?(fc(),"reloading"):"active"},Nn=[{queryKey:O.notes.listAll(),exact:!1},{queryKey:O.notes.tagListAll(),exact:!1},{queryKey:O.notes.tagNameListAll(),exact:!1},{queryKey:O.notes.pinned(),exact:!0},{queryKey:O.notes.backReferencesAll(),exact:!1},{queryKey:O.notes.graph(),exact:!0},{queryKey:O.views.sectionNotesAll(),exact:!1},{queryKey:O.tags.all(),exact:!1}],zr={queryKey:O.notes.propertyKeysAll(),exact:!1},pc=[...Nn,zr,{queryKey:O.notes.trashAll(),exact:!1},{queryKey:O.reminders.all(),exact:!1},{queryKey:O.images.all(),exact:!1},{queryKey:O.calendar.all(),exact:!1}],yn=async(e,t)=>{await Promise.all(t.map(n=>e.invalidateQueries(n)))},mc=async(e,t)=>{switch(t.type){case"mcp.note.created":case"web.note.updated":await yn(e,Nn);return;case"mcp.note.updated":await yn(e,[...Nn,zr]);return;case"mcp.note.deleted":await yn(e,pc);return}},gc=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Ts(t.data);!n||n.type!==e||Ds(n)},vc=()=>{const e=Hn();return c.useEffect(()=>Is(t=>{mc(e,t)}),[e]),c.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events");let n=!1;const o=()=>{n=!0,Wt()},r=()=>{n&&(n=!1,Wt())},s=Ns.map(a=>{const i=gc(a);return t.addEventListener(a,i),()=>{t.removeEventListener(a,i)}});return t.addEventListener("error",o),t.addEventListener("open",r),()=>{s.forEach(a=>{a()}),t.removeEventListener("error",o),t.removeEventListener("open",r),t.close()}},[]),null},bc=({children:e})=>p.jsx(da,{client:ha,children:p.jsx(fa,{children:p.jsxs(pa,{children:[p.jsx(vc,{}),e]})})}),Vo=({children:e,fallback:t})=>e||t;function yc({itemsPerPage:e,onItemsPerPageChange:t,sortBy:n,onSortByChange:o,sortOrder:r,onSortOrderChange:s,pinnedFirst:a,onPinnedFirstChange:i}){return p.jsx("div",{className:"flex justify-end",children:p.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Fr,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(Y,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),p.jsx(vn,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:u=>{const l=Number(u);ma(l)&&t(l)},variant:"ghost",size:"sm",children:sr.map(u=>p.jsx(lt,{value:String(u),children:u===ar?`Default (${u})`:u},u))})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ac,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(Y,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),p.jsxs(vn,{value:n,ariaLabel:"Sort field",onValueChange:u=>o(u),variant:"ghost",size:"sm",children:[p.jsx(lt,{value:"updatedAt",children:"Updated"}),p.jsx(lt,{value:"createdAt",children:"Created"})]}),p.jsxs(vn,{value:r,ariaLabel:"Sort order",onValueChange:u=>s(u),variant:"ghost",size:"sm",children:[p.jsx(lt,{value:"desc",children:"Newest"}),p.jsx(lt,{value:"asc",children:"Oldest"})]})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs(ga,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[p.jsx(va,{id:"pinnedFirst",size:"sm",checked:a,onChange:u=>i(u.target.checked)}),p.jsx(Y,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}const xc=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},xn=new Map;function wc(){const e=rn({select:n=>n.pathname}),t=c.useRef(null);return c.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,o=s=>{if(s!==0){xn.set(e,s);return}xn.delete(e)},r=xc(()=>{if(t.current){const{scrollTop:s}=n;o(s)}});return n.scrollTop=xn.get(e)??0,n.addEventListener("scroll",r),()=>{n.removeEventListener("scroll",r)}}},[e]),p.jsx("div",{ref:t,className:"hidden"})}const Sc=()=>null,Rc="flex h-dvh min-h-0 w-full flex-row overflow-hidden",Ec=ie("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"),Cc=ie("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"),Mc="pointer-events-none -translate-x-full",Pc="pointer-events-auto translate-x-0",_c=ie("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","overscroll-contain","[scrollbar-gutter:stable]"),Ac=ie("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))]"),Lc=ie("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),Ic=ie("min-h-0","min-w-0","max-w-full","flex-1","overflow-x-clip","px-4","pt-4","after:block","after:h-4","after:content-['']","max-md:after:h-24"),Nc=({sidebar:e,topNavigation:t,children:n})=>{const o=rn({select:i=>i.pathname}),[r,s]=c.useState(!1),a="site-layout-sidebar";return c.useEffect(()=>{s(!1)},[o]),p.jsxs("div",{className:Rc,children:[p.jsx("div",{className:"md:hidden",children:p.jsx("button",{type:"button",className:Ec,"aria-label":"Toggle sidebar","aria-controls":a,"aria-expanded":r,onClick:()=>s(i=>!i),children:p.jsx(js,{className:"h-6 w-6"})})}),p.jsx("aside",{id:a,className:ie(Cc,r?Pc:Mc),children:e}),p.jsxs("main",{className:_c,children:[p.jsx("div",{className:Ac,children:p.jsx("div",{className:Lc,children:t})}),p.jsx("div",{className:Ic,children:n}),p.jsx(wc,{})]})]})},Ur=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",Kr=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),Tc=async e=>{try{const t=await Fn(`
3
+ query GetServerCache($key: String!) {
4
+ cache(key: $key) {
5
+ value
6
+ }
7
+ }
8
+ `,{key:e});if(t.type==="error")throw t;if(!Ur(t.cache))throw Kr("cache",t);return t.cache.value}catch{return""}},Dc=async(e,t)=>{const n=await Fn(`
9
+ mutation SetServerCache($key: String!, $value: String!) {
10
+ setCache(key: $key, value: $value) {
11
+ value
12
+ }
13
+ }
14
+ `,{key:e,value:encodeURIComponent(t)});return n.type==="error"?n:Ur(n.setCache)?{...n,setCache:n.setCache}:Kr("setCache",n)},jc=()=>{const e=Vs(),t=ba(),n=Hn(),{data:o}=Os({queryKey:O.ui.heroBanner(),async queryFn(){return Tc("heroBanner")}});return o?p.jsx("div",{className:"p-3 pb-0",children:p.jsxs("div",{className:"surface-base group relative overflow-hidden",children:[p.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:o}),p.jsx("button",{type:"button","aria-label":"Remove sidebar banner",title:"Remove banner",className:"focus-ring-soft absolute right-2 top-2 inline-flex h-8 w-8 items-center justify-center rounded-[10px] border border-white/14 bg-black/24 text-white/85 opacity-0 outline-none backdrop-blur-sm transition-opacity hover:bg-black/34 hover:text-white focus-visible:opacity-100 group-hover:opacity-100",onClick:async()=>{if(await e("Remove this hero banner from the sidebar?")){const r=await Dc("heroBanner","");if(r.type==="error"){t(r.errors[0]?.message??"Failed to remove hero banner");return}await n.invalidateQueries({queryKey:O.ui.heroBanner(),exact:!0})}},children:p.jsx(ir,{className:"h-4 w-4",weight:"bold"})})]})}):null};function Vc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>o=>{t.forEach(r=>r(o))},t)}const sn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ye(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Wn(e){return"nodeType"in e}function Q(e){var t,n;return e?Ye(e)?e:Wn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Xn(e){const{Document:t}=Q(e);return e instanceof t}function Mt(e){return Ye(e)?!1:e instanceof Q(e).HTMLElement}function qr(e){return e instanceof Q(e).SVGElement}function Qe(e){return e?Ye(e)?e.document:Wn(e)?Xn(e)?e:Mt(e)||qr(e)?e.ownerDocument:document:document:document}const me=sn?c.useLayoutEffect:c.useEffect;function Yn(e){const t=c.useRef(e);return me(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Oc(){const e=c.useRef(null),t=c.useCallback((o,r)=>{e.current=setInterval(o,r)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function xt(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return me(()=>{n.current!==e&&(n.current=e)},t),n}function Pt(e,t){const n=c.useRef();return c.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function Xt(e){const t=Yn(e),n=c.useRef(null),o=c.useCallback(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function Tn(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let wn={};function _t(e,t){return c.useMemo(()=>{if(t)return t;const n=wn[e]==null?0:wn[e]+1;return wn[e]=n,e+"-"+n},[e,t])}function Gr(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((s,a)=>{const i=Object.entries(a);for(const[u,l]of i){const d=s[u];d!=null&&(s[u]=d+e*l)}return s},{...t})}}const Ge=Gr(1),wt=Gr(-1);function kc(e){return"clientX"in e&&"clientY"in e}function Qn(e){if(!e)return!1;const{KeyboardEvent:t}=Q(e.target);return t&&e instanceof t}function Hc(e){if(!e)return!1;const{TouchEvent:t}=Q(e.target);return t&&e instanceof t}function Dn(e){if(Hc(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 kc(e)?{x:e.clientX,y:e.clientY}:null}const St=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[St.Translate.toString(e),St.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Oo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Fc(e){return e.matches(Oo)?e:e.querySelector(Oo)}const Zc={display:"none"};function Bc(e){let{id:t,value:n}=e;return q.createElement("div",{id:t,style:Zc},n)}function $c(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;const r={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 q.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function zc(){const[e,t]=c.useState("");return{announce:c.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const Wr=c.createContext(null);function Uc(e){const t=c.useContext(Wr);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Kc(){const[e]=c.useState(()=>new Set),t=c.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[c.useCallback(o=>{let{type:r,event:s}=o;e.forEach(a=>{var i;return(i=a[r])==null?void 0:i.call(a,s)})},[e]),t]}const qc={draggable:`
15
+ To pick up a draggable item, press the space bar.
16
+ While dragging, use the arrow keys to move the item.
17
+ Press space again to drop the item in its new position, or press escape to cancel.
18
+ `},Gc={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 Wc(e){let{announcements:t=Gc,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=qc}=e;const{announce:s,announcement:a}=zc(),i=_t("DndLiveRegion"),[u,l]=c.useState(!1);if(c.useEffect(()=>{l(!0)},[]),Uc(c.useMemo(()=>({onDragStart(h){let{active:f}=h;s(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:m}=h;t.onDragMove&&s(t.onDragMove({active:f,over:m}))},onDragOver(h){let{active:f,over:m}=h;s(t.onDragOver({active:f,over:m}))},onDragEnd(h){let{active:f,over:m}=h;s(t.onDragEnd({active:f,over:m}))},onDragCancel(h){let{active:f,over:m}=h;s(t.onDragCancel({active:f,over:m}))}}),[s,t])),!u)return null;const d=q.createElement(q.Fragment,null,q.createElement(Bc,{id:o,value:r.draggable}),q.createElement($c,{id:i,announcement:a}));return n?dt.createPortal(d,n):d}var j;(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"})(j||(j={}));function Yt(){}function ko(e,t){return c.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Xc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const ce=Object.freeze({x:0,y:0});function Xr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yr(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function Yc(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Ho(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function Qr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Fo(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 Qc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Fo(t,t.left,t.top),s=[];for(const a of o){const{id:i}=a,u=n.get(i);if(u){const l=Xr(Fo(u),r);s.push({id:i,data:{droppableContainer:a,value:l}})}}return s.sort(Yr)},Jc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Ho(t),s=[];for(const a of o){const{id:i}=a,u=n.get(i);if(u){const l=Ho(u),d=r.reduce((f,m,v)=>f+Xr(l[v],m),0),h=Number((d/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:h}})}}return s.sort(Yr)};function el(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=r-o,i=s-n;if(o<r&&n<s){const u=t.width*t.height,l=e.width*e.height,d=a*i,h=d/(u+l-d);return Number(h.toFixed(4))}return 0}const tl=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const s of o){const{id:a}=s,i=n.get(a);if(i){const u=el(i,t);u>0&&r.push({id:a,data:{droppableContainer:s,value:u}})}}return r.sort(Yc)};function nl(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Jr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ce}function ol(e){return function(n){for(var o=arguments.length,r=new Array(o>1?o-1:0),s=1;s<o;s++)r[s-1]=arguments[s];return r.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 rl=ol(1);function sl(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 al(e,t,n){const o=sl(t);if(!o)return e;const{scaleX:r,scaleY:s,x:a,y:i}=o,u=e.left-a-(1-r)*parseFloat(n),l=e.top-i-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,h=s?e.height/s:e.height;return{width:d,height:h,top:l,right:u+d,bottom:l+h,left:u}}const il={ignoreTransform:!1};function Je(e,t){t===void 0&&(t=il);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:l,transformOrigin:d}=Q(e).getComputedStyle(e);l&&(n=al(n,l,d))}const{top:o,left:r,width:s,height:a,bottom:i,right:u}=n;return{top:o,left:r,width:s,height:a,bottom:i,right:u}}function Zo(e){return Je(e,{ignoreTransform:!0})}function cl(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function ll(e,t){return t===void 0&&(t=Q(e).getComputedStyle(e)),t.position==="fixed"}function ul(e,t){t===void 0&&(t=Q(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const s=t[r];return typeof s=="string"?n.test(s):!1})}function an(e,t){const n=[];function o(r){if(t!=null&&n.length>=t||!r)return n;if(Xn(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Mt(r)||qr(r)||n.includes(r))return n;const s=Q(e).getComputedStyle(r);return r!==e&&ul(r,s)&&n.push(r),ll(r,s)?n:o(r.parentNode)}return e?o(e):n}function es(e){const[t]=an(e,1);return t??null}function Sn(e){return!sn||!e?null:Ye(e)?e:Wn(e)?Xn(e)||e===Qe(e).scrollingElement?window:Mt(e)?e:null:null}function ts(e){return Ye(e)?e.scrollX:e.scrollLeft}function ns(e){return Ye(e)?e.scrollY:e.scrollTop}function jn(e){return{x:ts(e),y:ns(e)}}var k;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(k||(k={}));function os(e){return!sn||!e?!1:e===document.scrollingElement}function rs(e){const t={x:0,y:0},n=os(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=o.y,i=e.scrollLeft>=o.x;return{isTop:r,isLeft:s,isBottom:a,isRight:i,maxScroll:o,minScroll:t}}const dl={x:.2,y:.2};function hl(e,t,n,o,r){let{top:s,left:a,right:i,bottom:u}=n;o===void 0&&(o=10),r===void 0&&(r=dl);const{isTop:l,isBottom:d,isLeft:h,isRight:f}=rs(e),m={x:0,y:0},v={x:0,y:0},g={height:t.height*r.y,width:t.width*r.x};return!l&&s<=t.top+g.height?(m.y=k.Backward,v.y=o*Math.abs((t.top+g.height-s)/g.height)):!d&&u>=t.bottom-g.height&&(m.y=k.Forward,v.y=o*Math.abs((t.bottom-g.height-u)/g.height)),!f&&i>=t.right-g.width?(m.x=k.Forward,v.x=o*Math.abs((t.right-g.width-i)/g.width)):!h&&a<=t.left+g.width&&(m.x=k.Backward,v.x=o*Math.abs((t.left+g.width-a)/g.width)),{direction:m,speed:v}}function fl(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:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function ss(e){return e.reduce((t,n)=>Ge(t,jn(n)),ce)}function pl(e){return e.reduce((t,n)=>t+ts(n),0)}function ml(e){return e.reduce((t,n)=>t+ns(n),0)}function gl(e,t){if(t===void 0&&(t=Je),!e)return;const{top:n,left:o,bottom:r,right:s}=t(e);es(e)&&(r<=0||s<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const vl=[["x",["left","right"],pl],["y",["top","bottom"],ml]];class Jn{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 o=an(n),r=ss(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of vl)for(const u of a)Object.defineProperty(this,u,{get:()=>{const l=i(o),d=r[s]-l;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class pt{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function bl(e){const{EventTarget:t}=Q(e);return e instanceof t?e:Qe(e)}function Rn(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function Bo(e){e.preventDefault()}function yl(e){e.stopPropagation()}var L;(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"})(L||(L={}));const as={start:[L.Space,L.Enter],cancel:[L.Esc],end:[L.Space,L.Enter,L.Tab]},xl=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case L.Right:return{...n,x:n.x+25};case L.Left:return{...n,x:n.x-25};case L.Down:return{...n,y:n.y+25};case L.Up:return{...n,y:n.y-25}}};class eo{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 pt(Qe(n)),this.windowListeners=new pt(Q(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&gl(o),n(ce)}handleKeyDown(t){if(Qn(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:s=as,coordinateGetter:a=xl,scrollBehavior:i="smooth"}=r,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:l}=o.current,d=l?{x:l.left,y:l.top}:ce;this.referenceCoordinates||(this.referenceCoordinates=d);const h=a(t,{active:n,context:o.current,currentCoordinates:d});if(h){const f=wt(h,d),m={x:0,y:0},{scrollableAncestors:v}=o.current;for(const g of v){const b=t.code,{isTop:y,isRight:w,isLeft:R,isBottom:S,maxScroll:M,minScroll:_}=rs(g),E=fl(g),x={x:Math.min(b===L.Right?E.right-E.width/2:E.right,Math.max(b===L.Right?E.left:E.left+E.width/2,h.x)),y:Math.min(b===L.Down?E.bottom-E.height/2:E.bottom,Math.max(b===L.Down?E.top:E.top+E.height/2,h.y))},C=b===L.Right&&!w||b===L.Left&&!R,I=b===L.Down&&!S||b===L.Up&&!y;if(C&&x.x!==h.x){const P=g.scrollLeft+f.x,A=b===L.Right&&P<=M.x||b===L.Left&&P>=_.x;if(A&&!f.y){g.scrollTo({left:P,behavior:i});return}A?m.x=g.scrollLeft-P:m.x=b===L.Right?g.scrollLeft-M.x:g.scrollLeft-_.x,m.x&&g.scrollBy({left:-m.x,behavior:i});break}else if(I&&x.y!==h.y){const P=g.scrollTop+f.y,A=b===L.Down&&P<=M.y||b===L.Up&&P>=_.y;if(A&&!f.x){g.scrollTo({top:P,behavior:i});return}A?m.y=g.scrollTop-P:m.y=b===L.Down?g.scrollTop-M.y:g.scrollTop-_.y,m.y&&g.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,Ge(wt(h,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(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()}}eo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=as,onActivation:r}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),r?.({event:e.nativeEvent}),!0)}return!1}}];function $o(e){return!!(e&&"distance"in e)}function zo(e){return!!(e&&"delay"in e)}class to{constructor(t,n,o){var r;o===void 0&&(o=bl(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=Qe(a),this.documentListeners=new pt(this.document),this.listeners=new pt(o),this.windowListeners=new pt(Q(a)),this.initialCoordinates=(r=Dn(s))!=null?r:ce,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:o}}}=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(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,Bo),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,Bo),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zo(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if($o(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:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(se.Click,yl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!r)return;const u=(n=Dn(t))!=null?n:ce,l=wt(r,u);if(!o&&i){if($o(i)){if(i.tolerance!=null&&Rn(l,i.tolerance))return this.handleCancel();if(Rn(l,i.distance))return this.handleStart()}if(zo(i)&&Rn(l,i.tolerance))return this.handleCancel();this.handlePending(i,l);return}t.cancelable&&t.preventDefault(),a(u)}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===L.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const wl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class no extends to{constructor(t){const{event:n}=t,o=Qe(n.target);super(t,wl,o)}}no.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o?.({event:n}),!0)}}];const Sl={move:{name:"mousemove"},end:{name:"mouseup"}};var Vn;(function(e){e[e.RightClick=2]="RightClick"})(Vn||(Vn={}));class Rl extends to{constructor(t){super(t,Sl,Qe(t.event.target))}}Rl.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===Vn.RightClick?!1:(o?.({event:n}),!0)}}];const En={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class El extends to{constructor(t){super(t,En)}static setup(){return window.addEventListener(En.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(En.move.name,t)};function t(){}}}El.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return r.length>1?!1:(o?.({event:n}),!0)}}];var mt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(mt||(mt={}));var Qt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Qt||(Qt={}));function Cl(e){let{acceleration:t,activator:n=mt.Pointer,canScroll:o,draggingRect:r,enabled:s,interval:a=5,order:i=Qt.TreeOrder,pointerCoordinates:u,scrollableAncestors:l,scrollableAncestorRects:d,delta:h,threshold:f}=e;const m=Pl({delta:h,disabled:!s}),[v,g]=Oc(),b=c.useRef({x:0,y:0}),y=c.useRef({x:0,y:0}),w=c.useMemo(()=>{switch(n){case mt.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case mt.DraggableRect:return r}},[n,r,u]),R=c.useRef(null),S=c.useCallback(()=>{const _=R.current;if(!_)return;const E=b.current.x*y.current.x,x=b.current.y*y.current.y;_.scrollBy(E,x)},[]),M=c.useMemo(()=>i===Qt.TreeOrder?[...l].reverse():l,[i,l]);c.useEffect(()=>{if(!s||!l.length||!w){g();return}for(const _ of M){if(o?.(_)===!1)continue;const E=l.indexOf(_),x=d[E];if(!x)continue;const{direction:C,speed:I}=hl(_,x,w,t,f);for(const P of["x","y"])m[P][C[P]]||(I[P]=0,C[P]=0);if(I.x>0||I.y>0){g(),R.current=_,v(S,a),b.current=I,y.current=C;return}}b.current={x:0,y:0},y.current={x:0,y:0},g()},[t,S,o,g,s,a,JSON.stringify(w),JSON.stringify(m),v,l,M,d,JSON.stringify(f)])}const Ml={x:{[k.Backward]:!1,[k.Forward]:!1},y:{[k.Backward]:!1,[k.Forward]:!1}};function Pl(e){let{delta:t,disabled:n}=e;const o=Tn(t);return Pt(r=>{if(n||!o||!r)return Ml;const s={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[k.Backward]:r.x[k.Backward]||s.x===-1,[k.Forward]:r.x[k.Forward]||s.x===1},y:{[k.Backward]:r.y[k.Backward]||s.y===-1,[k.Forward]:r.y[k.Forward]||s.y===1}}},[n,t,o])}function _l(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return Pt(r=>{var s;return t==null?null:(s=o??r)!=null?s:null},[o,t])}function Al(e,t){return c.useMemo(()=>e.reduce((n,o)=>{const{sensor:r}=o,s=r.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,o)}));return[...n,...s]},[]),[e,t])}var Rt;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Rt||(Rt={}));var On;(function(e){e.Optimized="optimized"})(On||(On={}));const Uo=new Map;function Ll(e,t){let{dragging:n,dependencies:o,config:r}=t;const[s,a]=c.useState(null),{frequency:i,measure:u,strategy:l}=r,d=c.useRef(e),h=b(),f=xt(h),m=c.useCallback(function(y){y===void 0&&(y=[]),!f.current&&a(w=>w===null?y:w.concat(y.filter(R=>!w.includes(R))))},[f]),v=c.useRef(null),g=Pt(y=>{if(h&&!n)return Uo;if(!y||y===Uo||d.current!==e||s!=null){const w=new Map;for(let R of e){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){w.set(R.id,R.rect.current);continue}const S=R.node.current,M=S?new Jn(u(S),S):null;R.rect.current=M,M&&w.set(R.id,M)}return w}return y},[e,s,n,h,u]);return c.useEffect(()=>{d.current=e},[e]),c.useEffect(()=>{h||m()},[n,h]),c.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),c.useEffect(()=>{h||typeof i!="number"||v.current!==null||(v.current=setTimeout(()=>{m(),v.current=null},i))},[i,h,m,...o]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:s!=null};function b(){switch(l){case Rt.Always:return!1;case Rt.BeforeDragging:return n;default:return!n}}}function is(e,t){return Pt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Il(e,t){return is(e,t)}function Nl(e){let{callback:t,disabled:n}=e;const o=Yn(t),r=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(o)},[o,n]);return c.useEffect(()=>()=>r?.disconnect(),[r]),r}function cn(e){let{callback:t,disabled:n}=e;const o=Yn(t),r=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(o)},[n]);return c.useEffect(()=>()=>r?.disconnect(),[r]),r}function Tl(e){return new Jn(Je(e),e)}function Ko(e,t,n){t===void 0&&(t=Tl);const[o,r]=c.useState(null);function s(){r(u=>{if(!e)return null;if(e.isConnected===!1){var l;return(l=u??n)!=null?l:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d})}const a=Nl({callback(u){if(e)for(const l of u){const{type:d,target:h}=l;if(d==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),i=cn({callback:s});return me(()=>{s(),e?(i?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(i?.disconnect(),a?.disconnect())},[e]),o}function Dl(e){const t=is(e);return Jr(e,t)}const qo=[];function jl(e){const t=c.useRef(e),n=Pt(o=>e?o&&o!==qo&&e&&t.current&&e.parentNode===t.current.parentNode?o:an(e):qo,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function Vl(e){const[t,n]=c.useState(null),o=c.useRef(e),r=c.useCallback(s=>{const a=Sn(s.target);a&&n(i=>i?(i.set(a,jn(a)),new Map(i)):null)},[]);return c.useEffect(()=>{const s=o.current;if(e!==s){a(s);const i=e.map(u=>{const l=Sn(u);return l?(l.addEventListener("scroll",r,{passive:!0}),[l,jn(l)]):null}).filter(u=>u!=null);n(i.length?new Map(i):null),o.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(u=>{const l=Sn(u);l?.removeEventListener("scroll",r)})}},[r,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>Ge(s,a),ce):ss(e):ce,[e,t])}function Go(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const o=e!==ce;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?wt(e,n.current):ce}function Ol(e){c.useEffect(()=>{if(!sn)return;const t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function kl(e,t){return c.useMemo(()=>e.reduce((n,o)=>{let{eventName:r,handler:s}=o;return n[r]=a=>{s(a,t)},n},{}),[e,t])}function cs(e){return c.useMemo(()=>e?cl(e):null,[e])}const Wo=[];function Hl(e,t){t===void 0&&(t=Je);const[n]=e,o=cs(n?Q(n):null),[r,s]=c.useState(Wo);function a(){s(()=>e.length?e.map(u=>os(u)?o:new Jn(t(u),u)):Wo)}const i=cn({callback:a});return me(()=>{i?.disconnect(),a(),e.forEach(u=>i?.observe(u))},[e]),r}function Fl(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Mt(t)?t:e}function Zl(e){let{measure:t}=e;const[n,o]=c.useState(null),r=c.useCallback(l=>{for(const{target:d}of l)if(Mt(d)){o(h=>{const f=t(d);return h?{...h,width:f.width,height:f.height}:f});break}},[t]),s=cn({callback:r}),a=c.useCallback(l=>{const d=Fl(l);s?.disconnect(),d&&s?.observe(d),o(d?t(d):null)},[t,s]),[i,u]=Xt(a);return c.useMemo(()=>({nodeRef:i,rect:n,setRef:u}),[n,i,u])}const Bl=[{sensor:no,options:{}},{sensor:eo,options:{}}],$l={current:{}},$t={draggable:{measure:Zo},droppable:{measure:Zo,strategy:Rt.WhileDragging,frequency:On.Optimized},dragOverlay:{measure:Je}};class gt 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,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const zl={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new gt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Yt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:$t,measureDroppableContainers:Yt,windowRect:null,measuringScheduled:!1},Ul={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Yt,draggableNodes:new Map,over:null,measureDroppableContainers:Yt},ln=c.createContext(Ul),ls=c.createContext(zl);function Kl(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new gt}}}function ql(e,t){switch(t.type){case j.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case j.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 j.DragEnd:case j.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case j.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new gt(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case j.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,s=e.droppable.containers.get(n);if(!s||o!==s.key)return e;const a=new gt(e.droppable.containers);return a.set(n,{...s,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case j.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const s=new gt(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Gl(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=c.useContext(ln),s=Tn(o),a=Tn(n?.id);return c.useEffect(()=>{if(!t&&!o&&s&&a!=null){if(!Qn(s)||document.activeElement===s.target)return;const i=r.get(a);if(!i)return;const{activatorNode:u,node:l}=i;if(!u.current&&!l.current)return;requestAnimationFrame(()=>{for(const d of[u.current,l.current]){if(!d)continue;const h=Fc(d);if(h){h.focus();break}}})}},[o,t,r,a,s]),null}function Wl(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,s)=>s({transform:r,...o}),n):n}function Xl(e){return c.useMemo(()=>({draggable:{...$t.draggable,...e?.draggable},droppable:{...$t.droppable,...e?.droppable},dragOverlay:{...$t.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Yl(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const s=c.useRef(!1),{x:a,y:i}=typeof r=="boolean"?{x:r,y:r}:r;me(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!o)return;const l=t?.node.current;if(!l||l.isConnected===!1)return;const d=n(l),h=Jr(d,o);if(a||(h.x=0),i||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const f=es(l);f&&f.scrollBy({top:h.y,left:h.x})}},[t,a,i,o,n])}const us=c.createContext({...ce,scaleX:1,scaleY:1});var Ae;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ae||(Ae={}));const Ql=c.memo(function(t){var n,o,r,s;let{id:a,accessibility:i,autoScroll:u=!0,children:l,sensors:d=Bl,collisionDetection:h=tl,measuring:f,modifiers:m,...v}=t;const g=c.useReducer(ql,void 0,Kl),[b,y]=g,[w,R]=Kc(),[S,M]=c.useState(Ae.Uninitialized),_=S===Ae.Initialized,{draggable:{active:E,nodes:x,translate:C},droppable:{containers:I}}=b,P=E!=null?x.get(E):null,A=c.useRef({initial:null,translated:null}),K=c.useMemo(()=>{var $;return E!=null?{id:E,data:($=P?.data)!=null?$:$l,rect:A}:null},[E,P]),T=c.useRef(null),[le,G]=c.useState(null),[V,At]=c.useState(null),ge=xt(v,Object.values(v)),tt=_t("DndDescribedBy",a),Lt=c.useMemo(()=>I.getEnabled(),[I]),W=Xl(f),{droppableRects:ve,measureDroppableContainers:Te,measuringScheduled:nt}=Ll(Lt,{dragging:_,dependencies:[C.x,C.y],config:W.droppable}),oe=_l(x,E),It=c.useMemo(()=>V?Dn(V):null,[V]),Re=Ls(),be=Il(oe,W.draggable.measure);Yl({activeNode:E!=null?x.get(E):null,config:Re.layoutShiftCompensation,initialRect:be,measure:W.draggable.measure});const N=Ko(oe,W.draggable.measure,be),ot=Ko(oe?oe.parentElement:null),ue=c.useRef({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:ve,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=I.getNodeFor((n=ue.current.over)==null?void 0:n.id),ye=Zl({measure:W.dragOverlay.measure}),ke=(o=ye.nodeRef.current)!=null?o:oe,He=_?(r=ye.rect)!=null?r:N:null,oo=!!(ye.nodeRef.current&&ye.rect),ro=Dl(oo?null:N),hn=cs(ke?Q(ke):null),Ee=jl(_?Oe??oe:null),Nt=Hl(Ee),Tt=Wl(m,{transform:{x:C.x-ro.x,y:C.y-ro.y,scaleX:1,scaleY:1},activatorEvent:V,active:K,activeNodeRect:N,containerNodeRect:ot,draggingNodeRect:He,over:ue.current.over,overlayNodeRect:ye.rect,scrollableAncestors:Ee,scrollableAncestorRects:Nt,windowRect:hn}),so=It?Ge(It,C):null,ao=Vl(Ee),Rs=Go(ao),Es=Go(ao,[N]),Fe=Ge(Tt,Rs),Ze=He?rl(He,Tt):null,rt=K&&Ze?h({active:K,collisionRect:Ze,droppableRects:ve,droppableContainers:Lt,pointerCoordinates:so}):null,io=Qr(rt,"id"),[Ce,co]=c.useState(null),Cs=oo?Tt:Ge(Tt,Es),Ms=nl(Cs,(s=Ce?.rect)!=null?s:null,N),fn=c.useRef(null),lo=c.useCallback(($,J)=>{let{sensor:ee,options:Me}=J;if(T.current==null)return;const re=x.get(T.current);if(!re)return;const te=$.nativeEvent,de=new ee({active:T.current,activeNode:re,event:te,options:Me,context:ue,onAbort(Z){if(!x.get(Z))return;const{onDragAbort:he}=ge.current,xe={id:Z};he?.(xe),w({type:"onDragAbort",event:xe})},onPending(Z,Pe,he,xe){if(!x.get(Z))return;const{onDragPending:at}=ge.current,_e={id:Z,constraint:Pe,initialCoordinates:he,offset:xe};at?.(_e),w({type:"onDragPending",event:_e})},onStart(Z){const Pe=T.current;if(Pe==null)return;const he=x.get(Pe);if(!he)return;const{onDragStart:xe}=ge.current,st={activatorEvent:te,active:{id:Pe,data:he.data,rect:A}};dt.unstable_batchedUpdates(()=>{xe?.(st),M(Ae.Initializing),y({type:j.DragStart,initialCoordinates:Z,active:Pe}),w({type:"onDragStart",event:st}),G(fn.current),At(te)})},onMove(Z){y({type:j.DragMove,coordinates:Z})},onEnd:Be(j.DragEnd),onCancel:Be(j.DragCancel)});fn.current=de;function Be(Z){return async function(){const{active:he,collisions:xe,over:st,scrollAdjustedTranslate:at}=ue.current;let _e=null;if(he&&at){const{cancelDrop:it}=ge.current;_e={activatorEvent:te,active:he,collisions:xe,delta:at,over:st},Z===j.DragEnd&&typeof it=="function"&&await Promise.resolve(it(_e))&&(Z=j.DragCancel)}T.current=null,dt.unstable_batchedUpdates(()=>{y({type:Z}),M(Ae.Uninitialized),co(null),G(null),At(null),fn.current=null;const it=Z===j.DragEnd?"onDragEnd":"onDragCancel";if(_e){const pn=ge.current[it];pn?.(_e),w({type:it,event:_e})}})}}},[x]),Ps=c.useCallback(($,J)=>(ee,Me)=>{const re=ee.nativeEvent,te=x.get(Me);if(T.current!==null||!te||re.dndKit||re.defaultPrevented)return;const de={active:te};$(ee,J.options,de)===!0&&(re.dndKit={capturedBy:J.sensor},T.current=Me,lo(ee,J))},[x,lo]),uo=Al(d,Ps);Ol(d),me(()=>{N&&S===Ae.Initializing&&M(Ae.Initialized)},[N,S]),c.useEffect(()=>{const{onDragMove:$}=ge.current,{active:J,activatorEvent:ee,collisions:Me,over:re}=ue.current;if(!J||!ee)return;const te={active:J,activatorEvent:ee,collisions:Me,delta:{x:Fe.x,y:Fe.y},over:re};dt.unstable_batchedUpdates(()=>{$?.(te),w({type:"onDragMove",event:te})})},[Fe.x,Fe.y]),c.useEffect(()=>{const{active:$,activatorEvent:J,collisions:ee,droppableContainers:Me,scrollAdjustedTranslate:re}=ue.current;if(!$||T.current==null||!J||!re)return;const{onDragOver:te}=ge.current,de=Me.get(io),Be=de&&de.rect.current?{id:de.id,rect:de.rect.current,data:de.data,disabled:de.disabled}:null,Z={active:$,activatorEvent:J,collisions:ee,delta:{x:re.x,y:re.y},over:Be};dt.unstable_batchedUpdates(()=>{co(Be),te?.(Z),w({type:"onDragOver",event:Z})})},[io]),me(()=>{ue.current={activatorEvent:V,active:K,activeNode:oe,collisionRect:Ze,collisions:rt,droppableRects:ve,draggableNodes:x,draggingNode:ke,draggingNodeRect:He,droppableContainers:I,over:Ce,scrollableAncestors:Ee,scrollAdjustedTranslate:Fe},A.current={initial:He,translated:Ze}},[K,oe,rt,Ze,x,ke,He,ve,I,Ce,Ee,Fe]),Cl({...Re,delta:C,draggingRect:Ze,pointerCoordinates:so,scrollableAncestors:Ee,scrollableAncestorRects:Nt});const _s=c.useMemo(()=>({active:K,activeNode:oe,activeNodeRect:N,activatorEvent:V,collisions:rt,containerNodeRect:ot,dragOverlay:ye,draggableNodes:x,droppableContainers:I,droppableRects:ve,over:Ce,measureDroppableContainers:Te,scrollableAncestors:Ee,scrollableAncestorRects:Nt,measuringConfiguration:W,measuringScheduled:nt,windowRect:hn}),[K,oe,N,V,rt,ot,ye,x,I,ve,Ce,Te,Ee,Nt,W,nt,hn]),As=c.useMemo(()=>({activatorEvent:V,activators:uo,active:K,activeNodeRect:N,ariaDescribedById:{draggable:tt},dispatch:y,draggableNodes:x,over:Ce,measureDroppableContainers:Te}),[V,uo,K,N,y,tt,x,Ce,Te]);return q.createElement(Wr.Provider,{value:R},q.createElement(ln.Provider,{value:As},q.createElement(ls.Provider,{value:_s},q.createElement(us.Provider,{value:Ms},l)),q.createElement(Gl,{disabled:i?.restoreFocus===!1})),q.createElement(Wc,{...i,hiddenTextDescribedById:tt}));function Ls(){const $=le?.autoScrollEnabled===!1,J=typeof u=="object"?u.enabled===!1:u===!1,ee=_&&!$&&!J;return typeof u=="object"?{...u,enabled:ee}:{enabled:ee}}}),Jl=c.createContext(null),Xo="button",eu="Draggable";function tu(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const s=_t(eu),{activators:a,activatorEvent:i,active:u,activeNodeRect:l,ariaDescribedById:d,draggableNodes:h,over:f}=c.useContext(ln),{role:m=Xo,roleDescription:v="draggable",tabIndex:g=0}=r??{},b=u?.id===t,y=c.useContext(b?us:Jl),[w,R]=Xt(),[S,M]=Xt(),_=kl(a,t),E=xt(n);me(()=>(h.set(t,{id:t,key:s,node:w,activatorNode:S,data:E}),()=>{const C=h.get(t);C&&C.key===s&&h.delete(t)}),[h,t]);const x=c.useMemo(()=>({role:m,tabIndex:g,"aria-disabled":o,"aria-pressed":b&&m===Xo?!0:void 0,"aria-roledescription":v,"aria-describedby":d.draggable}),[o,m,g,b,v,d.draggable]);return{active:u,activatorEvent:i,activeNodeRect:l,attributes:x,isDragging:b,listeners:o?void 0:_,node:w,over:f,setNodeRef:R,setActivatorNodeRef:M,transform:y}}function nu(){return c.useContext(ls)}const ou="Droppable",ru={timeout:25};function su(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const s=_t(ou),{active:a,dispatch:i,over:u,measureDroppableContainers:l}=c.useContext(ln),d=c.useRef({disabled:n}),h=c.useRef(!1),f=c.useRef(null),m=c.useRef(null),{disabled:v,updateMeasurementsFor:g,timeout:b}={...ru,...r},y=xt(g??o),w=c.useCallback(()=>{if(!h.current){h.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(y.current)?y.current:[y.current]),m.current=null},b)},[b]),R=cn({callback:w,disabled:v||!a}),S=c.useCallback((x,C)=>{R&&(C&&(R.unobserve(C),h.current=!1),x&&R.observe(x))},[R]),[M,_]=Xt(S),E=xt(t);return c.useEffect(()=>{!R||!M.current||(R.disconnect(),h.current=!1,R.observe(M.current))},[M,R]),c.useEffect(()=>(i({type:j.RegisterDroppable,element:{id:o,key:s,disabled:n,node:M,rect:f,data:E}}),()=>i({type:j.UnregisterDroppable,key:s,id:o})),[o]),c.useEffect(()=>{n!==d.current.disabled&&(i({type:j.SetDroppableDisabled,id:o,key:s,disabled:n}),d.current.disabled=n)},[o,s,n,i]),{active:a,rect:f,isOver:u?.id===o,node:M,over:u,setNodeRef:_}}const Gd=e=>{let{transform:t}=e;return{...t,y:0}},au=e=>{let{transform:t}=e;return{...t,x:0}};function ds(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function iu(e,t){return e.reduce((n,o,r)=>{const s=t.get(o);return s&&(n[r]=s),n},Array(e.length))}function kt(e){return e!==null&&e>=0}function cu(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 lu(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ht={scaleX:1,scaleY:1},Wd=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:s,index:a}=e;const i=(t=n[r])!=null?t:o;if(!i)return null;const u=uu(n,a,r);if(a===r){const l=n[s];return l?{x:r<s?l.left+l.width-(i.left+i.width):l.left-i.left,y:0,...Ht}:null}return a>r&&a<=s?{x:-i.width-u,y:0,...Ht}:a<r&&a>=s?{x:i.width+u,y:0,...Ht}:{x:0,y:0,...Ht}};function uu(e,t,n){const o=e[t],r=e[t-1],s=e[t+1];return!o||!r&&!s?0:n<t?r?o.left-(r.left+r.width):s.left-(o.left+o.width):s?s.left-(o.left+o.width):o.left-(r.left+r.width)}const hs=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const s=ds(t,o,n),a=t[r],i=s[r];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Ft={scaleX:1,scaleY:1},du=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:s,overIndex:a}=e;const i=(t=s[n])!=null?t:o;if(!i)return null;if(r===n){const l=s[a];return l?{x:0,y:n<a?l.top+l.height-(i.top+i.height):l.top-i.top,...Ft}:null}const u=hu(s,r,n);return r>n&&r<=a?{x:0,y:-i.height-u,...Ft}:r<n&&r>=a?{x:0,y:i.height+u,...Ft}:{x:0,y:0,...Ft}};function hu(e,t,n){const o=e[t],r=e[t-1],s=e[t+1];return o?n<t?r?o.top-(r.top+r.height):s?s.top-(o.top+o.height):0:s?s.top-(o.top+o.height):r?o.top-(r.top+r.height):0:0}const fs="Sortable",ps=q.createContext({activeIndex:-1,containerId:fs,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:hs,disabled:{draggable:!1,droppable:!1}});function fu(e){let{children:t,id:n,items:o,strategy:r=hs,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:u,over:l,measureDroppableContainers:d}=nu(),h=_t(fs,n),f=i.rect!==null,m=c.useMemo(()=>o.map(_=>typeof _=="object"&&"id"in _?_.id:_),[o]),v=a!=null,g=a?m.indexOf(a.id):-1,b=l?m.indexOf(l.id):-1,y=c.useRef(m),w=!cu(m,y.current),R=b!==-1&&g===-1||w,S=lu(s);me(()=>{w&&v&&d(m)},[w,m,v,d]),c.useEffect(()=>{y.current=m},[m]);const M=c.useMemo(()=>({activeIndex:g,containerId:h,disabled:S,disableTransforms:R,items:m,overIndex:b,useDragOverlay:f,sortedRects:iu(m,u),strategy:r}),[g,h,S.draggable,S.droppable,R,m,b,u,f,r]);return q.createElement(ps.Provider,{value:M},t)}const pu=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return ds(n,o,r).indexOf(t)},mu=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:s,newIndex:a,previousItems:i,previousContainerId:u,transition:l}=e;return!l||!o||i!==s&&r===a?!1:n?!0:a!==r&&t===u},gu={duration:200,easing:"ease"},ms="transform",vu=St.Transition.toString({property:ms,duration:0,easing:"linear"}),bu={roleDescription:"sortable"};function yu(e){let{disabled:t,index:n,node:o,rect:r}=e;const[s,a]=c.useState(null),i=c.useRef(n);return me(()=>{if(!t&&n!==i.current&&o.current){const u=r.current;if(u){const l=Je(o.current,{ignoreTransform:!0}),d={x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height};(d.x||d.y)&&a(d)}}n!==i.current&&(i.current=n)},[t,n,o,r]),c.useEffect(()=>{s&&a(null)},[s]),s}function xu(e){let{animateLayoutChanges:t=mu,attributes:n,disabled:o,data:r,getNewIndex:s=pu,id:a,strategy:i,resizeObserverConfig:u,transition:l=gu}=e;const{items:d,containerId:h,activeIndex:f,disabled:m,disableTransforms:v,sortedRects:g,overIndex:b,useDragOverlay:y,strategy:w}=c.useContext(ps),R=wu(o,m),S=d.indexOf(a),M=c.useMemo(()=>({sortable:{containerId:h,index:S,items:d},...r}),[h,r,S,d]),_=c.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:E,node:x,isOver:C,setNodeRef:I}=su({id:a,data:M,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...u}}),{active:P,activatorEvent:A,activeNodeRect:K,attributes:T,setNodeRef:le,listeners:G,isDragging:V,over:At,setActivatorNodeRef:ge,transform:tt}=tu({id:a,data:M,attributes:{...bu,...n},disabled:R.draggable}),Lt=Vc(I,le),W=!!P,ve=W&&!v&&kt(f)&&kt(b),Te=!y&&V,nt=Te&&ve?tt:null,It=ve?nt??(i??w)({rects:g,activeNodeRect:K,activeIndex:f,overIndex:b,index:S}):null,Re=kt(f)&&kt(b)?s({id:a,items:d,activeIndex:f,overIndex:b}):S,be=P?.id,N=c.useRef({activeId:be,items:d,newIndex:Re,containerId:h}),ot=d!==N.current.items,ue=t({active:P,containerId:h,isDragging:V,isSorting:W,id:a,index:S,items:d,newIndex:N.current.newIndex,previousItems:N.current.items,previousContainerId:N.current.containerId,transition:l,wasDragging:N.current.activeId!=null}),Oe=yu({disabled:!ue,index:S,node:x,rect:E});return c.useEffect(()=>{W&&N.current.newIndex!==Re&&(N.current.newIndex=Re),h!==N.current.containerId&&(N.current.containerId=h),d!==N.current.items&&(N.current.items=d)},[W,Re,h,d]),c.useEffect(()=>{if(be===N.current.activeId)return;if(be!=null&&N.current.activeId==null){N.current.activeId=be;return}const ke=setTimeout(()=>{N.current.activeId=be},50);return()=>clearTimeout(ke)},[be]),{active:P,activeIndex:f,attributes:T,data:M,rect:E,index:S,newIndex:Re,items:d,isOver:C,isSorting:W,isDragging:V,listeners:G,node:x,overIndex:b,over:At,setNodeRef:Lt,setActivatorNodeRef:ge,setDroppableNodeRef:I,setDraggableNodeRef:le,transform:Oe??It,transition:ye()};function ye(){if(Oe||ot&&N.current.newIndex===S)return vu;if(!(Te&&!Qn(A)||!l)&&(W||ue))return St.Transition.toString({...l,property:ms})}}function wu(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(o=e?.droppable)!=null?o:t.droppable}}function Jt(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 Su=[L.Down,L.Right,L.Up,L.Left],Ru=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(Su.includes(e.code)){if(e.preventDefault(),!n||!o)return;const u=[];s.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=r.get(h.id);if(f)switch(e.code){case L.Down:o.top<f.top&&u.push(h);break;case L.Up:o.top>f.top&&u.push(h);break;case L.Left:o.left>f.left&&u.push(h);break;case L.Right:o.left<f.left&&u.push(h);break}});const l=Jc({collisionRect:o,droppableRects:r,droppableContainers:u});let d=Qr(l,"id");if(d===a?.id&&l.length>1&&(d=l[1].id),d!=null){const h=s.get(n.id),f=s.get(d),m=f?r.get(f.id):null,v=f?.node.current;if(v&&m&&h&&f){const b=an(v).some((_,E)=>i[E]!==_),y=gs(h,f),w=Eu(h,f),R=b||!y?{x:0,y:0}:{x:w?o.width-m.width:0,y:w?o.height-m.height:0},S={x:m.left,y:m.top};return R.x&&R.y?S:wt(S,R)}}}};function gs(e,t){return!Jt(e)||!Jt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Eu(e,t){return!Jt(e)||!Jt(t)||!gs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Cu=e=>{const{data:t}=cr({queryKey:O.notes.pinned(),async queryFn(){const n=await Fn(`
19
+ query FetchPinnedNotes {
20
+ pinnedNotes {
21
+ id
22
+ title
23
+ order
24
+ }
25
+ }
26
+ `);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},Mu="focus-ring-soft flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-tertiary opacity-70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default hover:opacity-100 focus-visible:opacity-100 active:cursor-grabbing touch-none",Pu="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",_u=(e,t,n)=>{if(t===n)return null;const o=e.findIndex(i=>i.id===t),r=e.findIndex(i=>i.id===n);if(o<0||r<0)return null;const s=[...e],[a]=s.splice(o,1);return a?(s.splice(r,0,a),{nextItems:s,orders:s.map((i,u)=>({id:i.id,order:u}))}):null};function Au({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:u,transition:l,isDragging:d}=xu({id:e}),h={transform:St.Transform.toString(u),transition:l,opacity:d?.5:1};return p.jsxs("div",{ref:a,style:h,className:ie("group flex min-h-[38px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n?"bg-hover-subtle":"hover:bg-hover-subtle/70"),children:[p.jsx("button",{type:"button",ref:i,"aria-label":`Reorder note ${t??"Untitled"}`,title:"Drag to reorder",...r,...s,className:ie(Mu,d?"cursor-grabbing":"cursor-grab"),children:p.jsx(oc,{className:"size-4"})}),p.jsx(Y,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function Lu({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){c.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(Ql,{sensors:s,collisionDetection:Qc,onDragEnd:r,modifiers:[au],children:p.jsx(fu,{items:a.map(i=>i.id),strategy:du,children:a.map(i=>p.jsx(Au,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(yt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ie(Pu,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:en,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Iu=()=>{const e=rn({select:i=>i.pathname}),t=Hn(),[n,o]=c.useState([]),r=ks({mutationFn:xa,onSuccess:()=>{t.invalidateQueries({queryKey:O.notes.pinned(),exact:!0})}}),s=Xc(ko(no,{activationConstraint:{distance:8}}),ko(eo,{coordinateGetter:Ru})),a=i=>{const{active:u,over:l}=i;l&&u.id!==l.id&&o(d=>{const h=_u(d,String(u.id),String(l.id));return h?(r.mutate(h.orders),h.nextItems):d})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(lr,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(Ke,{height:"40px",opacity:.4}),p.jsx(Ke,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:u})=>p.jsx(ya,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:u,showBackAction:!1,showHomeAction:!1}),children:p.jsx(Cu,{render:i=>i.length>0?p.jsx(Lu,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(Y,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note from the note toolbar to keep it here."})})})})},Nu=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Iu,{})}),Tu="p-3 pb-0",Du="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",ju="flex items-center gap-2.5",Vu="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Ou="flex flex-col",ku="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",Hu=()=>{const{onCreate:e}=nr();return p.jsx("div",{className:Tu,children:p.jsxs("button",{type:"button",className:Du,onClick:()=>e(),children:[p.jsxs("span",{className:ju,children:[p.jsx("span",{className:Vu,children:p.jsx(sc,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Ou,children:[p.jsx(Y,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(Y,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(ur,{className:ku,weight:"bold"})]})})},Fu=e=>{const[t,n]=c.useState(!1),o=c.useRef(null),r=c.useRef(!0),s=c.useRef(0),a=c.useCallback(()=>{o.current!==null&&(clearTimeout(o.current),o.current=null)},[]);c.useEffect(()=>(r.current=!0,()=>{r.current=!1,a()}),[a]);const i=c.useCallback(u=>{s.current+=1;const l=s.current;a(),r.current&&n(!0),o.current=setTimeout(()=>{o.current=null,Promise.resolve().then(u).catch(()=>{}).finally(()=>{r.current&&s.current===l&&n(!1)})},e)},[a,e]);return[t,i]},Zu="flex flex-col gap-2.5",Bu="overflow-hidden rounded-[14px] border border-border-subtle bg-elevated transition-colors focus-within:border-border-focus focus-within:shadow-[0_0_0_4px_color-mix(in_srgb,var(--accent-soft-primary)_90%,transparent)]",$u="grid-search-bar grid items-center border-b border-transparent px-2.5 py-1.5 transition-colors",zu="border-border-subtle/70",Uu="",Yo="flex h-10 items-center justify-center text-fg-tertiary transition-colors hover:text-fg-default sm:h-8",Ku="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",qu="max-h-[min(48vh,320px)] overflow-y-auto px-1 py-1.5",Qo="focus-ring-soft flex min-h-10 items-center gap-2 rounded-[10px] px-2.5 py-2 outline-none transition-colors hover:bg-hover-subtle sm:min-h-0 sm:px-2 sm:py-1.5",Gu="min-w-0 flex-1",Wu="mt-1 border-t border-border-subtle/50 px-2 pb-0.5 pt-1.5",Xu="focus-ring-soft flex min-h-9 items-center gap-1.5 rounded-[10px] text-fg-secondary outline-none transition-colors hover:text-fg-default",Yu=()=>{const e=rr(),[t,n]=c.useState(""),[o,r]=c.useState([]),[s,a]=c.useState(!1),i=c.useRef(0),[,u]=Fu(500);c.useEffect(()=>{const g=t.trim();if(g.length<=0){i.current+=1,u(()=>{}),r([]),a(!1);return}const b=i.current+1;i.current=b,r([]),a(!0),u(()=>{dr({query:g,limit:5}).then(y=>{i.current===b&&(r(y.type==="success"?y.allNotes.notes:[]),a(!1))},()=>{i.current===b&&(r([]),a(!1))})})},[t,u]);const l=g=>{g?.preventDefault();const b=t.trim();b.length<=0||e({to:hr,search:{query:b,page:1}})},d=()=>{n("")},h=t.trim().length>0,f=o.length>0,m=h,v=h&&!s&&!f;return p.jsx("div",{className:"p-3",children:p.jsx("form",{className:Zu,onSubmit:l,children:p.jsxs("div",{className:Bu,children:[p.jsxs("div",{className:`${$u} ${f?zu:Uu}`,children:[p.jsx("button",{type:"submit","aria-label":"Search notes",className:Yo,children:p.jsx(Oa,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsx("input",{type:"text",placeholder:"Search notes",value:t,onChange:g=>n(g.target.value),className:Ku}),t&&p.jsx("button",{type:"button","aria-label":"Clear search",className:Yo,onClick:d,children:p.jsx(ir,{className:"h-4 w-4",weight:"bold"})})]}),(m||v)&&p.jsxs("div",{className:qu,children:[s&&p.jsx("div",{children:[.34,.3,.26,.22,.18].map(g=>p.jsxs("div",{className:Qo,"aria-hidden":"true",children:[p.jsx(To,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary opacity-50"}),p.jsx(Ke,{height:"21px",opacity:g,className:"min-w-0 flex-1"})]},g))}),v&&p.jsx(Y,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2",children:"No quick matches."}),o.length>0&&p.jsx("div",{children:o.map(({id:g,title:b})=>p.jsxs(yt,{to:en,params:{id:g},className:Qo,children:[p.jsx(To,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),p.jsx(Y,{as:"span",truncate:!0,variant:"meta",weight:"medium",className:Gu,children:b||"Untitled"})]},g))}),p.jsx("div",{className:Wu,children:p.jsxs("button",{type:"submit",className:Xu,children:[p.jsx(Y,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:"View all results"}),p.jsx(ur,{className:"h-3.5 w-3.5",weight:"bold"})]})})]})]})})})},Qu=[{name:"Notes",path:tn,icon:Fr},{name:"Views",path:fr,icon:rc},{name:"Graph",path:pr,icon:ka},{name:"Calendar",path:mr,icon:nc},{name:"Reminders",path:gr,icon:Hs},{name:"Tags",path:vr,icon:Fs},{name:"Setting",path:br,icon:Zs}],Ju=()=>{const e=rn({select:t=>t.pathname});return p.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:Qu.map((t,n)=>{const o=e===t.path||t.path!==tn&&e.startsWith(`${t.path}/`);return p.jsxs(c.Fragment,{children:[n>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(yt,{to:t.path,children:p.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${o?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[p.jsx(t.icon,{className:"size-5",weight:o?"fill":"regular"}),p.jsx(Y,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:t.name})]})})]},t.path)})})},ed=({children:e})=>p.jsx(Nc,{sidebar:p.jsxs(p.Fragment,{children:[p.jsx(jc,{}),p.jsx(Hu,{}),p.jsx(Yu,{}),p.jsx(Nu,{}),p.jsx(Sc,{})]}),topNavigation:p.jsx(Ju,{}),children:e}),vs=100,bs=[50,vs,200];function Xd(e){return bs.includes(e)}const td=["updatedAt","createdAt"],nd=["referenceCount","name"],ys=["asc","desc"],od=["create","update"],un=e=>Array.isArray(e)?e[0]:e,Ne=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=un(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},xs=(e,t,n)=>{const o=Ne(e,Number.NaN);return t.includes(o)?o:n},rd=(e,t=!1)=>{const n=un(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},dn=(e,t="")=>{const n=un(e);return typeof n=="string"?n:t},Et=(e,t,n)=>{const o=un(e);return typeof o!="string"?n:t.includes(o)?o:n},sd=e=>({page:Ne(e.page,1),limit:xs(e.limit,sr,ar),sortBy:Et(e.sortBy,td,"updatedAt"),sortOrder:Et(e.sortOrder,ys,"desc"),pinnedFirst:rd(e.pinnedFirst,!1)}),et=e=>({page:Ne(e.page,1)}),ad=e=>({page:Ne(e.page,1),query:dn(e.query,"")}),id=e=>({page:Ne(e.page,1),query:dn(e.query,""),limit:xs(e.limit,bs,vs),sortBy:Et(e.sortBy,nd,"referenceCount"),sortOrder:Et(e.sortOrder,ys,"desc")}),cd=e=>({year:Ne(e.year,ho().year(),{min:1970,max:9999}),month:Ne(e.month,ho().month()+1,{min:1,max:12}),type:Et(e.type,od,"create")}),ld=e=>{const t=dn(e.selected,"").trim();return t?{selected:t}:{}},ud=e=>({page:Ne(e.page,1),sectionId:dn(e.sectionId,"")}),dd=e=>{const{data:t}=cr({queryKey:O.notes.list(e.searchParams),async queryFn(){const n=await dr(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function hd({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=Bs(Number(r));return p.jsxs("div",{className:ie("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[o&&p.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:p.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:[p.jsx($s,{className:"h-3.5 w-3.5",weight:"fill"}),p.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),p.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[p.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:p.jsxs(Y,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(wa,{button:p.jsx(zs,{label:"Note actions",size:"sm"}),items:[{name:o?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>a?.()}]})]}),p.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[p.jsx(Y,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(yt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:en,params:{id:e},children:t||"Untitled"})}),n.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(u=>p.jsx(yt,{to:yr,params:{id:u.id},search:{page:1},children:p.jsx(Y,{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:u.name})},u.id))})]})]})]},e)}const Jo=Sa(tn);function fd(){const e=Jo.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=Jo.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:u}=nr(),l=d=>{e({search:h=>({...h,...d})})};return p.jsxs(Ra,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(yc,{itemsPerPage:t,onItemsPerPageChange:d=>l({limit:d,page:1}),sortBy:o,onSortByChange:d=>l({sortBy:d,page:1}),sortOrder:r,onSortOrderChange:d=>l({sortOrder:d,page:1}),pinnedFirst:s,onPinnedFirstChange:d=>l({pinnedFirst:d,page:1})}),p.jsx(lr,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(Ke,{height:"112px"}),p.jsx(Ke,{height:"112px"}),p.jsx(Ke,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(dd,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:d,totalCount:h})=>p.jsx(Vo,{fallback:p.jsx(Ca,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:d.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:d.map(f=>p.jsx(hd,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(Vo,{fallback:null,children:h&&t<h&&p.jsx(Ea,{page:n,last:Math.ceil(h/t),onChange:f=>{l({page:f})}})})]})})})})]}),u]})}const F=Ma({component:()=>p.jsx(ed,{children:p.jsx(Dr,{})}),errorComponent:_a,notFoundComponent:Pa}),pd=H({getParentRoute:()=>F,path:tn,component:fd,validateSearch:sd}),md=H({getParentRoute:()=>F,path:mr,component:U(()=>z(()=>import("./Calendar-BP6HTuSn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),pendingComponent:()=>p.jsx(B,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:cd}),gd=H({getParentRoute:()=>F,path:fr,component:U(()=>z(()=>import("./Views-D-zlatYD.js"),__vite__mapDeps([8,1,4,2,3,9,10,11,12,13,6,7]))),pendingComponent:()=>p.jsx(B,{title:"Loading views",description:"Preparing your saved dashboards."})}),vd=H({getParentRoute:()=>F,path:gr,component:U(()=>z(()=>import("./Reminders-B4l3KdlK.js"),__vite__mapDeps([14,1,2,3,15,4]))),pendingComponent:()=>p.jsx(B,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:et}),bd=H({getParentRoute:()=>F,path:pr,component:U(()=>z(()=>import("./Graph-Xha3fwhp.js"),__vite__mapDeps([16,1,2,3,7,12]))),pendingComponent:()=>p.jsx(B,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:ld}),yd=H({getParentRoute:()=>F,path:hr,component:U(()=>z(()=>import("./Search-BN5sf7bE.js"),__vite__mapDeps([17,1,2,3,4,6,7]))),pendingComponent:()=>p.jsx(B,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:ad}),xd=H({getParentRoute:()=>F,path:vr,component:U(()=>z(()=>import("./Tag-oSnmViVp.js"),__vite__mapDeps([18,1,2,3,9,7,4,6]))),pendingComponent:()=>p.jsx(B,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:id}),wd=H({getParentRoute:()=>F,path:en,component:U(()=>z(()=>import("./Note-DjrCYtat.js"),__vite__mapDeps([19,1,2,3,4,5,20,13,11,15,21,22,23,6,24,25,26,9]))),pendingComponent:()=>p.jsx(B,{title:"Loading note",description:"Preparing the editor and note content."})}),Sd=H({getParentRoute:()=>F,path:yr,component:U(()=>z(()=>import("./TagNotes-BDTCcJcL.js"),__vite__mapDeps([27,1,2,3,20,4,13,6,7]))),pendingComponent:()=>p.jsx(B,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:et}),Rd=H({getParentRoute:()=>F,path:La,component:U(()=>z(()=>import("./ViewNotes-CiZtGJNE.js"),__vite__mapDeps([28,1,4,2,3,9,10,20,13,6,7]))),pendingComponent:()=>p.jsx(B,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:ud}),Ed=H({getParentRoute:()=>F,path:br,component:U(()=>z(()=>import("./index-DKJChPr4.js"),__vite__mapDeps([29,1,4,2,3,30,31,32,6,7]))),pendingComponent:()=>p.jsx(B,{title:"Loading settings",description:"Preparing workspace preferences."})}),Cd=H({getParentRoute:()=>F,path:Ia,component:U(()=>z(()=>import("./mcp-CT_9IV2c.js"),__vite__mapDeps([33,1,4,2,3,30,26]))),pendingComponent:()=>p.jsx(B,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),Md=H({getParentRoute:()=>F,path:Na,component:U(()=>z(()=>import("./trash-8sH7EZgc.js"),__vite__mapDeps([34,1,4,2,3,11,20,13]))),pendingComponent:()=>p.jsx(B,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:et}),Pd=H({getParentRoute:()=>F,path:Ta,component:U(()=>z(()=>import("./manage-image-BZjaxp-f.js"),__vite__mapDeps([35,1,2,3,4,25,36,11,32]))),pendingComponent:()=>p.jsx(B,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:et}),_d=H({getParentRoute:()=>F,path:Da,component:U(()=>z(()=>import("./manage-image-detail-DPv0FQ2m.js"),__vite__mapDeps([37,1,2,3,4,25,36,11,20,13,32,31,6,7]))),pendingComponent:()=>p.jsx(B,{title:"Loading image detail",description:"Preparing references for the selected image."})}),Ad=H({getParentRoute:()=>F,path:Va,component:U(()=>z(()=>import("./properties-D447wsWk.js"),__vite__mapDeps([38,1,4,2,3]))),pendingComponent:()=>p.jsx(B,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:et}),Ld=H({getParentRoute:()=>F,path:ja,component:U(()=>z(()=>import("./placeholder-DbdGiYGL.js"),__vite__mapDeps([39,1,4,2,3,11,13,6,7]))),pendingComponent:()=>p.jsx(B,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:et}),Id=F.addChildren([pd,gd,md,vd,bd,yd,xd,wd,Sd,Rd,Ed,Cd,Md,Pd,_d,Ld,Ad]),Nd=Ui({routeTree:Id,defaultPreload:"intent",defaultPendingComponent:()=>p.jsx(B,{title:"Loading page",description:"Preparing the next route."})});function Td(){const e=Mn(n=>n.setSystemTheme),t=Mn(n=>n.setTheme);return c.useEffect(()=>{const n=bo();return n&&t(n),Za.listenThemeChange(o=>{bo()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(bc,{children:p.jsx(Gi,{router:Nd})})}const ws="__oceanBrainCsrfRetry";let Cn;const Dd=e=>!Xe.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",Ss=e=>{if(!Dd(e)||!Xe.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[ws])},jd=()=>(Cn??=Wt().finally(()=>{Cn=void 0}),Cn),er=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Vd=e=>{er(e.headers,"X-XSRF-TOKEN"),er(e.headers,"x-xsrf-token")},Od=async e=>{if(!Ss(e)||!Xe.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[ws]=!0,await jd()!=="active"?Promise.reject(e):(Vd(t),Xe.request(t))};let tr;const kd=()=>{tr===void 0&&(tr=Xe.interceptors.response.use(e=>e,e=>{if(lc(e))$r();else if(Ss(e))return Od(e);return Promise.reject(e)}))};Mn.setState({theme:Aa()});kd();Wt();Us.createRoot(document.getElementById("root")).render(p.jsx(q.StrictMode,{children:p.jsx(Td,{})}));export{St as C,Ql as D,Vo as F,eo as K,Rl as M,dd as N,no as P,fu as S,bs as T,nc as a,ko as b,Qc as c,xu as d,Ru as e,au as f,Fu as g,Wd as h,Fr as i,vs as j,Xd as k,ac as l,oc as m,hd as n,sc as o,Dc as p,Gd as r,To as s,Xc as u,du as v};
@@ -0,0 +1 @@
1
+ function Ce(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in t)){const c=Object.getOwnPropertyDescriptor(n,s);c&&Object.defineProperty(t,s,c.get?c:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ge(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var At={exports:{}},gt={};var zt;function Pe(){if(zt)return gt;zt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,c){var f=null;if(c!==void 0&&(f=""+c),s.key!==void 0&&(f=""+s.key),"key"in s){c={};for(var d in s)d!=="key"&&(c[d]=s[d])}else c=s;return s=c.ref,{$$typeof:t,type:n,key:f,ref:s!==void 0?s:null,props:c}}return gt.Fragment=e,gt.jsx=r,gt.jsxs=r,gt}var Gt;function Le(){return Gt||(Gt=1,At.exports=Pe()),At.exports}var zn=Le(),Tt={exports:{}},b={};var Xt;function De(){if(Xt)return b;Xt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),i=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),p=Symbol.iterator;function m(o){return o===null||typeof o!="object"?null:(o=p&&o[p]||o["@@iterator"],typeof o=="function"?o:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,v={};function x(o,g,A){this.props=o,this.context=g,this.refs=v,this.updater=A||h}x.prototype.isReactComponent={},x.prototype.setState=function(o,g){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,g,"setState")},x.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function S(){}S.prototype=x.prototype;function E(o,g,A){this.props=o,this.context=g,this.refs=v,this.updater=A||h}var R=E.prototype=new S;R.constructor=E,y(R,x.prototype),R.isPureReactComponent=!0;var T=Array.isArray;function _(){}var w={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function W(o,g,A){var O=A.ref;return{$$typeof:t,type:o,key:g,ref:O!==void 0?O:null,props:A}}function L(o,g){return W(o.type,g,o.props)}function F(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function B(o){var g={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(A){return g[A]})}var N=/\/+/g;function k(o,g){return typeof o=="object"&&o!==null&&o.key!=null?B(""+o.key):g.toString(36)}function Y(o){switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:switch(typeof o.status=="string"?o.then(_,_):(o.status="pending",o.then(function(g){o.status==="pending"&&(o.status="fulfilled",o.value=g)},function(g){o.status==="pending"&&(o.status="rejected",o.reason=g)})),o.status){case"fulfilled":return o.value;case"rejected":throw o.reason}}throw o}function M(o,g,A,O,P){var D=typeof o;(D==="undefined"||D==="boolean")&&(o=null);var $=!1;if(o===null)$=!0;else switch(D){case"bigint":case"string":case"number":$=!0;break;case"object":switch(o.$$typeof){case t:case e:$=!0;break;case l:return $=o._init,M($(o._payload),g,A,O,P)}}if($)return P=P(o),$=O===""?"."+k(o,0):O,T(P)?(A="",$!=null&&(A=$.replace(N,"$&/")+"/"),M(P,g,A,"",function(Te){return Te})):P!=null&&(F(P)&&(P=L(P,A+(P.key==null||o&&o.key===P.key?"":(""+P.key).replace(N,"$&/")+"/")+$)),g.push(P)),1;$=0;var Z=O===""?".":O+":";if(T(o))for(var U=0;U<o.length;U++)O=o[U],D=Z+k(O,U),$+=M(O,g,A,D,P);else if(U=m(o),typeof U=="function")for(o=U.call(o),U=0;!(O=o.next()).done;)O=O.value,D=Z+k(O,U++),$+=M(O,g,A,D,P);else if(D==="object"){if(typeof o.then=="function")return M(Y(o),g,A,O,P);throw g=String(o),Error("Objects are not valid as a React child (found: "+(g==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":g)+"). If you meant to render a collection of children, use an array instead.")}return $}function H(o,g,A){if(o==null)return o;var O=[],P=0;return M(o,O,"","",function(D){return g.call(A,D,P++)}),O}function C(o){if(o._status===-1){var g=o._result;g=g(),g.then(function(A){(o._status===0||o._status===-1)&&(o._status=1,o._result=A)},function(A){(o._status===0||o._status===-1)&&(o._status=2,o._result=A)}),o._status===-1&&(o._status=0,o._result=g)}if(o._status===1)return o._result.default;throw o._result}var V=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var g=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(g))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Q={map:H,forEach:function(o,g,A){H(o,function(){g.apply(this,arguments)},A)},count:function(o){var g=0;return H(o,function(){g++}),g},toArray:function(o){return H(o,function(g){return g})||[]},only:function(o){if(!F(o))throw Error("React.Children.only expected to receive a single React element child.");return o}};return b.Activity=a,b.Children=Q,b.Component=x,b.Fragment=r,b.Profiler=s,b.PureComponent=E,b.StrictMode=n,b.Suspense=u,b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,b.__COMPILER_RUNTIME={__proto__:null,c:function(o){return w.H.useMemoCache(o)}},b.cache=function(o){return function(){return o.apply(null,arguments)}},b.cacheSignal=function(){return null},b.cloneElement=function(o,g,A){if(o==null)throw Error("The argument must be a React element, but you passed "+o+".");var O=y({},o.props),P=o.key;if(g!=null)for(D in g.key!==void 0&&(P=""+g.key),g)!j.call(g,D)||D==="key"||D==="__self"||D==="__source"||D==="ref"&&g.ref===void 0||(O[D]=g[D]);var D=arguments.length-2;if(D===1)O.children=A;else if(1<D){for(var $=Array(D),Z=0;Z<D;Z++)$[Z]=arguments[Z+2];O.children=$}return W(o.type,P,O)},b.createContext=function(o){return o={$$typeof:f,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null},o.Provider=o,o.Consumer={$$typeof:c,_context:o},o},b.createElement=function(o,g,A){var O,P={},D=null;if(g!=null)for(O in g.key!==void 0&&(D=""+g.key),g)j.call(g,O)&&O!=="key"&&O!=="__self"&&O!=="__source"&&(P[O]=g[O]);var $=arguments.length-2;if($===1)P.children=A;else if(1<$){for(var Z=Array($),U=0;U<$;U++)Z[U]=arguments[U+2];P.children=Z}if(o&&o.defaultProps)for(O in $=o.defaultProps,$)P[O]===void 0&&(P[O]=$[O]);return W(o,D,P)},b.createRef=function(){return{current:null}},b.forwardRef=function(o){return{$$typeof:d,render:o}},b.isValidElement=F,b.lazy=function(o){return{$$typeof:l,_payload:{_status:-1,_result:o},_init:C}},b.memo=function(o,g){return{$$typeof:i,type:o,compare:g===void 0?null:g}},b.startTransition=function(o){var g=w.T,A={};w.T=A;try{var O=o(),P=w.S;P!==null&&P(A,O),typeof O=="object"&&O!==null&&typeof O.then=="function"&&O.then(_,V)}catch(D){V(D)}finally{g!==null&&A.types!==null&&(g.types=A.types),w.T=g}},b.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},b.use=function(o){return w.H.use(o)},b.useActionState=function(o,g,A){return w.H.useActionState(o,g,A)},b.useCallback=function(o,g){return w.H.useCallback(o,g)},b.useContext=function(o){return w.H.useContext(o)},b.useDebugValue=function(){},b.useDeferredValue=function(o,g){return w.H.useDeferredValue(o,g)},b.useEffect=function(o,g){return w.H.useEffect(o,g)},b.useEffectEvent=function(o){return w.H.useEffectEvent(o)},b.useId=function(){return w.H.useId()},b.useImperativeHandle=function(o,g,A){return w.H.useImperativeHandle(o,g,A)},b.useInsertionEffect=function(o,g){return w.H.useInsertionEffect(o,g)},b.useLayoutEffect=function(o,g){return w.H.useLayoutEffect(o,g)},b.useMemo=function(o,g){return w.H.useMemo(o,g)},b.useOptimistic=function(o,g){return w.H.useOptimistic(o,g)},b.useReducer=function(o,g,A){return w.H.useReducer(o,g,A)},b.useRef=function(o){return w.H.useRef(o)},b.useState=function(o){return w.H.useState(o)},b.useSyncExternalStore=function(o,g,A){return w.H.useSyncExternalStore(o,g,A)},b.useTransition=function(){return w.H.useTransition()},b.version="19.2.4",b}var Jt;function Et(){return Jt||(Jt=1,Tt.exports=De()),Tt.exports}var I=Et();const Me=ge(I),Gn=Ce({__proto__:null,default:Me},[I]);var Ct={exports:{}},q={};var Kt;function ke(){if(Kt)return q;Kt=1;var t=Et();function e(u){var i="https://react.dev/errors/"+u;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+u+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(e(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function c(u,i,l){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:a==null?null:""+a,children:u,containerInfo:i,implementation:l}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(u,i){if(u==="font")return"";if(typeof i=="string")return i==="use-credentials"?i:""}return q.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,q.createPortal=function(u,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)throw Error(e(299));return c(u,i,null,l)},q.flushSync=function(u){var i=f.T,l=n.p;try{if(f.T=null,n.p=2,u)return u()}finally{f.T=i,n.p=l,n.d.f()}},q.preconnect=function(u,i){typeof u=="string"&&(i?(i=i.crossOrigin,i=typeof i=="string"?i==="use-credentials"?i:"":void 0):i=null,n.d.C(u,i))},q.prefetchDNS=function(u){typeof u=="string"&&n.d.D(u)},q.preinit=function(u,i){if(typeof u=="string"&&i&&typeof i.as=="string"){var l=i.as,a=d(l,i.crossOrigin),p=typeof i.integrity=="string"?i.integrity:void 0,m=typeof i.fetchPriority=="string"?i.fetchPriority:void 0;l==="style"?n.d.S(u,typeof i.precedence=="string"?i.precedence:void 0,{crossOrigin:a,integrity:p,fetchPriority:m}):l==="script"&&n.d.X(u,{crossOrigin:a,integrity:p,fetchPriority:m,nonce:typeof i.nonce=="string"?i.nonce:void 0})}},q.preinitModule=function(u,i){if(typeof u=="string")if(typeof i=="object"&&i!==null){if(i.as==null||i.as==="script"){var l=d(i.as,i.crossOrigin);n.d.M(u,{crossOrigin:l,integrity:typeof i.integrity=="string"?i.integrity:void 0,nonce:typeof i.nonce=="string"?i.nonce:void 0})}}else i==null&&n.d.M(u)},q.preload=function(u,i){if(typeof u=="string"&&typeof i=="object"&&i!==null&&typeof i.as=="string"){var l=i.as,a=d(l,i.crossOrigin);n.d.L(u,l,{crossOrigin:a,integrity:typeof i.integrity=="string"?i.integrity:void 0,nonce:typeof i.nonce=="string"?i.nonce:void 0,type:typeof i.type=="string"?i.type:void 0,fetchPriority:typeof i.fetchPriority=="string"?i.fetchPriority:void 0,referrerPolicy:typeof i.referrerPolicy=="string"?i.referrerPolicy:void 0,imageSrcSet:typeof i.imageSrcSet=="string"?i.imageSrcSet:void 0,imageSizes:typeof i.imageSizes=="string"?i.imageSizes:void 0,media:typeof i.media=="string"?i.media:void 0})}},q.preloadModule=function(u,i){if(typeof u=="string")if(i){var l=d(i.as,i.crossOrigin);n.d.m(u,{as:typeof i.as=="string"&&i.as!=="script"?i.as:void 0,crossOrigin:l,integrity:typeof i.integrity=="string"?i.integrity:void 0})}else n.d.m(u)},q.requestFormReset=function(u){n.d.r(u)},q.unstable_batchedUpdates=function(u,i){return u(i)},q.useFormState=function(u,i,l){return f.H.useFormState(u,i,l)},q.useFormStatus=function(){return f.H.useHostTransitionStatus()},q.version="19.2.4",q}var Qt;function $e(){if(Qt)return Ct.exports;Qt=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Ct.exports=ke(),Ct.exports}var Pt={exports:{}},Lt={},Dt={exports:{}},Mt={};var Zt;function je(){if(Zt)return Mt;Zt=1;var t=Et();function e(a,p){return a===p&&(a!==0||1/a===1/p)||a!==a&&p!==p}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,s=t.useEffect,c=t.useLayoutEffect,f=t.useDebugValue;function d(a,p){var m=p(),h=n({inst:{value:m,getSnapshot:p}}),y=h[0].inst,v=h[1];return c(function(){y.value=m,y.getSnapshot=p,u(y)&&v({inst:y})},[a,m,p]),s(function(){return u(y)&&v({inst:y}),a(function(){u(y)&&v({inst:y})})},[a]),f(m),m}function u(a){var p=a.getSnapshot;a=a.value;try{var m=p();return!r(a,m)}catch{return!0}}function i(a,p){return p()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:d;return Mt.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:l,Mt}var te;function Ne(){return te||(te=1,Dt.exports=je()),Dt.exports}var ee;function He(){if(ee)return Lt;ee=1;var t=Et(),e=Ne();function r(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var n=typeof Object.is=="function"?Object.is:r,s=e.useSyncExternalStore,c=t.useRef,f=t.useEffect,d=t.useMemo,u=t.useDebugValue;return Lt.useSyncExternalStoreWithSelector=function(i,l,a,p,m){var h=c(null);if(h.current===null){var y={hasValue:!1,value:null};h.current=y}else y=h.current;h=d(function(){function x(_){if(!S){if(S=!0,E=_,_=p(_),m!==void 0&&y.hasValue){var w=y.value;if(m(w,_))return R=w}return R=_}if(w=R,n(E,_))return w;var j=p(_);return m!==void 0&&m(w,j)?(E=_,w):(E=_,R=j)}var S=!1,E,R,T=a===void 0?null:a;return[function(){return x(l())},T===null?void 0:function(){return x(T())}]},[l,a,p,m]);var v=s(i,h[0],h[1]);return f(function(){y.hasValue=!0,y.value=v},[v]),u(v),v},Lt}var ne;function Fe(){return ne||(ne=1,Pt.exports=He()),Pt.exports}var Xn=Fe(),pe=$e();const Jn=ge(pe);function he(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=he(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Kn(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=he(t))&&(n&&(n+=" "),n+=e);return n}const Ie=["top","right","bottom","left"],it=Math.min,tt=Math.max,We={left:"right",right:"left",bottom:"top",top:"bottom"},Be={start:"end",end:"start"};function jt(t,e,r){return tt(t,it(e,r))}function nt(t,e){return typeof t=="function"?t(e):t}function X(t){return t.split("-")[0]}function dt(t){return t.split("-")[1]}function It(t){return t==="x"?"y":"x"}function Wt(t){return t==="y"?"height":"width"}const Ye=new Set(["top","bottom"]);function G(t){return Ye.has(X(t))?"y":"x"}function Bt(t){return It(G(t))}function Ve(t,e,r){r===void 0&&(r=!1);const n=dt(t),s=Bt(t),c=Wt(s);let f=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(f=wt(f)),[f,wt(f)]}function qe(t){const e=wt(t);return[Nt(t),e,Nt(e)]}function Nt(t){return t.replace(/start|end/g,e=>Be[e])}const re=["left","right"],oe=["right","left"],Ue=["top","bottom"],ze=["bottom","top"];function Ge(t,e,r){switch(t){case"top":case"bottom":return r?e?oe:re:e?re:oe;case"left":case"right":return e?Ue:ze;default:return[]}}function Xe(t,e,r,n){const s=dt(t);let c=Ge(X(t),r==="start",n);return s&&(c=c.map(f=>f+"-"+s),e&&(c=c.concat(c.map(Nt)))),c}function wt(t){return t.replace(/left|right|bottom|top/g,e=>We[e])}function Je(t){return{top:0,right:0,bottom:0,left:0,...t}}function Yt(t){return typeof t!="number"?Je(t):{top:t,right:t,bottom:t,left:t}}function lt(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function ie(t,e,r){let{reference:n,floating:s}=t;const c=G(e),f=Bt(e),d=Wt(f),u=X(e),i=c==="y",l=n.x+n.width/2-s.width/2,a=n.y+n.height/2-s.height/2,p=n[d]/2-s[d]/2;let m;switch(u){case"top":m={x:l,y:n.y-s.height};break;case"bottom":m={x:l,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:a};break;case"left":m={x:n.x-s.width,y:a};break;default:m={x:n.x,y:n.y}}switch(dt(e)){case"start":m[f]-=p*(r&&i?-1:1);break;case"end":m[f]+=p*(r&&i?-1:1);break}return m}async function Ke(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:c,rects:f,elements:d,strategy:u}=t,{boundary:i="clippingAncestors",rootBoundary:l="viewport",elementContext:a="floating",altBoundary:p=!1,padding:m=0}=nt(e,t),h=Yt(m),v=d[p?a==="floating"?"reference":"floating":a],x=lt(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(v)))==null||r?v:v.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(d.floating)),boundary:i,rootBoundary:l,strategy:u})),S=a==="floating"?{x:n,y:s,width:f.floating.width,height:f.floating.height}:f.reference,E=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d.floating)),R=await(c.isElement==null?void 0:c.isElement(E))?await(c.getScale==null?void 0:c.getScale(E))||{x:1,y:1}:{x:1,y:1},T=lt(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:S,offsetParent:E,strategy:u}):S);return{top:(x.top-T.top+h.top)/R.y,bottom:(T.bottom-x.bottom+h.bottom)/R.y,left:(x.left-T.left+h.left)/R.x,right:(T.right-x.right+h.right)/R.x}}const Qe=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:c=[],platform:f}=r,d=c.filter(Boolean),u=await(f.isRTL==null?void 0:f.isRTL(e));let i=await f.getElementRects({reference:t,floating:e,strategy:s}),{x:l,y:a}=ie(i,n,u),p=n,m={},h=0;for(let v=0;v<d.length;v++){var y;const{name:x,fn:S}=d[v],{x:E,y:R,data:T,reset:_}=await S({x:l,y:a,initialPlacement:n,placement:p,strategy:s,middlewareData:m,rects:i,platform:{...f,detectOverflow:(y=f.detectOverflow)!=null?y:Ke},elements:{reference:t,floating:e}});l=E??l,a=R??a,m={...m,[x]:{...m[x],...T}},_&&h<=50&&(h++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(i=_.rects===!0?await f.getElementRects({reference:t,floating:e,strategy:s}):_.rects),{x:l,y:a}=ie(i,p,u)),v=-1)}return{x:l,y:a,placement:p,strategy:s,middlewareData:m}},Ze=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:c,platform:f,elements:d,middlewareData:u}=e,{element:i,padding:l=0}=nt(t,e)||{};if(i==null)return{};const a=Yt(l),p={x:r,y:n},m=Bt(s),h=Wt(m),y=await f.getDimensions(i),v=m==="y",x=v?"top":"left",S=v?"bottom":"right",E=v?"clientHeight":"clientWidth",R=c.reference[h]+c.reference[m]-p[m]-c.floating[h],T=p[m]-c.reference[m],_=await(f.getOffsetParent==null?void 0:f.getOffsetParent(i));let w=_?_[E]:0;(!w||!await(f.isElement==null?void 0:f.isElement(_)))&&(w=d.floating[E]||c.floating[h]);const j=R/2-T/2,W=w/2-y[h]/2-1,L=it(a[x],W),F=it(a[S],W),B=L,N=w-y[h]-F,k=w/2-y[h]/2+j,Y=jt(B,k,N),M=!u.arrow&&dt(s)!=null&&k!==Y&&c.reference[h]/2-(k<B?L:F)-y[h]/2<0,H=M?k<B?k-B:k-N:0;return{[m]:p[m]+H,data:{[m]:Y,centerOffset:k-Y-H,...M&&{alignmentOffset:H}},reset:M}}}),tn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:c,rects:f,initialPlacement:d,platform:u,elements:i}=e,{mainAxis:l=!0,crossAxis:a=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...v}=nt(t,e);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const x=X(s),S=G(d),E=X(d)===d,R=await(u.isRTL==null?void 0:u.isRTL(i.floating)),T=p||(E||!y?[wt(d)]:qe(d)),_=h!=="none";!p&&_&&T.push(...Xe(d,y,h,R));const w=[d,...T],j=await u.detectOverflow(e,v),W=[];let L=((n=c.flip)==null?void 0:n.overflows)||[];if(l&&W.push(j[x]),a){const k=Ve(s,f,R);W.push(j[k[0]],j[k[1]])}if(L=[...L,{placement:s,overflows:W}],!W.every(k=>k<=0)){var F,B;const k=(((F=c.flip)==null?void 0:F.index)||0)+1,Y=w[k];if(Y&&(!(a==="alignment"?S!==G(Y):!1)||L.every(C=>G(C.placement)===S?C.overflows[0]>0:!0)))return{data:{index:k,overflows:L},reset:{placement:Y}};let M=(B=L.filter(H=>H.overflows[0]<=0).sort((H,C)=>H.overflows[1]-C.overflows[1])[0])==null?void 0:B.placement;if(!M)switch(m){case"bestFit":{var N;const H=(N=L.filter(C=>{if(_){const V=G(C.placement);return V===S||V==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(V=>V>0).reduce((V,Q)=>V+Q,0)]).sort((C,V)=>C[1]-V[1])[0])==null?void 0:N[0];H&&(M=H);break}case"initialPlacement":M=d;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function se(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ce(t){return Ie.some(e=>t[e]>=0)}const en=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:s="referenceHidden",...c}=nt(t,e);switch(s){case"referenceHidden":{const f=await n.detectOverflow(e,{...c,elementContext:"reference"}),d=se(f,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:ce(d)}}}case"escaped":{const f=await n.detectOverflow(e,{...c,altBoundary:!0}),d=se(f,r.floating);return{data:{escapedOffsets:d,escaped:ce(d)}}}default:return{}}}}};function ye(t){const e=it(...t.map(c=>c.left)),r=it(...t.map(c=>c.top)),n=tt(...t.map(c=>c.right)),s=tt(...t.map(c=>c.bottom));return{x:e,y:r,width:n-e,height:s-r}}function nn(t){const e=t.slice().sort((s,c)=>s.y-c.y),r=[];let n=null;for(let s=0;s<e.length;s++){const c=e[s];!n||c.y-n.y>n.height/2?r.push([c]):r[r.length-1].push(c),n=c}return r.map(s=>lt(ye(s)))}const rn=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:r,elements:n,rects:s,platform:c,strategy:f}=e,{padding:d=2,x:u,y:i}=nt(t,e),l=Array.from(await(c.getClientRects==null?void 0:c.getClientRects(n.reference))||[]),a=nn(l),p=lt(ye(l)),m=Yt(d);function h(){if(a.length===2&&a[0].left>a[1].right&&u!=null&&i!=null)return a.find(v=>u>v.left-m.left&&u<v.right+m.right&&i>v.top-m.top&&i<v.bottom+m.bottom)||p;if(a.length>=2){if(G(r)==="y"){const L=a[0],F=a[a.length-1],B=X(r)==="top",N=L.top,k=F.bottom,Y=B?L.left:F.left,M=B?L.right:F.right,H=M-Y,C=k-N;return{top:N,bottom:k,left:Y,right:M,width:H,height:C,x:Y,y:N}}const v=X(r)==="left",x=tt(...a.map(L=>L.right)),S=it(...a.map(L=>L.left)),E=a.filter(L=>v?L.left===S:L.right===x),R=E[0].top,T=E[E.length-1].bottom,_=S,w=x,j=w-_,W=T-R;return{top:R,bottom:T,left:_,right:w,width:j,height:W,x:_,y:R}}return p}const y=await c.getElementRects({reference:{getBoundingClientRect:h},floating:n.floating,strategy:f});return s.reference.x!==y.reference.x||s.reference.y!==y.reference.y||s.reference.width!==y.reference.width||s.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},ve=new Set(["left","top"]);async function on(t,e){const{placement:r,platform:n,elements:s}=t,c=await(n.isRTL==null?void 0:n.isRTL(s.floating)),f=X(r),d=dt(r),u=G(r)==="y",i=ve.has(f)?-1:1,l=c&&u?-1:1,a=nt(e,t);let{mainAxis:p,crossAxis:m,alignmentAxis:h}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return d&&typeof h=="number"&&(m=d==="end"?h*-1:h),u?{x:m*l,y:p*i}:{x:p*i,y:m*l}}const sn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:c,placement:f,middlewareData:d}=e,u=await on(e,t);return f===((r=d.offset)==null?void 0:r.placement)&&(n=d.arrow)!=null&&n.alignmentOffset?{}:{x:s+u.x,y:c+u.y,data:{...u,placement:f}}}}},cn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s,platform:c}=e,{mainAxis:f=!0,crossAxis:d=!1,limiter:u={fn:x=>{let{x:S,y:E}=x;return{x:S,y:E}}},...i}=nt(t,e),l={x:r,y:n},a=await c.detectOverflow(e,i),p=G(X(s)),m=It(p);let h=l[m],y=l[p];if(f){const x=m==="y"?"top":"left",S=m==="y"?"bottom":"right",E=h+a[x],R=h-a[S];h=jt(E,h,R)}if(d){const x=p==="y"?"top":"left",S=p==="y"?"bottom":"right",E=y+a[x],R=y-a[S];y=jt(E,y,R)}const v=u.fn({...e,[m]:h,[p]:y});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[m]:f,[p]:d}}}}}},fn=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:c,middlewareData:f}=e,{offset:d=0,mainAxis:u=!0,crossAxis:i=!0}=nt(t,e),l={x:r,y:n},a=G(s),p=It(a);let m=l[p],h=l[a];const y=nt(d,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const E=p==="y"?"height":"width",R=c.reference[p]-c.floating[E]+v.mainAxis,T=c.reference[p]+c.reference[E]-v.mainAxis;m<R?m=R:m>T&&(m=T)}if(i){var x,S;const E=p==="y"?"width":"height",R=ve.has(X(s)),T=c.reference[a]-c.floating[E]+(R&&((x=f.offset)==null?void 0:x[a])||0)+(R?0:v.crossAxis),_=c.reference[a]+c.reference[E]+(R?0:((S=f.offset)==null?void 0:S[a])||0)-(R?v.crossAxis:0);h<T?h=T:h>_&&(h=_)}return{[p]:m,[a]:h}}}},un=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:c,platform:f,elements:d}=e,{apply:u=()=>{},...i}=nt(t,e),l=await f.detectOverflow(e,i),a=X(s),p=dt(s),m=G(s)==="y",{width:h,height:y}=c.floating;let v,x;a==="top"||a==="bottom"?(v=a,x=p===(await(f.isRTL==null?void 0:f.isRTL(d.floating))?"start":"end")?"left":"right"):(x=a,v=p==="end"?"top":"bottom");const S=y-l.top-l.bottom,E=h-l.left-l.right,R=it(y-l[v],S),T=it(h-l[x],E),_=!e.middlewareData.shift;let w=R,j=T;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(j=E),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(w=S),_&&!p){const L=tt(l.left,0),F=tt(l.right,0),B=tt(l.top,0),N=tt(l.bottom,0);m?j=h-2*(L!==0||F!==0?L+F:tt(l.left,l.right)):w=y-2*(B!==0||N!==0?B+N:tt(l.top,l.bottom))}await u({...e,availableWidth:j,availableHeight:w});const W=await f.getDimensions(d.floating);return h!==W.width||y!==W.height?{reset:{rects:!0}}:{}}}},Ht=Math.min,ft=Math.max,xt=Math.round,yt=Math.floor,et=t=>({x:t,y:t});function _t(){return typeof window<"u"}function mt(t){return we(t)?(t.nodeName||"").toLowerCase():"#document"}function z(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ot(t){var e;return(e=(we(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function we(t){return _t()?t instanceof Node||t instanceof z(t).Node:!1}function J(t){return _t()?t instanceof Element||t instanceof z(t).Element:!1}function rt(t){return _t()?t instanceof HTMLElement||t instanceof z(t).HTMLElement:!1}function fe(t){return!_t()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof z(t).ShadowRoot}const ln=new Set(["inline","contents"]);function ht(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=K(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!ln.has(s)}const an=new Set(["table","td","th"]);function dn(t){return an.has(mt(t))}const mn=[":popover-open",":modal"];function St(t){return mn.some(e=>{try{return t.matches(e)}catch{return!1}})}const gn=["transform","translate","scale","rotate","perspective"],pn=["transform","translate","scale","rotate","perspective","filter"],hn=["paint","layout","strict","content"];function Vt(t){const e=qt(),r=J(t)?K(t):t;return gn.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||pn.some(n=>(r.willChange||"").includes(n))||hn.some(n=>(r.contain||"").includes(n))}function yn(t){let e=st(t);for(;rt(e)&&!at(e);){if(Vt(e))return e;if(St(e))return null;e=st(e)}return null}function qt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vn=new Set(["html","body","#document"]);function at(t){return vn.has(mt(t))}function K(t){return z(t).getComputedStyle(t)}function bt(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function st(t){if(mt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||fe(t)&&t.host||ot(t);return fe(e)?e.host:e}function xe(t){const e=st(t);return at(e)?t.ownerDocument?t.ownerDocument.body:t.body:rt(e)&&ht(e)?e:xe(e)}function pt(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=xe(t),c=s===((n=t.ownerDocument)==null?void 0:n.body),f=z(s);if(c){const d=Ft(f);return e.concat(f,f.visualViewport||[],ht(s)?s:[],d&&r?pt(d):[])}return e.concat(s,pt(s,[],r))}function Ft(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Re(t){const e=K(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=rt(t),c=s?t.offsetWidth:r,f=s?t.offsetHeight:n,d=xt(r)!==c||xt(n)!==f;return d&&(r=c,n=f),{width:r,height:n,$:d}}function Ut(t){return J(t)?t:t.contextElement}function ut(t){const e=Ut(t);if(!rt(e))return et(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:c}=Re(e);let f=(c?xt(r.width):r.width)/n,d=(c?xt(r.height):r.height)/s;return(!f||!Number.isFinite(f))&&(f=1),(!d||!Number.isFinite(d))&&(d=1),{x:f,y:d}}const wn=et(0);function Ee(t){const e=z(t);return!qt()||!e.visualViewport?wn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function xn(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==z(t)?!1:e}function ct(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),c=Ut(t);let f=et(1);e&&(n?J(n)&&(f=ut(n)):f=ut(t));const d=xn(c,r,n)?Ee(c):et(0);let u=(s.left+d.x)/f.x,i=(s.top+d.y)/f.y,l=s.width/f.x,a=s.height/f.y;if(c){const p=z(c),m=n&&J(n)?z(n):n;let h=p,y=Ft(h);for(;y&&n&&m!==h;){const v=ut(y),x=y.getBoundingClientRect(),S=K(y),E=x.left+(y.clientLeft+parseFloat(S.paddingLeft))*v.x,R=x.top+(y.clientTop+parseFloat(S.paddingTop))*v.y;u*=v.x,i*=v.y,l*=v.x,a*=v.y,u+=E,i+=R,h=z(y),y=Ft(h)}}return lt({width:l,height:a,x:u,y:i})}function Ot(t,e){const r=bt(t).scrollLeft;return e?e.left+r:ct(ot(t)).left+r}function _e(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Ot(t,r),s=r.top+e.scrollTop;return{x:n,y:s}}function Rn(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const c=s==="fixed",f=ot(n),d=e?St(e.floating):!1;if(n===f||d&&c)return r;let u={scrollLeft:0,scrollTop:0},i=et(1);const l=et(0),a=rt(n);if((a||!a&&!c)&&((mt(n)!=="body"||ht(f))&&(u=bt(n)),rt(n))){const m=ct(n);i=ut(n),l.x=m.x+n.clientLeft,l.y=m.y+n.clientTop}const p=f&&!a&&!c?_e(f,u):et(0);return{width:r.width*i.x,height:r.height*i.y,x:r.x*i.x-u.scrollLeft*i.x+l.x+p.x,y:r.y*i.y-u.scrollTop*i.y+l.y+p.y}}function En(t){return Array.from(t.getClientRects())}function _n(t){const e=ot(t),r=bt(t),n=t.ownerDocument.body,s=ft(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),c=ft(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let f=-r.scrollLeft+Ot(t);const d=-r.scrollTop;return K(n).direction==="rtl"&&(f+=ft(e.clientWidth,n.clientWidth)-s),{width:s,height:c,x:f,y:d}}const ue=25;function Sn(t,e){const r=z(t),n=ot(t),s=r.visualViewport;let c=n.clientWidth,f=n.clientHeight,d=0,u=0;if(s){c=s.width,f=s.height;const l=qt();(!l||l&&e==="fixed")&&(d=s.offsetLeft,u=s.offsetTop)}const i=Ot(n);if(i<=0){const l=n.ownerDocument,a=l.body,p=getComputedStyle(a),m=l.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(n.clientWidth-a.clientWidth-m);h<=ue&&(c-=h)}else i<=ue&&(c+=i);return{width:c,height:f,x:d,y:u}}const bn=new Set(["absolute","fixed"]);function On(t,e){const r=ct(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,c=rt(t)?ut(t):et(1),f=t.clientWidth*c.x,d=t.clientHeight*c.y,u=s*c.x,i=n*c.y;return{width:f,height:d,x:u,y:i}}function le(t,e,r){let n;if(e==="viewport")n=Sn(t,r);else if(e==="document")n=_n(ot(t));else if(J(e))n=On(e,r);else{const s=Ee(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return lt(n)}function Se(t,e){const r=st(t);return r===e||!J(r)||at(r)?!1:K(r).position==="fixed"||Se(r,e)}function An(t,e){const r=e.get(t);if(r)return r;let n=pt(t,[],!1).filter(d=>J(d)&&mt(d)!=="body"),s=null;const c=K(t).position==="fixed";let f=c?st(t):t;for(;J(f)&&!at(f);){const d=K(f),u=Vt(f);!u&&d.position==="fixed"&&(s=null),(c?!u&&!s:!u&&d.position==="static"&&!!s&&bn.has(s.position)||ht(f)&&!u&&Se(t,f))?n=n.filter(l=>l!==f):s=d,f=st(f)}return e.set(t,n),n}function Tn(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const f=[...r==="clippingAncestors"?St(e)?[]:An(e,this._c):[].concat(r),n],d=f[0],u=f.reduce((i,l)=>{const a=le(e,l,s);return i.top=ft(a.top,i.top),i.right=Ht(a.right,i.right),i.bottom=Ht(a.bottom,i.bottom),i.left=ft(a.left,i.left),i},le(e,d,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Cn(t){const{width:e,height:r}=Re(t);return{width:e,height:r}}function Pn(t,e,r){const n=rt(e),s=ot(e),c=r==="fixed",f=ct(t,!0,c,e);let d={scrollLeft:0,scrollTop:0};const u=et(0);function i(){u.x=Ot(s)}if(n||!n&&!c)if((mt(e)!=="body"||ht(s))&&(d=bt(e)),n){const m=ct(e,!0,c,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}else s&&i();c&&!n&&s&&i();const l=s&&!n&&!c?_e(s,d):et(0),a=f.left+d.scrollLeft-u.x-l.x,p=f.top+d.scrollTop-u.y-l.y;return{x:a,y:p,width:f.width,height:f.height}}function kt(t){return K(t).position==="static"}function ae(t,e){if(!rt(t)||K(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return ot(t)===r&&(r=r.ownerDocument.body),r}function be(t,e){const r=z(t);if(St(t))return r;if(!rt(t)){let s=st(t);for(;s&&!at(s);){if(J(s)&&!kt(s))return s;s=st(s)}return r}let n=ae(t,e);for(;n&&dn(n)&&kt(n);)n=ae(n,e);return n&&at(n)&&kt(n)&&!Vt(n)?r:n||yn(t)||r}const Ln=async function(t){const e=this.getOffsetParent||be,r=this.getDimensions,n=await r(t.floating);return{reference:Pn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Dn(t){return K(t).direction==="rtl"}const Mn={convertOffsetParentRelativeRectToViewportRelativeRect:Rn,getDocumentElement:ot,getClippingRect:Tn,getOffsetParent:be,getElementRects:Ln,getClientRects:En,getDimensions:Cn,getScale:ut,isElement:J,isRTL:Dn};function Oe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kn(t,e){let r=null,n;const s=ot(t);function c(){var d;clearTimeout(n),(d=r)==null||d.disconnect(),r=null}function f(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),c();const i=t.getBoundingClientRect(),{left:l,top:a,width:p,height:m}=i;if(d||e(),!p||!m)return;const h=yt(a),y=yt(s.clientWidth-(l+p)),v=yt(s.clientHeight-(a+m)),x=yt(l),E={rootMargin:-h+"px "+-y+"px "+-v+"px "+-x+"px",threshold:ft(0,Ht(1,u))||1};let R=!0;function T(_){const w=_[0].intersectionRatio;if(w!==u){if(!R)return f();w?f(!1,w):n=setTimeout(()=>{f(!1,1e-7)},1e3)}w===1&&!Oe(i,t.getBoundingClientRect())&&f(),R=!1}try{r=new IntersectionObserver(T,{...E,root:s.ownerDocument})}catch{r=new IntersectionObserver(T,E)}r.observe(t)}return f(!0),c}function Qn(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,i=Ut(t),l=s||c?[...i?pt(i):[],...pt(e)]:[];l.forEach(x=>{s&&x.addEventListener("scroll",r,{passive:!0}),c&&x.addEventListener("resize",r)});const a=i&&d?kn(i,r):null;let p=-1,m=null;f&&(m=new ResizeObserver(x=>{let[S]=x;S&&S.target===i&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(e)})),r()}),i&&!u&&m.observe(i),m.observe(e));let h,y=u?ct(t):null;u&&v();function v(){const x=ct(t);y&&!Oe(y,x)&&r(),y=x,h=requestAnimationFrame(v)}return r(),()=>{var x;l.forEach(S=>{s&&S.removeEventListener("scroll",r),c&&S.removeEventListener("resize",r)}),a?.(),(x=m)==null||x.disconnect(),m=null,u&&cancelAnimationFrame(h)}}const $n=sn,jn=cn,Nn=tn,Hn=un,Fn=en,de=Ze,In=rn,Wn=fn,Bn=(t,e,r)=>{const n=new Map,s={platform:Mn,...r},c={...s.platform,_c:n};return Qe(t,e,{...s,platform:c})};var Yn=typeof document<"u",Vn=function(){},vt=Yn?I.useLayoutEffect:Vn;function Rt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Rt(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const c=s[n];if(!(c==="_owner"&&t.$$typeof)&&!Rt(t[c],e[c]))return!1}return!0}return t!==t&&e!==e}function Ae(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function me(t,e){const r=Ae(t);return Math.round(e*r)/r}function $t(t){const e=I.useRef(t);return vt(()=>{e.current=t}),e}function Zn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:c,floating:f}={},transform:d=!0,whileElementsMounted:u,open:i}=t,[l,a]=I.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=I.useState(n);Rt(p,n)||m(n);const[h,y]=I.useState(null),[v,x]=I.useState(null),S=I.useCallback(C=>{C!==_.current&&(_.current=C,y(C))},[]),E=I.useCallback(C=>{C!==w.current&&(w.current=C,x(C))},[]),R=c||h,T=f||v,_=I.useRef(null),w=I.useRef(null),j=I.useRef(l),W=u!=null,L=$t(u),F=$t(s),B=$t(i),N=I.useCallback(()=>{if(!_.current||!w.current)return;const C={placement:e,strategy:r,middleware:p};F.current&&(C.platform=F.current),Bn(_.current,w.current,C).then(V=>{const Q={...V,isPositioned:B.current!==!1};k.current&&!Rt(j.current,Q)&&(j.current=Q,pe.flushSync(()=>{a(Q)}))})},[p,e,r,F,B]);vt(()=>{i===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,a(C=>({...C,isPositioned:!1})))},[i]);const k=I.useRef(!1);vt(()=>(k.current=!0,()=>{k.current=!1}),[]),vt(()=>{if(R&&(_.current=R),T&&(w.current=T),R&&T){if(L.current)return L.current(R,T,N);N()}},[R,T,N,L,W]);const Y=I.useMemo(()=>({reference:_,floating:w,setReference:S,setFloating:E}),[S,E]),M=I.useMemo(()=>({reference:R,floating:T}),[R,T]),H=I.useMemo(()=>{const C={position:r,left:0,top:0};if(!M.floating)return C;const V=me(M.floating,l.x),Q=me(M.floating,l.y);return d?{...C,transform:"translate("+V+"px, "+Q+"px)",...Ae(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:V,top:Q}},[r,d,M.floating,l.x,l.y]);return I.useMemo(()=>({...l,update:N,refs:Y,elements:M,floatingStyles:H}),[l,N,Y,M,H])}const qn=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?de({element:n.current,padding:s}).fn(r):{}:n?de({element:n,padding:s}).fn(r):{}}}},tr=(t,e)=>({...$n(t),options:[t,e]}),er=(t,e)=>({...jn(t),options:[t,e]}),nr=(t,e)=>({...Wn(t),options:[t,e]}),rr=(t,e)=>({...Nn(t),options:[t,e]}),or=(t,e)=>({...Hn(t),options:[t,e]}),ir=(t,e)=>({...Fn(t),options:[t,e]}),sr=(t,e)=>({...In(t),options:[t,e]}),cr=(t,e)=>({...qn(t),options:[t,e]});export{Gn as R,pe as a,Me as b,Ne as c,Jn as d,Kn as e,pt as f,ge as g,Qn as h,ir as i,zn as j,rr as k,nr as l,sr as m,cr as n,tr as o,or as p,Et as q,I as r,er as s,$e as t,Zn as u,Un as v,Xn as w};
@@ -1,4 +1,4 @@
1
- import{b0 as i,h as t}from"./index-BR05aSXr.js";async function n({base64:a}){if(a){const{data:e}=await i.post("/api/image",{image:a});return e.url}throw new Error("No file provided")}function r({limit:a=50,offset:e=0}={}){return t(`query FetchImages($pagination: PaginationInput) {
1
+ import{S as i,a6 as t}from"./note.api-D_00ZzJC.js";async function n({base64:a}){if(a){const{data:e}=await i.post("/api/image",{image:a});return e.url}throw new Error("No file provided")}function r({limit:a=50,offset:e=0}={}){return t(`query FetchImages($pagination: PaginationInput) {
2
2
  allImages(pagination: $pagination) {
3
3
  totalCount
4
4
  images {
@@ -0,0 +1 @@
1
+ import{r as e,j as a}from"./floating-ui.react-dom-wWLZ1CdM.js";import{d as M,n as N}from"./time-B3pt8vt4.js";import{R as A,aq as E,aj as y,Z as t,ad as c,af as o}from"./note.api-D_00ZzJC.js";import{f as w}from"./mcp-admin-adapter-xAuyZc_M.js";import{i as b,h as H,f as T,e as S,d as C}from"./url-BSnWpmJx.js";import{o as R}from"./app-cTRcKMGc.js";import{I as F}from"./Image.es-DnON8cv2.js";import{n as V,c as k}from"./Trash.es-0aPpA-3S.js";import"./preload-helper-BXl3LOEh.js";import"./Graph-D9GeO71k.js";const _=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z",opacity:"0.2"}),e.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z"}))]]),I=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),L=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z",opacity:"0.2"}),e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z"}))]]),g=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:_}));g.displayName="MoonIcon";const P=g,x=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:I}));x.displayName="PaletteIcon";const O=x,Z=e.forwardRef((s,r)=>e.createElement(A,{ref:r,...s,weights:L}));Z.displayName="SunIcon";const $=Z,U="https://github.com/baealex/ocean-brain/releases",G=s=>/^\d+\.\d+\.\d+/.test(s)?`v${s}`:s,q=["mcp-admin","status"],e0=()=>{const{theme:s,toggleTheme:r}=E(j=>j),{data:p,isLoading:u}=M({queryKey:q,queryFn:w}),d=p?.server,n="focus-ring-soft surface-base group flex items-start justify-between gap-3.5 px-4 py-3.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",l="inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-[15px] border border-border-subtle bg-muted text-fg-secondary transition-colors group-hover:border-border-secondary/70 group-hover:text-fg-default",m="h-6 w-6",h="text-fg-tertiary",i="min-w-0 flex flex-col gap-0.5 pt-0.5",f=d?G(d.version):u?"checking…":"unknown",v=d?.releaseUrl??U;return a.jsx(y,{title:"Settings",description:"Manage display, workspace tools, and advanced connections",children:a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Appearance"}),a.jsxs("button",{type:"button",className:n,onClick:r,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(O,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Theme"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Switch between light and dark mode."})]})]}),a.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-fg-tertiary",children:[a.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:s==="dark"?"Dark":"Light"}),s==="dark"?a.jsx(P,{className:"h-4 w-4",weight:"fill"}):a.jsx($,{className:"h-4 w-4",weight:"fill"})]})]})]}),a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Workspace"}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[a.jsxs(c,{to:b,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(N,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Properties"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage fields used across notes."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:H,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(R,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Placeholders"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage reusable template variables."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:T,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(F,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Images"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Review uploaded note images."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),a.jsxs(c,{to:S,search:{page:1},className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(V,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Trash"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Restore or permanently delete notes."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]})]}),a.jsxs("section",{className:"flex flex-col gap-3",children:[a.jsx(t,{as:"p",variant:"label",weight:"medium",className:h,children:"Advanced"}),a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:a.jsxs(c,{to:C,className:n,children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("span",{className:l,children:a.jsx(k,{className:m})}),a.jsxs("div",{className:i,children:[a.jsx(t,{as:"div",variant:"body",weight:"medium",children:"MCP"}),a.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Connect Codex, Claude, or another MCP client."})]})]}),a.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})})]}),a.jsxs(t,{as:"p",variant:"meta",tone:"tertiary",className:"border-t border-border-subtle pt-4",children:["Ocean Brain ",f," ·"," ",a.jsx("a",{href:v,target:"_blank",rel:"noreferrer",className:"font-medium text-fg-secondary underline-offset-4 hover:underline",children:"Releases"})]})]})})};export{e0 as default};
@@ -0,0 +1 @@
1
+ import{r as h,j as e}from"./floating-ui.react-dom-wWLZ1CdM.js";import{a9 as G,T as P,U as L,aa as S,aj as N,al as C,ad as F,Z as k,au as D,ak as q,ac as x,ai as B}from"./note.api-D_00ZzJC.js";import{u as O,e as z}from"./time-B3pt8vt4.js";import{f as K,d as U}from"./image.api-CVuuvTBk.js";import{I as Q}from"./Image-BLEjLUqd.js";import{S as b}from"./SurfaceCard-BZm73nyS.js";import{g as W,f as H}from"./url-BSnWpmJx.js";import{c as $,n as V}from"./Trash.es-0aPpA-3S.js";const X=a=>{const{data:n}=G({queryKey:P.images.list(a.searchParams),async queryFn(){const s=await K({offset:a.searchParams.offset,limit:a.searchParams.limit});if(s.type==="error")throw s;return s.allImages}});return a.render(n)},M=16;function Z(a,n,s){return Math.max(Math.floor((Math.max(a,0)+s)/(n+s)),1)}function _(a,n,s){return a*n+(a-1)*s}function J({minItemWidth:a,gap:n,rows:s,fallback:c,override:g}){const[i,w]=h.useState(null),[v,p]=h.useState(c??s),r=h.useRef(null),o=h.useCallback(t=>{w(t)},[]),d=g==null,j=d?v:g;return h.useLayoutEffect(()=>{if(!d){r.current=null;return}if(!i){r.current=null,p(l=>l===(c??s)?l:c??s);return}let t=null;const I=()=>{const l=i.offsetWidth,E=Z(l,a,n),u=r.current;let y=E;if(u!==null&&u!==E)if(E>u){const f=_(u+1,a,n);l<f+M&&(y=u)}else{const f=_(u,a,n);l>f-M&&(y=u)}r.current=y;const A=Math.max(y*s,s);p(f=>f===A?f:A)},m=()=>{t===null&&(t=window.requestAnimationFrame(()=>{t=null,I()}))};if(m(),typeof ResizeObserver<"u"){const l=new ResizeObserver(()=>{m()});return l.observe(i),()=>{l.disconnect(),t!==null&&window.cancelAnimationFrame(t)}}return window.addEventListener("resize",m),window.addEventListener("orientationchange",m),()=>{window.removeEventListener("resize",m),window.removeEventListener("orientationchange",m),t!==null&&window.cancelAnimationFrame(t)}},[i,c,n,d,a,s]),{containerRef:o,limit:j,isAutoLimit:d}}const Y=240,ee=20,te=4,R=192,T=B(H),de=()=>{const a=O(),n=L(),s=T.useNavigate(),{page:c}=T.useSearch(),{containerRef:g,limit:i}=J({minItemWidth:Y,gap:ee,rows:te}),w=z({mutationFn:U,onSuccess:r=>{if(r.type==="error")throw r;n.invalidateQueries({queryKey:P.images.listAll(),exact:!1})}}),v=async r=>{await a("Delete this image? It is not referenced by any notes.")&&w.mutate(r)},p=r=>r===1?"1 reference":`${r} references`;return e.jsx("div",{ref:g,children:e.jsx(S,{fallback:e.jsx(N,{title:"Images",variant:"default",heading:e.jsx(x,{width:136,height:24,className:"rounded-full"}),description:e.jsx(x,{width:232,height:16,className:"rounded-full"}),children:e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx("div",{className:"grid-auto-cards grid gap-4",children:Array.from({length:3},(r,o)=>e.jsxs(b,{flush:!0,children:[e.jsx("div",{className:"flex items-center justify-center bg-muted/25 p-3",style:{height:R},children:e.jsx(x,{width:"100%",height:R-24,className:"rounded-[12px]"})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle px-3 py-2.5",children:[e.jsx(x,{width:92,height:14,className:"rounded-full"}),e.jsx(x,{width:32,height:32,className:"rounded-[12px]"})]})]},o))})})}),errorTitle:"Failed to load images",errorDescription:"Retry loading uploaded image metadata",resetKeys:[c,i],children:e.jsx(X,{searchParams:{offset:(c-1)*i,limit:i},render:({images:r,totalCount:o})=>{const d=o>0?`Images (${o})`:void 0,j="Review and manage the images you uploaded inside notes";return r.length===0?e.jsx(N,{title:"Images",variant:"default",heading:d,description:j,children:e.jsx(C,{title:"There are no images",description:"Upload an image in any note and it will appear here"})}):e.jsx(N,{title:"Images",variant:"default",heading:d,description:j,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-4",children:r.map(t=>e.jsxs(b,{flush:!0,children:[e.jsx(F,{to:W,params:{id:t.id},className:"focus-ring-soft block overflow-hidden rounded-t-[18px] outline-none",children:e.jsx("div",{className:"flex items-center justify-center bg-muted/25 p-3",style:{height:R},children:e.jsx(Q,{className:"h-full w-full rounded-[12px] object-contain transition-transform duration-200 hover:scale-[1.02]",src:t.url,alt:t.id})})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle px-3 py-2.5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-fg-secondary",children:[e.jsx($,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),e.jsx(k,{as:"span",variant:"meta",weight:"medium",tone:"secondary",className:"truncate",children:p(t.referenceCount)})]}),e.jsx(D,{variant:"ghost",size:"icon-sm",disabled:t.referenceCount>0,"aria-label":`Delete image ${t.id}`,onClick:()=>v(t.id),children:e.jsx(V,{className:"h-4 w-4"})})]})]},t.id))}),o&&i<o&&e.jsx(q,{page:c,last:Math.ceil(o/i),onChange:t=>{s({search:I=>({...I,page:t})})}})]})})}})})})};export{de as default};