@puddle-code/cli 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -8
- package/dist/host-control.mjs +18 -1
- package/dist/index.js +79 -18
- package/dist/public/assets/App-CYkXXLs2.js +25 -0
- package/dist/public/assets/{CompilationCommandForm-DXHvwQ8Y.js → CompilationCommandForm-BkQcFUoa.js} +1 -1
- package/dist/public/assets/Dashboard-03re-W2v.js +1 -0
- package/dist/public/assets/{DraftRecovery-B8Ld4_1b.js → DraftRecovery-tIdw_B9k.js} +1 -1
- package/dist/public/assets/EditorTabClose-fs9t84tp.js +1 -0
- package/dist/public/assets/{FileCloseScope-DoZ0oLf8.js → FileCloseScope-BS5YFuzv.js} +1 -1
- package/dist/public/assets/{FileEditorSettingsMenu-BbRHII96.js → FileEditorSettingsMenu-DUpeKKAz.js} +1 -1
- package/dist/public/assets/{FindWidget-ET5pwkkB.js → FindWidget-FJWGUnZT.js} +1 -1
- package/dist/public/assets/HuddlePane-CFYGRv0M.js +219 -0
- package/dist/public/assets/{LazyTerminal-CDS9naJH.js → LazyTerminal-DRIHw2iz.js} +2 -2
- package/dist/public/assets/{NotebookWidget-BDdx0BOy.js → NotebookWidget-O9o5XL61.js} +2 -2
- package/dist/public/assets/{PaneEditorBody-C1uu9cRG.js → PaneEditorBody-gYNeVTlY.js} +7 -7
- package/dist/public/assets/{PdfViewer-DLCPKybn.js → PdfViewer-BC-g7S60.js} +1 -1
- package/dist/public/assets/ReadOnlyDiff-DVzIKTvw.js +2 -0
- package/dist/public/assets/{ReleaseNotesDialog-B9fRaZNN.js → ReleaseNotesDialog-B1DpXA1c.js} +1 -1
- package/dist/public/assets/Ripple-B_d76mLT.js +11 -0
- package/dist/public/assets/SettingsDialog-BgmpTW4O.js +8 -0
- package/dist/public/assets/{Terminal-Dzn0RuMa.js → Terminal-_I1S2ZXt.js} +6 -6
- package/dist/public/assets/Workspace-DjRRDhFc.js +20 -0
- package/dist/public/assets/api-BLc59FAZ.js +1 -0
- package/dist/public/assets/auth-tYM1depE.js +1 -0
- package/dist/public/assets/{button-D-qeQvl5.js → button-BNH9tKwf.js} +1 -1
- package/dist/public/assets/{chevron-right-DUkOv15w.js → chevron-right-6pjfw_yV.js} +1 -1
- package/dist/public/assets/{colour-picker-DZdAiaVI.js → colour-picker-cDlTcc8M.js} +1 -1
- package/dist/public/assets/{command-BeX8pm7h.js → command-RRKOl81e.js} +1 -1
- package/dist/public/assets/{content-state-CROLtMfN.js → content-state-BO1TLd_9.js} +1 -1
- package/dist/public/assets/{context-NsaMZKAN.js → context-C632GWyy.js} +1 -1
- package/dist/public/assets/{control-tray-CjoJunx1.js → control-tray-jUtkASPS.js} +1 -1
- package/dist/public/assets/dialog-DfdBRe6G.js +41 -0
- package/dist/public/assets/{disclosure-CpSwsC7J.js → disclosure-oYVpfMYO.js} +1 -1
- package/dist/public/assets/dist-CNoWjXWo.js +1 -0
- package/dist/public/assets/{dist-BcrNV8NP.js → dist-CaMNiZN8.js} +1 -1
- package/dist/public/assets/dist-DMpqv5CF.js +1 -0
- package/dist/public/assets/{drafts-CBbjQQbz.js → drafts-wug-3Dad.js} +1 -1
- package/dist/public/assets/editor-context-CR20pm26.js +5 -0
- package/dist/public/assets/editor-links-DFaQQsK-.js +1 -0
- package/dist/public/assets/{editor-sync-BOfDr2yY.js → editor-sync-CVFWKRes.js} +1 -1
- package/dist/public/assets/{errors-CviT-mvB.js → errors-CV02t999.js} +1 -1
- package/dist/public/assets/expanding-content-CQQYN3yg.js +1 -0
- package/dist/public/assets/{file-editor-settings-BXTs1F7S.js → file-editor-settings-DXGv9vrt.js} +1 -1
- package/dist/public/assets/{file-links-CgOYgoMC.js → file-links-JFyQw_0a.js} +1 -1
- package/dist/public/assets/forward-link-Kt311XAU.js +1 -0
- package/dist/public/assets/hotkeys-ChnvTHTH.js +1 -0
- package/dist/public/assets/index-Cif1X6lX.css +2 -0
- package/dist/public/assets/index-Dp1Lhq2t.js +10 -0
- package/dist/public/assets/{react-dom-cJyBB_A4.js → jsx-runtime-ffCh33zF.js} +1 -1
- package/dist/public/assets/local-store-3IuC2qMo.js +276 -0
- package/dist/public/assets/notification-delivery-DWIF1cHd.js +1 -0
- package/dist/public/assets/{popover-Okyclsx8.js → popover-CNEMQBFf.js} +1 -1
- package/dist/public/assets/{preferences-CvSHA-AA.js → preferences-sJF-HcJf.js} +1 -1
- package/dist/public/assets/{profile-icons-BI2xFWcB.js → profile-icons-CFPzzic1.js} +1 -1
- package/dist/public/assets/profile-store-BDrSK8Qs.js +1 -0
- package/dist/public/assets/project-actions-DsWg9uGZ.js +1 -0
- package/dist/public/assets/project-drag-B0ojbuY7.js +1 -0
- package/dist/public/assets/{protocol-support-iXloAH0N.js → protocol-support-C2shbX3-.js} +1 -1
- package/dist/public/assets/queries-essOjrjZ.js +1 -0
- package/dist/public/assets/{render-rich-content-fo4uQVWR.js → render-rich-content-DlSv3j1S.js} +2 -2
- package/dist/public/assets/{scroll-restoration-C_ly1bKS.js → scroll-restoration-Bt7-rGXy.js} +1 -1
- package/dist/public/assets/select-DHaYbZVV.js +1 -0
- package/dist/public/assets/selection-actions-Bis7oo_z.js +1 -0
- package/dist/public/assets/{session-display-BUDNzNmg.js → session-display-Bxz8xi3w.js} +1 -1
- package/dist/public/assets/{session-order-b3nCJcCG.js → session-order-DsJCcSqx.js} +1 -1
- package/dist/public/assets/state-BoqmEoqv.js +1 -0
- package/dist/public/assets/{switch-CGrhQUXr.js → switch-DZ2lisDt.js} +1 -1
- package/dist/public/assets/{tooltip-Ek-eHPZu.js → tooltip-CtT-5xHL.js} +1 -1
- package/dist/public/assets/use-arrangement-ready-CovEzBp-.js +1 -0
- package/dist/public/assets/use-desktop-state-CS5BxWes.js +2 -0
- package/dist/public/assets/view-state-store-gvFpSJG_.js +1 -0
- package/dist/public/assets/window-context-Euxqnh6S.js +2 -0
- package/dist/public/assets/{ws-CDXOuBYB.js → ws-Du8jZ4aQ.js} +1 -1
- package/dist/public/index.html +6 -6
- package/dist/pudl.js +48 -13
- package/package.json +1 -1
- package/dist/public/assets/App-D7ZJpmNz.js +0 -15
- package/dist/public/assets/Dashboard-BPpKOks7.js +0 -1
- package/dist/public/assets/EditorTabClose-CGYLU9GK.js +0 -1
- package/dist/public/assets/HuddlePane-LF3pjMQM.js +0 -219
- package/dist/public/assets/ReadOnlyDiff-C7ZSVRt-.js +0 -2
- package/dist/public/assets/Ripple-Dzg6tdOM.js +0 -11
- package/dist/public/assets/SettingsDialog-_BiqIFL7.js +0 -8
- package/dist/public/assets/Workspace-DPXCUT7S.js +0 -20
- package/dist/public/assets/api-CrP4jl9e.js +0 -1
- package/dist/public/assets/auth-1SSLu56b.js +0 -1
- package/dist/public/assets/dialog-CTN-Lln6.js +0 -41
- package/dist/public/assets/dist-BOS6OKSE.js +0 -1
- package/dist/public/assets/dist-NuV8HBEc.js +0 -1
- package/dist/public/assets/editor-context-T5zIHY3K.js +0 -5
- package/dist/public/assets/expanding-content-CGXguYTu.js +0 -1
- package/dist/public/assets/forward-link-qOyuWj08.js +0 -1
- package/dist/public/assets/hotkeys-nP8gYtE7.js +0 -1
- package/dist/public/assets/index-BB_BPKbu.css +0 -2
- package/dist/public/assets/index-Cz0wGtqF.js +0 -10
- package/dist/public/assets/jsx-runtime-By8HlURe.js +0 -1
- package/dist/public/assets/local-store-Dy1Cd8sn.js +0 -276
- package/dist/public/assets/notification-delivery-CiUx4v0Z.js +0 -1
- package/dist/public/assets/profile-store-D4lZiXgL.js +0 -2
- package/dist/public/assets/project-actions-Ck504AFM.js +0 -1
- package/dist/public/assets/project-drag-BnkK15qk.js +0 -1
- package/dist/public/assets/queries-BSkHGZG8.js +0 -1
- package/dist/public/assets/select-DzQdQNsv.js +0 -1
- package/dist/public/assets/selection-actions-Fc7_vjub.js +0 -1
- package/dist/public/assets/state-CuUqRNo7.js +0 -1
- package/dist/public/assets/use-arrangement-ready-1vmV5np6.js +0 -1
- package/dist/public/assets/use-desktop-state-CBTzsmlz.js +0 -2
- package/dist/public/assets/view-state-store-Dqk7M5ei.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Pn as e,i as t,r as n}from"./local-store-3IuC2qMo.js";import{n as r,r as i}from"./auth-tYM1depE.js";var a=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.status=e,this.code=t,this.details=r,this.name=`ApiError`}};async function o(o,s,c,l){let u=i.get(),d=n(),f=o===`GET`&&s.startsWith(`/api/`)?t.start():null,p=d?await d.request(o,s,c,l):await fetch(s,{method:o,headers:{...u?{authorization:`Bearer ${u}`}:{},...c===void 0?{}:{"content-type":`application/json`}},body:c===void 0?void 0:JSON.stringify(c),signal:l});if(p.status===204)return;if(!p.ok){let t=e.safeParse(await p.json().catch(()=>null));throw t.success?(t.data.error.code===`browser_rejected`&&r(),new a(p.status,t.data.error.code,t.data.error.message,t.data.error.details)):new a(p.status,`unknown`,`${o} ${s} failed with ${p.status}`)}let m=await p.json();return!l?.aborted&&n()===d&&f?.(),m}function s(){let e=i.get();return e?{authorization:`Bearer ${e}`}:{}}async function c(t,i,o){if(n())throw new a(403,`remote_unavailable`,`Raw file transfers are unavailable remotely`);let c=await fetch(i,{...o,method:t,headers:{...s(),...o?.headers}});if(!c.ok){let n=e.safeParse(await c.json().catch(()=>null));throw n.success?(n.data.error.code===`browser_rejected`&&r(),new a(c.status,n.data.error.code,n.data.error.message,n.data.error.details)):new a(c.status,`unknown`,`${t} ${i} failed with ${c.status}`)}return c}export{s as i,o as n,c as r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,w as t}from"./local-store-3IuC2qMo.js";var n=e(`puddle.browser-authorisation`);async function r(){localStorage.removeItem(`puddle.token`);let e=new URLSearchParams(window.location.hash.slice(1)),r=e.get(`invite`);if(e.has(`invite`)||e.has(`token`)){let e=new URL(window.location.href);e.hash=``,history.replaceState(null,``,e)}if(r)try{let e=await fetch(`/frontend/bootstrap`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({invitation:r})});if(!e.ok)return;n.set(t.parse(await e.json()).credential)}catch{}}function i(){n.set(null)}export{i as n,n as r,r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{t as e}from"./react-CZI7_Jkm.js";import{t}from"./jsx-runtime-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{t as e}from"./react-CZI7_Jkm.js";import{t}from"./jsx-runtime-ffCh33zF.js";import{n,t as r}from"./utils-B6KiDbIe.js";import{n as i}from"./x-CbfJFzGo.js";var a=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,o=n,s=(e,t)=>n=>{if(t?.variants==null)return o(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(e=>{let t=n?.[e],o=i?.[e];if(t===null)return null;let s=a(t)||a(o);return r[e][s]}),c=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return o(e,s,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...c}[t]):{...i,...c}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};e();var c=t(),l=s(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-[var(--ui-radius)] font-normal transition-colors duration-150 disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3.5 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-action text-action-ink hover:bg-action-hover active:opacity-85`,secondary:`bg-elevated text-fg hover:bg-border/70 active:bg-border`,ghost:`text-fg-secondary hover:bg-elevated hover:text-fg active:bg-border/70`,danger:`bg-danger text-danger-ink hover:opacity-90 active:opacity-80`},size:{default:`h-[var(--ui-field-height)] px-3 text-sm`,sm:`h-[var(--ui-control-height)] px-2 text-xs`,lg:`h-[var(--ui-large-control-height)] px-4 text-sm`,icon:`size-[var(--ui-control-height)]`}},defaultVariants:{variant:`default`,size:`default`}});function u({className:e,variant:t,size:n,asChild:a=!1,...o}){return(0,c.jsx)(a?i:`button`,{className:r(l({variant:t,size:n}),e),...o})}export{l as n,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{t as e}from"./react-CZI7_Jkm.js";import{t}from"./jsx-runtime-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{t as e}from"./react-CZI7_Jkm.js";import{t}from"./jsx-runtime-ffCh33zF.js";import{t as n}from"./utils-B6KiDbIe.js";import{a as r}from"./dist-CNoWjXWo.js";import{t as i}from"./createLucideIcon-DyMAgLa3.js";e();var a=t();function o({className:e,type:t,...i}){return(0,a.jsx)(`input`,{type:t,className:n(`flex h-[var(--ui-field-height)] w-full px-2.5`,r,e),...i})}function s({className:e,...t}){return(0,a.jsx)(`textarea`,{className:n(`flex min-h-16 w-full px-2.5 py-2`,r,e),...t})}var c=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{o as n,s as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{wn as r}from"./local-store-3IuC2qMo.js";import{t as i}from"./utils-B6KiDbIe.js";import{C as a}from"./dialog-DfdBRe6G.js";import{t as o}from"./createLucideIcon-DyMAgLa3.js";var s=e(t(),1),c=n(),l=`Label`,u=s.forwardRef((e,t)=>(0,c.jsx)(a.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));u.displayName=l;var d=u;function f({className:e,...t}){return(0,c.jsx)(d,{className:i(`text-xs font-medium text-fg-secondary peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var p=o(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),m=o(`pipette`,[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`,key:`1y3wsu`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`,key:`110lr1`}],[`path`,{d:`m2 22 .414-.414`,key:`jhxm08`}]]),h={navy:`text-identity-navy`,gold:`text-identity-gold`,blue:`text-icon-blue`,green:`text-icon-green`,amber:`text-icon-amber`,red:`text-icon-red`,violet:`text-icon-violet`,cyan:`text-icon-cyan`,accent:`text-accent`};function g(e){return e&&h[e]||``}function _(e){return typeof e==`string`&&/^#[0-9a-f]{6}$/i.test(e)}function v(e){return _(e)?{color:e}:void 0}function y({value:e,onChange:t,disabled:n=!1,label:a=`Colour`,onCustomChange:o}){let l=(0,s.useRef)(null),u=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=u.current;if(!e)return;let t=()=>{!n&&_(e.value)&&o?.(e.value)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[n,o]);let d=()=>{let t=u.current;if(!(!t||n)){if(_(e))t.value=e;else{let e=l.current.querySelector(`[aria-pressed="true"] > span`)??l.current.querySelector(`button > span`),n=document.createElement(`canvas`);n.width=n.height=1;let r=n.getContext(`2d`);r.fillStyle=getComputedStyle(e).backgroundColor,r.fillRect(0,0,1,1),t.value=`#`+[...r.getImageData(0,0,1,1).data].slice(0,3).map(e=>e.toString(16).padStart(2,`0`)).join(``)}t.click()}};return(0,c.jsxs)(`div`,{ref:l,role:`group`,"aria-label":a,className:`flex flex-wrap items-center gap-1`,children:[[null,...r].map(r=>(0,c.jsx)(`button`,{type:`button`,title:r??`Default`,"aria-label":r??`Default colour`,"aria-pressed":(e??null)===r,disabled:n,onClick:()=>t(r),className:i(`flex size-7 cursor-pointer items-center justify-center rounded-md transition-colors hover:bg-border/50 focus-visible:bg-border/50 disabled:cursor-default disabled:opacity-50`,(e??null)===r&&`bg-border/50`),children:(0,c.jsx)(`span`,{className:i(`size-3.5 rounded-full`,r?i(`bg-current`,g(r)):`bg-[var(--identity-default)]`)})},r??`default`)),o&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`button`,{type:`button`,title:`Custom colour`,"aria-label":`Custom ${a.toLowerCase()}`,"aria-pressed":_(e),disabled:n,onClick:d,className:i(`flex size-7 cursor-pointer items-center justify-center rounded-md text-fg-muted transition-colors hover:bg-border/50 focus-visible:bg-border/50 disabled:cursor-default disabled:opacity-50`,_(e)&&`bg-border/50`),children:_(e)?(0,c.jsx)(`span`,{className:`size-3.5 rounded-full`,style:{backgroundColor:e}}):(0,c.jsx)(m,{className:`size-3.5`})}),(0,c.jsx)(`input`,{ref:u,type:`color`,"aria-label":`${a} custom colour picker`,disabled:n,tabIndex:-1,className:`sr-only`})]})]})}export{p as a,_ as i,g as n,f as o,v as r,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-By8HlURe.js";import{t as r}from"./utils-B6KiDbIe.js";import{C as i,c as a,d as o,l as s,r as c,t as l,u,y as d}from"./dialog-CTN-Lln6.js";import{a as f}from"./x-CbfJFzGo.js";import{c as p,o as m}from"./dist-NuV8HBEc.js";import{t as h}from"./search-Ct_rLLa4.js";var g=1,_=.9,v=.8,y=.17,b=.1,x=.999,S=.9999,C=.99,w=/[\\\/_+.#"@\[\(\{&]/,T=/[\\\/_+.#"@\[\(\{&]/g,E=/[\s-]/,D=/[\s-]/g;function O(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?g:C;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=O(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=g:w.test(e.charAt(l-1))?(d*=v,p=e.slice(i,l-1).match(T),p&&i>0&&(d*=x**+p.length)):E.test(e.charAt(l-1))?(d*=_,m=e.slice(i,l-1).match(D),m&&i>0&&(d*=x**+m.length)):(d*=y,i>0&&(d*=x**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=S)),(d<b&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=O(e,t,n,r,l+1,a+2,o),f*b>d&&(d=f*b)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function k(e){return e.toLowerCase().replace(D,` `)}function A(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,O(e,t,k(e),k(t),0,0,{})}var j=e(t(),1),M=`[cmdk-group=""]`,N=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,te=`[cmdk-item=""]`,ne=`${te}:not([aria-disabled="true"])`,P=`cmdk-item-select`,F=`data-value`,re=(e,t,n)=>A(e,t,n),I=j.createContext(void 0),L=()=>j.useContext(I),R=j.createContext(void 0),z=()=>j.useContext(R),B=j.createContext(void 0),V=j.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),a=X(()=>new Map),o=X(()=>new Map),s=X(()=>new Set),c=J(e),{label:l,children:u,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=d(),x=d(),S=d(),C=j.useRef(null),w=ue();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,T.emit()}},[f]),Y(()=>{w(6,L)},[]);let T=j.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=z()?.id,T.emit()}),r||w(5,L),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),E=j.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=z();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=c.current?.filter??re;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=a.current.get(n),i=0;r.forEach(t=>{let n=e.get(t);i=Math.max(n,i)}),t.push([n,i])});let r=C.current;B().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(N);t?t.appendChild(e.parentElement===t?e:e.closest(`${N} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${N} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${M}[${F}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=B().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(F);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of a.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function L(){var e;let t=z();t&&(t.parentElement?.firstChild===t&&((e=t.closest(M)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function z(){return C.current?.querySelector(`${te}[aria-selected="true"]`)}function B(){return Array.from(C.current?.querySelectorAll(ne)||[])}function V(e){let t=B()[e];t&&T.setState(`value`,t.getAttribute(F))}function H(e){var t;let n=z(),r=B(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(F))}function U(e){let t=z()?.closest(M),n;for(;t&&!n;)t=e>0?se(t,M):ce(t,M),n=t?.querySelector(ne);n?T.setState(`value`,n.getAttribute(F)):H(e)}let W=()=>V(B().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):H(1)},K=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?U(-1):H(-1)};return j.createElement(i.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:v&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=z();if(t){let e=new Event(P);t.dispatchEvent(e)}}}}},j.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:fe},l),Q(e,e=>j.createElement(R.Provider,{value:T},j.createElement(I.Provider,{value:E},e))))}),H=j.forwardRef((e,t)=>{let n=d(),r=j.useRef(null),a=j.useContext(B),o=L(),s=J(e),c=s.current?.forceMount??a?.forceMount;Y(()=>{if(!c)return o.item(n,a?.id)},[c]);let l=le(n,r,[e.value,e.children,r],e.keywords),u=z(),p=Z(e=>e.value&&e.value===l.current),m=Z(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);j.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(P,h),()=>t.removeEventListener(P,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function g(){u.setState(`value`,l.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return j.createElement(i.div,{ref:f(r,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||o.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),U=j.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=d(),c=j.useRef(null),l=j.useRef(null),u=d(),p=L(),m=Z(e=>a||p.filter()===!1?!0:!e.search||e.filtered.groups.has(s));Y(()=>p.group(s),[]),le(s,c,[e.value,e.heading,l]);let h=j.useMemo(()=>({id:s,forceMount:a}),[a]);return j.createElement(i.div,{ref:f(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&j.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Q(e,e=>j.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},j.createElement(B.Provider,{value:h},e))))}),W=j.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=j.useRef(null),o=Z(e=>!e.search);return!n&&!o?null:j.createElement(i.div,{ref:f(a,t),...r,"cmdk-separator":``,role:`separator`})}),G=j.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=z(),s=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=L();return j.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),j.createElement(i.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:a?e.value:s,onChange:e=>{a||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),K=j.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...a}=e,o=j.useRef(null),s=j.useRef(null),c=Z(e=>e.selectedItemId),l=L();return j.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),j.createElement(i.div,{ref:f(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Q(e,e=>j.createElement(`div`,{ref:f(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),ie=j.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:c,container:l,...d}=e;return j.createElement(a,{open:n,onOpenChange:r},j.createElement(o,{container:l},j.createElement(u,{"cmdk-overlay":``,className:i}),j.createElement(s,{"aria-label":e.label,"cmdk-dialog":``,className:c},j.createElement(V,{ref:t,...d}))))}),ae=j.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?j.createElement(i.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),oe=j.forwardRef((e,t)=>{let{progress:n,children:r,label:a=`Loading...`,...o}=e;return j.createElement(i.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Q(e,e=>j.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(V,{List:K,Item:H,Input:G,Group:U,Separator:W,Dialog:ie,Empty:ae,Loading:oe});function se(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ce(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=j.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?j.useEffect:j.useLayoutEffect;function X(e){let t=j.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=z(),n=()=>e(t.snapshot());return j.useSyncExternalStore(t.subscribe,n,n)}function le(e,t,n,r=[]){let i=j.useRef(),a=L();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(F,s),i.current=s}),i}var ue=()=>{let[e,t]=j.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function de(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&j.isValidElement(t)?j.cloneElement(de(t),{ref:t.ref},n(t.props.children)):n(t)}var fe={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function pe({className:e,...t}){return(0,$.jsx)(q,{className:r(`flex size-full flex-col overflow-hidden rounded-lg bg-elevated`,e),...t})}function me({open:e,onOpenChange:t,children:n}){return(0,$.jsx)(l,{open:e,onOpenChange:t,children:(0,$.jsx)(c,{className:`max-w-lg overflow-hidden p-0 [&>button]:hidden`,children:(0,$.jsx)(pe,{loop:!0,children:n})})})}function he({className:e,...t}){return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pt-1`,children:[(0,$.jsx)(h,{className:`size-4 shrink-0 text-fg-muted`}),(0,$.jsx)(q.Input,{className:r(`flex h-10 w-full bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`,e),...t})]})}function ge({className:e,...t}){return(0,$.jsx)(q.List,{className:r(`max-h-72 overflow-y-auto p-1`,e),...t})}function _e(e){return(0,$.jsx)(q.Empty,{className:`py-6 text-center text-sm text-fg-muted`,...e})}function ve({className:e,...t}){return(0,$.jsx)(q.Group,{className:r(`overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-fg-muted`,e),...t})}function ye({className:e,...t}){return(0,$.jsx)(q.Item,{className:r(p,m,`[&_svg]:size-3.5 [&_svg]:text-fg-muted data-[selected=true]:[&_svg]:text-action-ink`,e),...t})}function be({className:e,...t}){return(0,$.jsx)(`span`,{className:r(`ml-auto font-mono text-2xs tracking-widest text-fg-muted`,e),...t})}export{he as a,be as c,ve as i,me as n,ye as o,_e as r,ge as s,pe as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{t as r}from"./utils-B6KiDbIe.js";import{C as i,c as a,d as o,l as s,r as c,t as l,u,y as d}from"./dialog-DfdBRe6G.js";import{a as f}from"./x-CbfJFzGo.js";import{c as p,o as m}from"./dist-CNoWjXWo.js";import{t as h}from"./search-Ct_rLLa4.js";var g=1,_=.9,v=.8,y=.17,b=.1,x=.999,S=.9999,C=.99,w=/[\\\/_+.#"@\[\(\{&]/,T=/[\\\/_+.#"@\[\(\{&]/g,E=/[\s-]/,D=/[\s-]/g;function O(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?g:C;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=O(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=g:w.test(e.charAt(l-1))?(d*=v,p=e.slice(i,l-1).match(T),p&&i>0&&(d*=x**+p.length)):E.test(e.charAt(l-1))?(d*=_,m=e.slice(i,l-1).match(D),m&&i>0&&(d*=x**+m.length)):(d*=y,i>0&&(d*=x**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=S)),(d<b&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=O(e,t,n,r,l+1,a+2,o),f*b>d&&(d=f*b)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function k(e){return e.toLowerCase().replace(D,` `)}function A(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,O(e,t,k(e),k(t),0,0,{})}var j=e(t(),1),M=`[cmdk-group=""]`,N=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,te=`[cmdk-item=""]`,ne=`${te}:not([aria-disabled="true"])`,P=`cmdk-item-select`,F=`data-value`,re=(e,t,n)=>A(e,t,n),I=j.createContext(void 0),L=()=>j.useContext(I),R=j.createContext(void 0),z=()=>j.useContext(R),B=j.createContext(void 0),V=j.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),a=X(()=>new Map),o=X(()=>new Map),s=X(()=>new Set),c=J(e),{label:l,children:u,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=d(),x=d(),S=d(),C=j.useRef(null),w=ue();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,T.emit()}},[f]),Y(()=>{w(6,L)},[]);let T=j.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=z()?.id,T.emit()}),r||w(5,L),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),E=j.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=z();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=c.current?.filter??re;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=a.current.get(n),i=0;r.forEach(t=>{let n=e.get(t);i=Math.max(n,i)}),t.push([n,i])});let r=C.current;B().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(N);t?t.appendChild(e.parentElement===t?e:e.closest(`${N} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${N} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${M}[${F}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=B().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(F);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of a.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function L(){var e;let t=z();t&&(t.parentElement?.firstChild===t&&((e=t.closest(M)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function z(){return C.current?.querySelector(`${te}[aria-selected="true"]`)}function B(){return Array.from(C.current?.querySelectorAll(ne)||[])}function V(e){let t=B()[e];t&&T.setState(`value`,t.getAttribute(F))}function H(e){var t;let n=z(),r=B(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(F))}function U(e){let t=z()?.closest(M),n;for(;t&&!n;)t=e>0?se(t,M):ce(t,M),n=t?.querySelector(ne);n?T.setState(`value`,n.getAttribute(F)):H(e)}let W=()=>V(B().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):H(1)},K=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?U(-1):H(-1)};return j.createElement(i.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:v&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=z();if(t){let e=new Event(P);t.dispatchEvent(e)}}}}},j.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:fe},l),Q(e,e=>j.createElement(R.Provider,{value:T},j.createElement(I.Provider,{value:E},e))))}),H=j.forwardRef((e,t)=>{let n=d(),r=j.useRef(null),a=j.useContext(B),o=L(),s=J(e),c=s.current?.forceMount??a?.forceMount;Y(()=>{if(!c)return o.item(n,a?.id)},[c]);let l=le(n,r,[e.value,e.children,r],e.keywords),u=z(),p=Z(e=>e.value&&e.value===l.current),m=Z(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);j.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(P,h),()=>t.removeEventListener(P,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function g(){u.setState(`value`,l.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return j.createElement(i.div,{ref:f(r,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||o.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),U=j.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=d(),c=j.useRef(null),l=j.useRef(null),u=d(),p=L(),m=Z(e=>a||p.filter()===!1?!0:!e.search||e.filtered.groups.has(s));Y(()=>p.group(s),[]),le(s,c,[e.value,e.heading,l]);let h=j.useMemo(()=>({id:s,forceMount:a}),[a]);return j.createElement(i.div,{ref:f(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&j.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Q(e,e=>j.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},j.createElement(B.Provider,{value:h},e))))}),W=j.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=j.useRef(null),o=Z(e=>!e.search);return!n&&!o?null:j.createElement(i.div,{ref:f(a,t),...r,"cmdk-separator":``,role:`separator`})}),G=j.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=z(),s=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=L();return j.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),j.createElement(i.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:a?e.value:s,onChange:e=>{a||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),K=j.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...a}=e,o=j.useRef(null),s=j.useRef(null),c=Z(e=>e.selectedItemId),l=L();return j.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),j.createElement(i.div,{ref:f(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Q(e,e=>j.createElement(`div`,{ref:f(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),ie=j.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:c,container:l,...d}=e;return j.createElement(a,{open:n,onOpenChange:r},j.createElement(o,{container:l},j.createElement(u,{"cmdk-overlay":``,className:i}),j.createElement(s,{"aria-label":e.label,"cmdk-dialog":``,className:c},j.createElement(V,{ref:t,...d}))))}),ae=j.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?j.createElement(i.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),oe=j.forwardRef((e,t)=>{let{progress:n,children:r,label:a=`Loading...`,...o}=e;return j.createElement(i.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Q(e,e=>j.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(V,{List:K,Item:H,Input:G,Group:U,Separator:W,Dialog:ie,Empty:ae,Loading:oe});function se(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ce(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=j.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?j.useEffect:j.useLayoutEffect;function X(e){let t=j.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=z(),n=()=>e(t.snapshot());return j.useSyncExternalStore(t.subscribe,n,n)}function le(e,t,n,r=[]){let i=j.useRef(),a=L();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(F,s),i.current=s}),i}var ue=()=>{let[e,t]=j.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function de(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&j.isValidElement(t)?j.cloneElement(de(t),{ref:t.ref},n(t.props.children)):n(t)}var fe={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function pe({className:e,...t}){return(0,$.jsx)(q,{className:r(`flex size-full flex-col overflow-hidden rounded-lg bg-elevated`,e),...t})}function me({open:e,onOpenChange:t,children:n}){return(0,$.jsx)(l,{open:e,onOpenChange:t,children:(0,$.jsx)(c,{className:`max-w-lg overflow-hidden p-0 [&>button]:hidden`,children:(0,$.jsx)(pe,{loop:!0,children:n})})})}function he({className:e,...t}){return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pt-1`,children:[(0,$.jsx)(h,{className:`size-4 shrink-0 text-fg-muted`}),(0,$.jsx)(q.Input,{className:r(`flex h-10 w-full bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`,e),...t})]})}function ge({className:e,...t}){return(0,$.jsx)(q.List,{className:r(`max-h-72 overflow-y-auto p-1`,e),...t})}function _e(e){return(0,$.jsx)(q.Empty,{className:`py-6 text-center text-sm text-fg-muted`,...e})}function ve({className:e,...t}){return(0,$.jsx)(q.Group,{className:r(`overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-fg-muted`,e),...t})}function ye({className:e,...t}){return(0,$.jsx)(q.Item,{className:r(p,m,`[&_svg]:size-3.5 [&_svg]:text-fg-muted data-[selected=true]:[&_svg]:text-action-ink`,e),...t})}function be({className:e,...t}){return(0,$.jsx)(`span`,{className:r(`ml-auto font-mono text-2xs tracking-widest text-fg-muted`,e),...t})}export{he as a,be as c,ve as i,me as n,ye as o,_e as r,ge as s,pe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Z as e}from"./local-store-3IuC2qMo.js";function t(e){return JSON.stringify([e.session,e.path,e.root??null])}function n(e){let t=[],n=e=>{e&&(e.kind===`split`?e.children.forEach(n):t.push(...e.tabs))};if(e.layout_mode===`project`)for(let t of Object.values(e.project_layouts))n(t.layout_tree);else n(e.layout_tree);return t}var r=class{epoch=0;buffers=new Map;retained=null;readers=new Map;views={};listeners=new Set;retainedBuffers=()=>this.retained??=[...this.buffers.values()];subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}changed(){for(let e of this.listeners)e()}bufferChanged(e){let n=t(e),r=[...this.readers.get(n)??[]].at(-1);if(!r)return;let i=r();i?this.buffers.set(n,i):this.buffers.delete(n),this.retained=null,this.changed()}discardBuffer(e){let n=t(e);this.buffers.delete(n),this.retained=null,this.readers.delete(n),this.changed()}buffer(e){return this.buffers.get(t(e))}registerBuffer(e,n){let r=t(e),i=this.epoch,a=this.readers.get(r)??new Set;return a.add(n),this.readers.set(r,a),()=>{if(this.readers.get(r)?.has(n)){if(this.epoch===i){let e=n();e?this.buffers.set(r,e):this.buffers.delete(r),this.retained=null}a.delete(n),a.size===0&&this.readers.delete(r)}}}view(e){return this.views[e]}setView(e,t){delete this.views[e],this.views[e]=t;let n=Object.keys(this.views);for(let e of n.slice(0,Math.max(0,n.length-500)))delete this.views[e];this.changed()}viewSnapshot(){return{...this.views}}capture(t){let r=t?n(t):null,i=new Map(this.buffers);for(let[t,n]of this.readers){let a=[...n].at(-1)?.()??null,o=a??i.get(t);r&&o&&!r.some(t=>e(t,o))||(a?i.set(t,a):i.delete(t))}return this.buffers=i,this.retained=null,{buffers:[...i.values()],views:{...this.views}}}restore(e){this.epoch++,this.buffers=new Map(e.buffers.map(e=>[t(e),e])),this.retained=null,this.views={...e.views}}},i=new Map;function a(e){let t=i.get(e);return t||(t=new r,i.set(e,t)),t}export{t as n,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{v as n}from"./protocol-support-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{v as n}from"./protocol-support-C2shbX3-.js";import{b as r,r as i,x as a}from"./local-store-3IuC2qMo.js";import{n as o}from"./api-BLc59FAZ.js";import{b as s}from"./queries-essOjrjZ.js";function c(e,t){let n={...e},r=t.content.comm_id;if(t.msg_type!==`status`&&typeof r!=`string`)return n;let i=t.content.data;if(t.msg_type===`comm_close`&&delete n[r],t.msg_type===`comm_open`&&t.content.target_name===`jupyter.widget`||t.msg_type===`comm_msg`&&[`update`,`echo_update`].includes(String(i?.method))){let e=i?.state;if(!e||typeof e!=`object`||Array.isArray(e))return n;let a=e,o=Object.hasOwn(n,r)?n[r]:void 0;if(!o&&t.msg_type!==`comm_open`)return n;let s={...o?.state,...a};if(typeof s._model_name!=`string`||typeof s._model_module!=`string`||typeof s._model_module_version!=`string`)return n;let c=i?.buffer_paths,l=new Set(Object.keys(a));if(Array.isArray(c))for(let e of c)Array.isArray(e)&&l.add(String(e[0]));let u=(o?.buffers??[]).filter(e=>!l.has(String(e.path[0])));Array.isArray(c)&&c.forEach((e,n)=>{Array.isArray(e)&&e.length<=64&&e.every(e=>typeof e==`string`||Number.isInteger(e)&&e>=0)&&t.buffers[n]!==void 0&&u.push({encoding:`base64`,path:e,data:t.buffers[n]})}),Object.defineProperty(n,r,{enumerable:!0,configurable:!0,writable:!0,value:{model_name:s._model_name,model_module:s._model_module,model_module_version:s._model_module_version,state:s,...u.length?{buffers:u}:{}}})}return n}var l=e(t(),1),u=()=>({version_major:2,version_minor:0,state:{}}),d=class{source;save;state=u();current={generation:null,revision:0,events:[]};listeners=new Set;stopped=!1;epoch=0;timer;constructor(e,t){this.source=e,this.save=t}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.current;start(){this.stopped=!1,this.poll(++this.epoch)}stop(){this.stopped=!0,this.epoch++,clearTimeout(this.timer)}publish(e){this.current=e;for(let t of this.listeners)t(e)}async poll(e){try{let t=a.parse(await o(`POST`,`/api/notebooks/widgets`,{source:this.source,...this.current.generation?{generation:this.current.generation,after:this.current.revision}:{}}));if(this.stopped||this.epoch!==e)return;t.generation!==this.current.generation&&(this.state=u()),t.snapshot&&(this.state=t.snapshot);for(let e of t.events)this.state={...this.state,state:c(this.state.state,e)};(t.snapshot||t.generation!==this.current.generation||t.revision!==this.current.revision||t.error!==this.current.error)&&(this.publish(t),!t.error&&Object.keys(this.state.state).length&&this.save(this.state))}catch(t){!this.stopped&&this.epoch===e&&this.publish({generation:null,revision:0,events:[],error:t instanceof Error?t.message:`Widget connection failed`})}finally{!this.stopped&&this.epoch===e&&(this.timer=setTimeout(()=>void this.poll(e),this.listeners.size&&!document.hidden?250:1500))}}async send(e,t){if(this.stopped||this.current.error||this.current.generation!==e)throw Error(`The widget connection changed. This action was not sent.`);await o(`POST`,`/api/notebooks/widgets/comm`,{source:this.source,generation:e,message:t})}},f=(0,l.createContext)(null);function p(e,t,a,o){let c=s(),[u,f]=(0,l.useState)(),p=o&&!i()&&n(c.data?.protocol),m=(0,l.useRef)({notebook:t,update:a});m.current={notebook:t,update:a};let h=(0,l.useMemo)(()=>p?new d(e,e=>{let t=m.current;if(!t.notebook||!t.update)return;let n=t.notebook.metadata.widgets;if(JSON.stringify(n?.[`application/vnd.jupyter.widget-state+json`])===JSON.stringify(e))return;let r={...t.notebook,metadata:{...t.notebook.metadata,widgets:{...n,"application/vnd.jupyter.widget-state+json":e}}};JSON.stringify(r).length<=5*1024*1024?(f(void 0),t.update(r)):f(`Widget state is too large to save with this notebook.`)}):null,[p,e]);return(0,l.useEffect)(()=>(h?.start(),()=>h?.stop()),[h]),{session:h,saved:(0,l.useMemo)(()=>{let e=t?.metadata.widgets,n=r.safeParse(e?.[`application/vnd.jupyter.widget-state+json`]);return n.success&&!i()?n.data:void 0},[t?.metadata.widgets]),saveWarning:u}}export{p as n,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{t as r}from"./utils-B6KiDbIe.js";var i=e(t(),1),a=n(),o=(0,i.createContext)(null);function s({children:e}){let t=(0,i.useRef)(new Map);return(0,a.jsx)(o.Provider,{value:t.current,children:e})}function c(e,t){let n=(0,i.useId)(),r=(0,i.useContext)(o),a=(0,i.useRef)(new Map),s=t&&r?r:a.current,c=t??n,l=(0,i.useRef)(null),u=(0,i.useRef)(null);return(0,i.useLayoutEffect)(()=>{let t=l.current,n=u.current;if(!t||!n)return;let r=s.get(c);r&&r.vertical===e&&(n.hidden=!1,n.style.transition=`none`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`,n.style.transform=`translate(${r.x}px, ${r.y}px)`,n.offsetWidth,n.style.transition=``);let i=!!r&&r.vertical===e,a=()=>[...t.querySelectorAll(`:scope > button`)],o=null,d=!1,f=e=>{t.toggleAttribute(`data-sliding-selection`,!!e),n.hidden=!e;for(let t of a())t.toggleAttribute(`data-selection-highlight`,t===e);e&&(i||(n.style.transition=`none`),n.style.width=`${e.offsetWidth}px`,n.style.height=`${e.offsetHeight}px`,n.style.transform=`translate(${e.offsetLeft}px, ${e.offsetTop}px)`,i||=(n.offsetWidth,n.style.transition=``,!0))},p=()=>f(o?.target??a().find(e=>e.getAttribute(`aria-current`)===`page`)),m=new MutationObserver(p);m.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-current`]});let h=new ResizeObserver(p);h.observe(t),p();let g=new AbortController,_={signal:g.signal};t.addEventListener(`pointerdown`,t=>{if(t.button!==0)return;let n=t.target.closest(`button`);!(n instanceof HTMLButtonElement)||n.getAttribute(`aria-current`)!==`page`||(o={id:t.pointerId,start:e?t.clientY:t.clientX,moved:!1,target:n})},_),document.addEventListener(`pointermove`,n=>{if(!o||o.id!==n.pointerId)return;let r=e?n.clientY:n.clientX;if(!o.moved&&Math.abs(r-o.start)<4)return;o.moved=!0,t.setAttribute(`data-dragging-selection`,``),t.setPointerCapture(n.pointerId);let i=a().filter(e=>!e.disabled&&e.hasAttribute(`data-tray-slot`));o.target=i.reduce((t,n)=>{let i=t=>{let n=t.getBoundingClientRect();return Math.abs(r-(e?n.top+n.height/2:n.left+n.width/2))};return i(n)<i(t)?n:t},o.target),f(o.target)},_);let v=e=>{if(!o||o.id!==e.pointerId)return;let{target:n,moved:r}=o;o=null,t.removeAttribute(`data-dragging-selection`),t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),r&&e.type===`pointerup`&&(d=!0,n.click()),p()};return document.addEventListener(`pointerup`,v,_),document.addEventListener(`pointercancel`,v,_),t.addEventListener(`click`,e=>{!d||!e.isTrusted||(d=!1,e.preventDefault(),e.stopImmediatePropagation())},{..._,capture:!0}),()=>{if(!n.hidden){let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();s.set(c,{x:(i.left-r.left)/(r.width/t.offsetWidth||1),y:(i.top-r.top)/(r.height/t.offsetHeight||1),width:i.width/(r.width/t.offsetWidth||1),height:i.height/(r.height/t.offsetHeight||1),vertical:e})}g.abort(),m.disconnect(),h.disconnect()}},[e,c,s]),{trayRef:l,markerRef:u,motionKey:c}}function l(e,{selector:t=`button`,direct:n=!0}={}){let r=(0,i.useRef)(null);return(0,i.useLayoutEffect)(()=>{let i=e.current,a=r.current;if(!i||!a)return;let o=!1,s=null,c=null,l=null,u=new ResizeObserver(()=>f());u.observe(i);let d=e=>{let r=e instanceof Element?e.closest(t):null;if(!r||!i.contains(r)||n&&r.parentElement!==i||r.matches(`:disabled`)){a.style.opacity=`0`;return}l!==r&&(l&&u.unobserve(l),l=r,u.observe(r));let s=i.getBoundingClientRect(),c=r.getBoundingClientRect(),d=s.width/i.offsetWidth||1,f=s.height/i.offsetHeight||1;o||(a.style.transition=`none`),a.style.width=`${c.width/d}px`,a.style.height=`${c.height/f}px`,a.style.transform=`translate(${(c.left-s.left)/d+i.scrollLeft}px, ${(c.top-s.top)/f+i.scrollTop}px)`,a.style.borderRadius=getComputedStyle(r).borderRadius;let p=r.matches(`[aria-current="page"], [aria-selected="true"], [aria-pressed="true"], [data-state="open"], [data-session-active="true"]`);a.style.opacity=p?`0`:`1`,o||=(a.offsetWidth,a.style.transition=``,!0)},f=()=>d(s??(i.contains(document.activeElement)?document.activeElement:null)),p=new AbortController,m={signal:p.signal};i.addEventListener(`pointermove`,e=>{c={x:e.clientX,y:e.clientY}},m),i.addEventListener(`pointerover`,e=>{s=e.target,c={x:e.clientX,y:e.clientY},f()},m),i.addEventListener(`pointerleave`,()=>{s=null,c=null,f()},m),i.addEventListener(`focusin`,f,m),i.addEventListener(`focusout`,e=>d(e.relatedTarget),m),i.addEventListener(`scroll`,()=>{c&&(s=document.elementFromPoint(c.x,c.y)),f()},m);let h=new MutationObserver(f);return h.observe(i,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-current`,`aria-selected`,`aria-pressed`,`data-state`,`data-session-active`,`disabled`]}),()=>{p.abort(),h.disconnect(),u.disconnect()}},[e,t,n]),r}function u(e){return l(e)}function d({label:e,motionId:t,vertical:n=!1,variant:i=`actions`,className:o,children:s}){let{trayRef:l,markerRef:d,motionKey:f}=c(n,t),p=u(l);return(0,a.jsxs)(`div`,{ref:l,role:`group`,"data-variant":i,"aria-label":e,className:r(`control-tray sliding-hover-tray relative`,i!==`actions`&&`island-outline`,n&&`control-tray-vertical`,o),children:[(0,a.jsx)(`span`,{ref:d,hidden:!0,"aria-hidden":!0,"data-sidebar-motion":`tray-selection-${f}`,className:`control-tray-selection`}),(0,a.jsx)(`span`,{ref:p,"aria-hidden":!0,className:`tray-hover-surface`}),s]})}export{s as i,l as n,u as r,d as t};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{t as i}from"./utils-B6KiDbIe.js";import{o as a,r as o,t as s}from"./x-CbfJFzGo.js";var c=e(t(),1);typeof window<`u`&&window.document&&window.document.createElement;function l(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var u=r();function d(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,u.jsx)(s.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:l=!1}=s,u=o?.[e]?.[a]||i,d=c.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>c.createContext(e));return function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,f(i,...t)]}function f(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var p=e(n(),1),m=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=o(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function h(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}function g(e){let t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}var _=`DismissableLayer`,v=`dismissableLayer.update`,y=`dismissableLayer.pointerDownOutside`,b=`dismissableLayer.focusOutside`,ee,x=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),S=c.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:d,onDismiss:f,...p}=e,h=c.useContext(x),[_,y]=c.useState(null),b=_?.ownerDocument??globalThis?.document,[,S]=c.useState({}),C=a(t,y),w=Array.from(h.layers),[te]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),ne=te?w.indexOf(te):-1,T=_?w.indexOf(_):-1,E=h.layersWithOutsidePointerEventsDisabled.size>0,D=T>=ne,oe=c.useRef(!1),O=re(e=>{o?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:b,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:oe,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:c.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...h.branches].some(t=>t.contains(e));return D&&!t},[h.branches,D])}),se=ie(e=>{if(r&&oe.current)return;let t=e.target;[...h.branches].some(e=>e.contains(t))||(s?.(e),d?.(e),e.defaultPrevented||f?.())},b),k=_?T===w.length-1:!1,A=g(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return c.useEffect(()=>{if(k)return b.addEventListener(`keydown`,A,{capture:!0}),()=>b.removeEventListener(`keydown`,A,{capture:!0})},[b,k,A]),c.useEffect(()=>{if(_)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(ee=b.body.style.pointerEvents,b.body.style.pointerEvents=`none`),h.layersWithOutsidePointerEventsDisabled.add(_)),h.layers.add(_),ae(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(_),h.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=ee))}},[_,b,n,h]),c.useEffect(()=>()=>{_&&(h.layers.delete(_),h.layersWithOutsidePointerEventsDisabled.delete(_),ae())},[_,h]),c.useEffect(()=>{let e=()=>S({});return document.addEventListener(v,e),()=>document.removeEventListener(v,e)},[]),(0,u.jsx)(m.div,{...p,ref:C,style:{pointerEvents:E?D?`auto`:`none`:void 0,...e.style},onFocusCapture:l(e.onFocusCapture,se.onFocusCapture),onBlurCapture:l(e.onBlurCapture,se.onBlurCapture),onPointerDownCapture:l(e.onPointerDownCapture,O.onPointerDownCapture)})});S.displayName=_;var C=`DismissableLayerBranch`,w=c.forwardRef((e,t)=>{let n=c.useContext(x),r=c.useRef(null),i=a(t,r);return c.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,u.jsx)(m.div,{...e,ref:i})});w.displayName=C;function te(){let e=c.useContext(x),[t,n]=c.useState(null);return c.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ne=()=>!0;function re(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ne}=t,s=g(e),l=c.useRef(!1),u=c.useRef(!1),d=c.useRef(new Map),f=c.useRef(()=>{});return c.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function c(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let c=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||T(y,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?c():(n.removeEventListener(`click`,f.current),f.current=c,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,c,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,c,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>l.current=!0}}function ie(e,t=globalThis?.document){let n=g(e),r=c.useRef(!1);return c.useEffect(()=>{let e=e=>{e.target&&!r.current&&T(b,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ae(){let e=new CustomEvent(v);document.dispatchEvent(e)}function T(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?h(i,a):i.dispatchEvent(a)}var E=globalThis?.document?c.useLayoutEffect:()=>{},D=c.useId||(()=>void 0),oe=0;function O(e){let[t,n]=c.useState(D());return E(()=>{e||n(e=>e??String(oe++))},[e]),e||(t?`radix-${t}`:``)}var se=`Portal`,k=c.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=c.useState(!1);E(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?p.createPortal((0,u.jsx)(m.div,{...r,ref:t}),o):null});k.displayName=se;function A(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}var j=e=>{let{present:t,children:n}=e,r=ce(t),i=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),a=ue(r.ref,de(i));return typeof n==`function`||r.isPresent?c.cloneElement(i,{ref:a}):null};j.displayName=`Presence`;function ce(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),o=c.useRef(void 0),[s,l]=A(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{s===`mounted`?(a.current=o.current??M(r.current),o.current=void 0):a.current=`none`},[s]),E(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=M(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),E(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=M(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=M(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:c.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=M(t)}else r.current=null;n(e)},[])}}function le(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ue(...e){let t=c.useRef(e);return t.current=e,c.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=le(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():le(n[e],null)}}},[])}function M(e){return e?.animationName||`none`}function de(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fe=c.useInsertionEffect||E;function pe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=me({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{let t=c.useRef(e!==void 0);c.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[l,c.useCallback(t=>{if(s){let n=he(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function me({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return fe(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function he(e){return typeof e==`function`}var N=0,P=null;function ge(){c.useEffect(()=>{P||={start:_e(),end:_e()};let{start:e,end:t}=P;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),N++,()=>{N===1&&(P?.start.remove(),P?.end.remove(),P=null),N=Math.max(0,N-1)}},[])}function _e(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var ve=`focusScope.autoFocusOnMount`,F=`focusScope.autoFocusOnUnmount`,ye={bubbles:!1,cancelable:!0},be=`FocusScope`,xe=c.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[l,d]=c.useState(null),f=g(i),p=g(o),h=c.useRef(null),_=a(t,d),v=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(v.paused||!l)return;let t=e.target;l.contains(t)?h.current=t:I(h.current,{select:!0})},t=function(e){if(v.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||I(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&I(l)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,v.paused]),c.useEffect(()=>{if(l){Oe.add(v);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(ve,ye);l.addEventListener(ve,f),l.dispatchEvent(t),t.defaultPrevented||(Se(je(we(l)),{select:!0}),document.activeElement===e&&I(l))}return()=>{l.removeEventListener(ve,f),setTimeout(()=>{let t=new CustomEvent(F,ye);l.addEventListener(F,p),l.dispatchEvent(t),t.defaultPrevented||I(e??document.body,{select:!0}),l.removeEventListener(F,p),Oe.remove(v)},0)}}},[l,f,p,v]);let y=c.useCallback(e=>{if(!n&&!r||v.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ce(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&I(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&I(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,v.paused]);return(0,u.jsx)(m.div,{tabIndex:-1,...s,ref:_,onKeyDown:y})});xe.displayName=be;function Se(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(I(r,{select:t}),document.activeElement!==n)return}function Ce(e){let t=we(e);return[Te(t,e),Te(t.reverse(),e)]}function we(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Te(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ee(r,{upTo:t})))return r}function Ee(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function De(e){return e instanceof HTMLInputElement&&`select`in e}function I(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&De(e)&&t&&e.select()}}var Oe=ke();function ke(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ae(e,t),e.unshift(t)},remove(t){e=Ae(e,t),e[0]?.resume()}}}function Ae(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function je(e){return e.filter(e=>e.tagName!==`A`)}var Me=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},L=new WeakMap,R=new WeakMap,z={},Ne=0,Pe=function(e){return e&&(e.host||Pe(e.parentNode))},Fe=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Pe(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ie=function(e,t,n,r){var i=Fe(t,Array.isArray(e)?e:[e]);z[n]||(z[n]=new WeakMap);var a=z[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(L.get(e)||0)+1,l=(a.get(e)||0)+1;L.set(e,c),a.set(e,l),o.push(e),c===1&&i&&R.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ne++,function(){o.forEach(function(e){var t=L.get(e)-1,i=a.get(e)-1;L.set(e,t),a.set(e,i),t||(R.has(e)||e.removeAttribute(r),R.delete(e)),i||e.removeAttribute(n)}),Ne--,Ne||(L=new WeakMap,L=new WeakMap,R=new WeakMap,z={})}},Le=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Me(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ie(r,i,n,`aria-hidden`)):function(){return null}},B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},B.apply(this,arguments)};function Re(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ze(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var V=`right-scroll-bar-position`,H=`width-before-scroll-bar`,Be=`with-scroll-bars-hidden`,Ve=`--removed-body-scroll-bar-size`;function He(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ue(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var We=typeof window<`u`?c.useLayoutEffect:c.useEffect,Ge=new WeakMap;function Ke(e,t){var n=Ue(t||null,function(t){return e.forEach(function(e){return He(e,t)})});return We(function(){var t=Ge.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||He(e,null)}),i.forEach(function(e){r.has(e)||He(e,a)})}Ge.set(n,e)},[e]),n}function qe(e){return e}function Je(e,t){t===void 0&&(t=qe);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ye(e){e===void 0&&(e={});var t=Je(null);return t.options=B({async:!0,ssr:!1},e),t}var Xe=function(e){var t=e.sideCar,n=Re(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,B({},n))};Xe.isSideCarExport=!0;function Ze(e,t){return e.useMedium(t),Xe}var Qe=Ye(),$e=function(){},U=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:$e,onWheelCapture:$e,onTouchMoveCapture:$e}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,ee=Re(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=p,S=Ke([n,t]),C=B(B({},ee),i);return c.createElement(c.Fragment,null,d&&c.createElement(x,{sideCar:Qe,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),B(B({},C),{ref:S})):c.createElement(y,B({},C,{className:l,ref:S}),s))});U.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},U.classNames={fullWidth:H,zeroRight:V};var et,tt=function(){if(et)return et;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function nt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=tt();return t&&e.setAttribute(`nonce`,t),e}function rt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function it(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var at=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nt())&&(rt(t,n),it(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ot=function(){var e=at();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},st=function(){var e=ot();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ct={left:0,top:0,right:0,gap:0},lt=function(e){return parseInt(e||``,10)||0},ut=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[lt(n),lt(r),lt(i)]},dt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ct;var t=ut(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ft=st(),W=`data-scroll-locked`,pt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${Be} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${W}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${V} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${H} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${V} .${V} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${H} .${H} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${W}] {
|
|
36
|
+
${Ve}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},mt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ht=function(){c.useEffect(function(){return document.body.setAttribute(W,(mt()+1).toString()),function(){var e=mt()-1;e<=0?document.body.removeAttribute(W):document.body.setAttribute(W,e.toString())}},[])},gt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ht();var a=c.useMemo(function(){return dt(i)},[i]);return c.createElement(ft,{styles:pt(a,!t,i,n?``:`!important`)})},_t=!1;if(typeof window<`u`)try{var G=Object.defineProperty({},"passive",{get:function(){return _t=!0,!0}});window.addEventListener(`test`,G,G),window.removeEventListener(`test`,G,G)}catch{_t=!1}var K=_t?{passive:!1}:!1,vt=function(e){return e.tagName===`TEXTAREA`},yt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!vt(e)&&n[t]===`visible`)},bt=function(e){return yt(e,`overflowY`)},xt=function(e){return yt(e,`overflowX`)},St=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Tt(e,r)){var i=Et(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ct=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},wt=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Tt=function(e,t){return e===`v`?bt(t):xt(t)},Et=function(e,t){return e===`v`?Ct(t):wt(t)},Dt=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ot=function(e,t,n,r,i){var a=Dt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Et(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Tt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},q=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kt=function(e){return[e.deltaX,e.deltaY]},At=function(e){return e&&`current`in e?e.current:e},jt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Mt=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},Nt=0,J=[];function Pt(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),i=c.useState(Nt++)[0],a=c.useState(st)[0],o=c.useRef(e);c.useEffect(function(){o.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ze([e.lockRef.current],(e.shards||[]).map(At),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=q(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=St(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=St(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ot(h,t,e,h===`h`?s:c,!0)},[]),l=c.useCallback(function(e){var n=e;if(!(!J.length||J[J.length-1]!==a)){var r=`deltaY`in n?kt(n):q(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&jt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(At).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=c.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ft(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=c.useCallback(function(e){n.current=q(e),r.current=void 0},[]),f=c.useCallback(function(t){u(t.type,kt(t),t.target,s(t,e.lockRef.current))},[]),p=c.useCallback(function(t){u(t.type,q(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return J.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,K),document.addEventListener(`touchmove`,l,K),document.addEventListener(`touchstart`,d,K),function(){J=J.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,K),document.removeEventListener(`touchmove`,l,K),document.removeEventListener(`touchstart`,d,K)}},[]);var m=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:Mt(i)}):null,m?c.createElement(gt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ft(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var It=Ze(Qe,Pt),Lt=c.forwardRef(function(e,t){return c.createElement(U,B({},e,{ref:t,sideCar:It}))});Lt.classNames=U.classNames;var Y=`Dialog`,[Rt,zt]=d(Y),[Bt,X]=Rt(Y),Vt=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=c.useRef(null),l=c.useRef(null),[d,f]=pe({prop:r,defaultProp:i??!1,onChange:a,caller:Y});return(0,u.jsx)(Bt,{scope:t,triggerRef:s,contentRef:l,contentId:O(),titleId:O(),descriptionId:O(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(e=>!e),[f]),modal:o,children:n})};Vt.displayName=Y;var Ht=`DialogTrigger`,Ut=c.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Ht,n),o=a(t,i.triggerRef);return(0,u.jsx)(m.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":sn(i.open),...r,ref:o,onClick:l(e.onClick,i.onOpenToggle)})});Ut.displayName=Ht;var Wt=`DialogPortal`,[Gt,Kt]=Rt(Wt,{forceMount:void 0}),qt=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=X(Wt,t);return(0,u.jsx)(Gt,{scope:t,forceMount:n,children:c.Children.map(r,e=>(0,u.jsx)(j,{present:n||a.open,children:(0,u.jsx)(k,{asChild:!0,container:i,children:e})}))})};qt.displayName=Wt;var Z=`DialogOverlay`,Q=c.forwardRef((e,t)=>{let n=Kt(Z,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X(Z,e.__scopeDialog);return a.modal?(0,u.jsx)(j,{present:r||a.open,children:(0,u.jsx)(Yt,{...i,ref:t})}):null});Q.displayName=Z;var Jt=o(`DialogOverlay.RemoveScroll`),Yt=c.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Z,n),o=a(t,te());return(0,u.jsx)(Lt,{as:Jt,allowPinchZoom:!0,shards:[i.contentRef],children:(0,u.jsx)(m.div,{"data-state":sn(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})}),$=`DialogContent`,Xt=c.forwardRef((e,t)=>{let n=Kt($,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X($,e.__scopeDialog);return(0,u.jsx)(j,{present:r||a.open,children:a.modal?(0,u.jsx)(Zt,{...i,ref:t}):(0,u.jsx)(Qt,{...i,ref:t})})});Xt.displayName=$;var Zt=c.forwardRef((e,t)=>{let n=X($,e.__scopeDialog),r=c.useRef(null),i=a(t,n.contentRef,r);return c.useEffect(()=>{let e=r.current;if(e)return Le(e)},[]),(0,u.jsx)($t,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:l(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault())})}),Qt=c.forwardRef((e,t)=>{let n=X($,e.__scopeDialog),r=c.useRef(!1),i=c.useRef(!1);return(0,u.jsx)($t,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),$t=c.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=X($,n);return ge(),(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(xe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,u.jsx)(S,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":sn(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),en=`DialogTitle`,tn=c.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(en,n);return(0,u.jsx)(m.h2,{id:i.titleId,...r,ref:t})});tn.displayName=en;var nn=`DialogDescription`,rn=c.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(nn,n);return(0,u.jsx)(m.p,{id:i.descriptionId,...r,ref:t})});rn.displayName=nn;var an=`DialogClose`,on=c.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(an,n);return(0,u.jsx)(m.button,{type:`button`,...r,ref:t,onClick:l(e.onClick,()=>i.onOpenChange(!1))})});on.displayName=an;function sn(e){return e?`open`:`closed`}var cn=Vt,ln=on;function un({className:e,children:t,wide:n=!1,surface:r=!0,showCloseButton:a=!0,...o}){return(0,u.jsxs)(qt,{children:[(0,u.jsx)(Q,{className:`overlay-backdrop-motion fixed inset-0 z-50 bg-ground/70 backdrop-blur-[2px]`}),(0,u.jsxs)(Xt,{className:i(`overlay-content-motion fixed left-1/2 top-[calc(var(--phone-top,0px)+var(--phone-height,100dvh)/2)] z-50 grid max-h-[calc(var(--phone-height,100dvh)-2rem)] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-[var(--ui-surface-radius)] p-5`,r&&`island-outline bg-surface shadow-[var(--ui-overlay-shadow)]`,n?`max-w-3xl`:`max-w-md`,e),...o,children:[t,a&&(0,u.jsxs)(on,{className:`absolute right-3.5 top-3.5 rounded-sm text-fg-muted transition-colors hover:text-fg`,children:[(0,u.jsx)(s,{className:`size-4`}),(0,u.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function dn({className:e,...t}){return(0,u.jsx)(`div`,{className:i(`flex flex-col gap-1`,e),...t})}function fn({className:e,...t}){return(0,u.jsx)(tn,{className:i(`text-lg font-semibold text-fg`,e),...t})}function pn({className:e,...t}){return(0,u.jsx)(rn,{className:i(`text-sm text-fg-secondary`,e),...t})}function mn({className:e,...t}){return(0,u.jsx)(`div`,{className:i(`flex justify-end gap-2`,e),...t})}export{m as C,l as E,g as S,d as T,j as _,mn as a,E as b,Vt as c,qt as d,Lt as f,pe as g,ge as h,pn as i,Xt as l,xe as m,ln as n,dn as o,Le as p,un as r,fn as s,cn as t,Q as u,k as v,h as w,S as x,O as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-
|
|
1
|
+
import{t as e}from"./jsx-runtime-ffCh33zF.js";import{t}from"./utils-B6KiDbIe.js";import{t as n}from"./chevron-right-6pjfw_yV.js";import{t as r}from"./createLucideIcon-DyMAgLa3.js";var i=r(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),a=e();function o({summary:e,summaryClassName:r,className:i,children:o,...s}){return(0,a.jsxs)(`details`,{className:t(`[&[open]>summary>svg]:rotate-90`,i),...s,children:[(0,a.jsxs)(`summary`,{className:t(`flex cursor-pointer select-none list-none items-center gap-1 text-fg-secondary transition-colors hover:text-fg [&::-webkit-details-marker]:hidden`,r),children:[(0,a.jsx)(n,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),e]}),o]})}export{i as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{C as i,S as a,T as o,b as s}from"./dialog-DfdBRe6G.js";import{o as c,r as l}from"./x-CbfJFzGo.js";var u=e(t(),1),d=[`top`,`right`,`bottom`,`left`],f=Math.min,p=Math.max,m=Math.round,h=Math.floor,g=e=>({x:e,y:e}),_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function v(e,t,n){return p(e,f(t,n))}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return e.split(`-`)[0]}function x(e){return e.split(`-`)[1]}function S(e){return e===`x`?`y`:`x`}function C(e){return e===`y`?`height`:`width`}function w(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function T(e){return S(w(e))}function E(e,t,n){n===void 0&&(n=!1);let r=x(e),i=T(e),a=C(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=F(o)),[o,F(o)]}function D(e){let t=F(e);return[O(e),t,O(t)]}function O(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var k=[`left`,`right`],A=[`right`,`left`],j=[`top`,`bottom`],M=[`bottom`,`top`];function N(e,t,n){switch(e){case`top`:case`bottom`:return n?t?A:k:t?k:A;case`left`:case`right`:return t?j:M;default:return[]}}function P(e,t,n,r){let i=x(e),a=N(b(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(O)))),a}function F(e){let t=b(e);return _[t]+e.slice(t.length)}function I(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function L(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:I(e)}function R(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function z(e,t,n){let{reference:r,floating:i}=e,a=w(t),o=T(t),s=C(o),c=b(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=x(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function B(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=y(t,e),p=L(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=R(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=R(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/v.y,bottom:(b.bottom-h.bottom+p.bottom)/v.y,left:(h.left-b.left+p.left)/v.x,right:(b.right-h.right+p.right)/v.x}}var ee=50,te=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:B},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=z(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ee&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=z(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ne=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=y(e,t)||{};if(l==null)return{};let d=L(u),p={x:n,y:r},m=T(i),h=C(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,w=_?`clientHeight`:`clientWidth`,E=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[w]||a.floating[h]);let A=E/2-D/2,j=k/2-g[h]/2-1,M=f(d[b],j),N=f(d[S],j),P=k-g[h]-N,F=k/2-g[h]/2+A,I=v(M,F,P),R=!c.arrow&&x(i)!=null&&F!==I&&a.reference[h]/2-(F<M?M:N)-g[h]/2<0,z=R?F<M?F-M:F-P:0;return{[m]:p[m]+z,data:{[m]:I,centerOffset:F-I-z,...R&&{alignmentOffset:z}},reset:R}}}),re=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=b(r),_=w(o),v=b(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[F(o)]:D(o)),C=p!==`none`;!d&&C&&S.push(...P(o,m,p,x));let T=[o,...S],O=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(O[g]),u){let e=E(r,a,x);k.push(O[e[0]],O[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=T[e];if(t&&(!(u===`alignment`&&_!==w(t))||A.every(e=>w(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=w(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ie(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ae(e){return d.some(t=>e[t]>=0)}var oe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=y(e,t);switch(i){case`referenceHidden`:{let e=ie(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ae(e)}}}case`escaped`:{let e=ie(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ae(e)}}}default:return{}}}}},se=new Set([`left`,`top`]);async function ce(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=b(n),s=x(n),c=w(n)===`y`,l=se.has(o)?-1:1,u=a&&c?-1:1,d=y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var le=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ce(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ue=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=w(i),p=S(f),m=u[p],h=u[f],g=(e,t)=>v(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},de=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=y(e,t),u={x:n,y:r},d=w(i),f=S(d),p=u[f],m=u[d],h=y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=se.has(b(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},fe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=y(e,t),c=await i.detectOverflow(t,s),l=b(n),u=x(n),d=w(n)===`y`,{width:m,height:h}=r.floating,g,_;l===`top`||l===`bottom`?(g=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,g=u===`end`?`top`:`bottom`);let v=h-c.top-c.bottom,S=m-c.left-c.right,C=f(h-c[g],v),T=f(m-c[_],S),E=t.middlewareData.shift,D=!E,O=C,k=T;E!=null&&E.enabled.x&&(k=S),E!=null&&E.enabled.y&&(O=v),D&&!u&&(d?k=m-2*p(c.left,c.right):O=h-2*p(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return m!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function pe(){return typeof window<`u`}function V(e){return me(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((me(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function me(e){return pe()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return pe()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return pe()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function he(e){return!pe()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function ge(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _e(e){return/^(table|td|th)$/.test(V(e))}function ve(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ye=/transform|translate|scale|rotate|perspective|filter/,be=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,xe;function Se(e){let t=W(e)?J(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!we()&&(K(t.backdropFilter)||K(t.filter))||ye.test(t.willChange||``)||be.test(t.contain||``)}function Ce(e){let t=Y(e);for(;G(t)&&!q(t);){if(Se(t))return t;if(ve(t))return null;t=Y(t)}return null}function we(){return xe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xe}function q(e){return/^(html|body|#document)$/.test(V(e))}function J(e){return H(e).getComputedStyle(e)}function Te(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(V(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||he(e)&&e.host||U(e);return he(t)?t.host:t}function Ee(e){let t=Y(e);return q(t)?(e.ownerDocument||e).body:G(t)&&ge(t)?t:Ee(t)}function X(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ee(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=De(a);return t.concat(a,a.visualViewport||[],ge(r)?r:[],e&&n?X(e):[])}else return t.concat(r,X(r,[],n))}function De(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Oe(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=m(n)!==a||m(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ke(e){return W(e)?e:e.contextElement}function Z(e){let t=ke(e);if(!G(t))return g(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Oe(t),o=(a?m(n.width):n.width)/r,s=(a?m(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ae=g(0);function je(e){let t=H(e);return!we()||!t.visualViewport?Ae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Me(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ke(e),o=g(1);t&&(r?W(r)&&(o=Z(r)):o=Z(e));let s=Me(a,n,r)?je(a):g(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=W(r)?H(r):r,n=e,i=De(n);for(;i&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=De(n)}}return R({width:u,height:d,x:c,y:l})}function Ne(e,t){let n=Te(e).scrollLeft;return t?t.left+n:Q(U(e)).left+n}function Pe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ne(e,n),y:n.top+t.scrollTop}}function Fe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?ve(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=g(1),u=g(0),d=G(r);if((d||!a)&&((V(r)!==`body`||ge(o))&&(c=Te(r)),d)){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Pe(o,c):g(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ie(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Le(e){let t=Te(e),n=e.ownerDocument.body,r=p(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=p(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ne(e),o=-t.scrollTop;return J(n).direction===`rtl`&&(a+=p(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Re=25;function ze(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!we()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ne(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Re&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Be(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Z(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ve(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ze(e,n,t);else if(t===`document`)r=Le(U(e));else if(W(t))r=Be(t,n);else{let n=je(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return R(r)}function He(e,t){let n=t.get(e);if(n)return n;let r=X(e,[],!1).filter(e=>W(e)&&V(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;W(o)&&!q(o);){let e=J(o),t=Se(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Y(o)}return t.set(e,r),r}function Ue(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ve(t)?[]:He(t,this._c):[].concat(n),r],o=Ve(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ve(t,a[e],i);s=p(n.top,s),c=f(n.right,c),l=f(n.bottom,l),u=p(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function We(e){let{width:t,height:n}=Oe(e);return{width:t,height:n}}function Ge(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=g(0);if((r||!a)&&((V(t)!==`body`||ge(i))&&(s=Te(t)),r)){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ne(i));let l=i&&!r&&!a?Pe(i,s):g(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ke(e){return J(e).position===`static`}function qe(e,t){if(!G(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function Je(e,t){let n=H(e);if(ve(e))return n;if(!G(e)){let t=Y(e);for(;t&&!q(t);){if(W(t)&&!Ke(t))return t;t=Y(t)}return n}let r=qe(e,t);for(;r&&_e(r)&&Ke(r);)r=qe(r,t);return r&&q(r)&&Ke(r)&&!Se(r)?n:r||Ce(e)||n}var Ye=async function(e){let t=this.getOffsetParent||Je,n=this.getDimensions,r=await n(e.floating);return{reference:Ge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xe(e){return J(e).direction===`rtl`}var Ze={convertOffsetParentRelativeRectToViewportRelativeRect:Fe,getDocumentElement:U,getClippingRect:Ue,getOffsetParent:Je,getElementRects:Ye,getClientRects:Ie,getDimensions:We,getScale:Z,isElement:W,isRTL:Xe};function Qe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $e(e,t,n){let r=null,i,a=U(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:m,height:g}=l;if(n||t(),!m||!g)return;let _=h(d),v=h(a.clientWidth-(u+m)),y=h(a.clientHeight-(d+g)),b=h(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:p(0,f(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(!Qe(l,e.getBoundingClientRect()))return s();if(n!==c){if(!S)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function et(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ke(e),u=i||a?[...l?X(l):[],...t?X(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?$e(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!Qe(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var tt=le,nt=ue,rt=re,it=fe,at=oe,ot=ne,st=de,ct=(e,t,n)=>{let r=new Map,i=n??{},a={...Ze,...i.platform,_c:r};return te(e,t,{...i,platform:a})},lt=e(n(),1),ut=typeof document<`u`?u.useLayoutEffect:function(){};function dt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!dt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!dt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ft(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pt(e,t){let n=ft(e);return Math.round(t*n)/n}function mt(e){let t=u.useRef(e);return ut(()=>{t.current=e}),t}function ht(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(r);dt(p,r)||m(r);let[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=u.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=u.useRef(null),w=u.useRef(null),T=u.useRef(d),E=c!=null,D=mt(c),O=mt(i),k=mt(l),A=u.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),ct(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!dt(T.current,t)&&(T.current=t,lt.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);ut(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=u.useRef(!1);ut(()=>(j.current=!0,()=>{j.current=!1}),[]),ut(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=u.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=u.useMemo(()=>({reference:x,floating:S}),[x,S]),P=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=pt(N.floating,d.x),r=pt(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ft(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var gt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ot({element:r.current,padding:i}).fn(n):r?ot({element:r,padding:i}).fn(n):{}}}},_t=(e,t)=>{let n=tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},vt=(e,t)=>{let n=nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},yt=(e,t)=>({fn:st(e).fn,options:[e,t]}),bt=(e,t)=>{let n=rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>{let n=gt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),wt=`Arrow`,Tt=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:a=5,...o}=e;return(0,$.jsx)(i.svg,{...o,ref:t,width:r,height:a,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Tt.displayName=wt;var Et=Tt;function Dt(e){let[t,n]=u.useState(void 0);return s(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Ot=`Popper`,[kt,At]=o(Ot),[jt,Mt]=kt(Ot),Nt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null),[a,o]=u.useState(void 0);return(0,$.jsx)(jt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Nt.displayName=Ot;var Pt=`PopperAnchor`,Ft=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...a}=e,o=Mt(Pt,n),s=u.useRef(null),l=o.onAnchorChange,d=c(t,u.useCallback(e=>{s.current=e,e&&l(e)},[l])),f=u.useRef(null);u.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&l(f.current)});let p=o.placementState&&Gt(o.placementState),m=p?.[0],h=p?.[1];return r?null:(0,$.jsx)(i.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...a,ref:d})});Ft.displayName=Pt;var It=`PopperContent`,[Lt,Rt]=kt(It),zt=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:o=0,align:l=`center`,alignOffset:d=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:g=`partial`,hideWhenDetached:_=!1,updatePositionStrategy:v=`optimized`,onPlaced:y,...b}=e,x=Mt(It,n),[S,C]=u.useState(null),w=c(t,C),[T,E]=u.useState(null),D=Dt(T),O=D?.width??0,k=D?.height??0,A=r+(l===`center`?``:`-`+l),j=typeof h==`number`?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(m)?m:[m],N=M.length>0,P={padding:j,boundary:M.filter(Ut),altBoundary:N},{refs:F,floatingStyles:I,placement:L,isPositioned:R,middlewareData:z}=ht({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>et(...e,{animationFrame:v===`always`}),elements:{reference:x.anchor},middleware:[_t({mainAxis:o+k,alignmentAxis:d}),p&&vt({mainAxis:!0,crossAxis:!1,limiter:g===`partial`?yt():void 0,...P}),p&&bt({...P}),xt({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&Ct({element:T,padding:f}),Wt({arrowWidth:O,arrowHeight:k}),_&&St({strategy:`referenceHidden`,...P,boundary:N?P.boundary:void 0})]}),B=x.setPlacementState;s(()=>(B(L),()=>{B(void 0)}),[L,B]);let[ee,te]=Gt(L),ne=a(y);s(()=>{R&&ne?.()},[R,ne]);let re=z.arrow?.x,ie=z.arrow?.y,ae=z.arrow?.centerOffset!==0,[oe,se]=u.useState();return s(()=>{S&&se(window.getComputedStyle(S).zIndex)},[S]),(0,$.jsx)(`div`,{ref:F.setFloating,"data-radix-popper-content-wrapper":``,style:{...I,transform:R?I.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(Lt,{scope:n,placedSide:ee,placedAlign:te,onArrowChange:E,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,$.jsx)(i.div,{"data-side":ee,"data-align":te,...b,ref:w,style:{...b.style,animation:R?void 0:`none`}})})})});zt.displayName=It;var Bt=`PopperArrow`,Vt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ht=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Rt(Bt,n),a=Vt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(Et,{...r,ref:t,style:{...r.style,display:`block`}})})});Ht.displayName=Bt;function Ut(e){return e!==null}var Wt=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Gt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Gt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Kt=Nt,qt=Ft,Jt=zt,Yt=Ht,Xt=`rounded-[var(--ui-radius)] bg-border/50 text-sm text-fg placeholder:text-fg-muted transition-colors hover:bg-border/80 focus:bg-border/80 host-accent:bg-explorer-hover host-accent:hover:bg-explorer-selection/50 host-accent:focus:bg-explorer-selection/50 disabled:cursor-not-allowed disabled:opacity-50`,Zt=`relative flex cursor-pointer select-none items-center gap-2 rounded-[var(--ui-menu-radius)] px-2 py-1.5 text-sm text-fg outline-none transition-colors`,Qt=`data-[highlighted]:bg-action data-[highlighted]:text-action-ink data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,$t=`data-[selected=true]:bg-action data-[selected=true]:text-action-ink data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`,en=`overlay-surface rounded-[var(--ui-surface-radius)] bg-elevated`,tn=`overlay-content-motion`,nn=`${en} ${tn} p-1`,rn=`overlay-surface rounded-[var(--ui-radius)] bg-elevated`,an=`inline-flex size-[var(--ui-control-height)] shrink-0 cursor-pointer items-center justify-center rounded-[var(--ui-radius)] text-fg transition-colors hover:bg-elevated disabled:pointer-events-none disabled:opacity-50`,on=`cursor-pointer rounded-[var(--ui-menu-radius)] px-1 py-0.5 text-xs text-fg transition-colors hover:bg-elevated`;function sn(e){let t=e+`CollectionProvider`,[n,r]=o(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:n}=e,r=u.useRef(null),a=u.useRef(new Map).current;return(0,$.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};s.displayName=t;let d=e+`CollectionSlot`,f=l(d),p=u.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(t,a(d,n).collectionRef);return(0,$.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=`data-radix-collection-item`,g=l(m),_=u.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=u.useRef(null),s=c(t,o),l=a(m,n);return u.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,$.jsx)(g,{[h]:``,ref:s,children:r})});_.displayName=m;function v(t){let n=a(e+`CollectionConsumer`,t);return u.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:s,Slot:p,ItemSlot:_},v,r]}var cn=u.createContext(void 0);function ln(e){let t=u.useContext(cn);return e||t||`ltr`}export{At as _,Xt as a,Zt as c,en as d,on as f,Kt as g,Jt as h,rn as i,nn as l,Yt as m,sn as n,$t as o,qt as p,an as r,Qt as s,ln as t,tn as u,Dt as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-By8HlURe.js";import{C as r,E as i,S as a,T as o,_ as s,b as c,f as l,g as u,h as d,m as f,p,v as m,w as h,x as g,y as _}from"./dialog-CTN-Lln6.js";import{o as v,r as y}from"./x-CbfJFzGo.js";import{_ as b,g as x,h as S,m as C,n as w,p as T,t as E}from"./dist-NuV8HBEc.js";var D=e(t(),1),O=!1;function ee(){let[e,t]=D.useState(O);return D.useEffect(()=>{O||(O=!0,t(!0))},[]),e}var k=D.useSyncExternalStore;function A(){return()=>{}}function te(){return k(A,()=>!0,()=>!1)}var j=typeof k==`function`?te:ee,M=n(),N=`rovingFocusGroup.onEntryFocus`,ne={bubbles:!1,cancelable:!0},P=`RovingFocusGroup`,[F,I,re]=w(P),[ie,L]=o(P,[re]),[R,ae]=ie(P),oe=D.forwardRef((e,t)=>(0,M.jsx)(F.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,M.jsx)(F.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,M.jsx)(se,{...e,ref:t})})}));oe.displayName=P;var se=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:m=!1,...h}=e,g=D.useRef(null),_=v(t,g),y=E(c),[b,x]=u({prop:l,defaultProp:d??null,onChange:f,caller:P}),[S,C]=D.useState(!1),w=a(p),T=I(n),O=D.useRef(!1),[ee,k]=D.useState(0);return D.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(N,w),()=>e.removeEventListener(N,w)},[w]),(0,M.jsx)(R,{scope:n,orientation:o,dir:y,loop:s,currentTabStopId:b,onItemFocus:D.useCallback(e=>x(e),[x]),onItemShiftTab:D.useCallback(()=>C(!0),[]),onFocusableItemAdd:D.useCallback(()=>k(e=>e+1),[]),onFocusableItemRemove:D.useCallback(()=>k(e=>e-1),[]),children:(0,M.jsx)(r.div,{tabIndex:S||ee===0?-1:0,"data-orientation":o,...h,ref:_,style:{outline:`none`,...e.style},onMouseDown:i(e.onMouseDown,()=>{O.current=!0}),onFocus:i(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent(N,ne);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);pe([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),m)}}O.current=!1}),onBlur:i(e.onBlur,()=>C(!1))})})}),ce=`RovingFocusGroupItem`,le=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:s,children:l,...u}=e,d=_(),f=s||d,p=ae(ce,n),m=p.currentTabStopId===f,h=I(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:y}=p,b=j();return c(()=>{if(!(!b||!a))return g(),()=>v()},[b,a,g,v]),D.useEffect(()=>{if(!(b||!a))return g(),()=>v()},[b,a,g,v]),(0,M.jsx)(F.ItemSlot,{scope:n,id:f,focusable:a,active:o,children:(0,M.jsx)(r.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:i(e.onMouseDown,e=>{a?p.onItemFocus(f):e.preventDefault()}),onFocus:i(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:i(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=fe(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?me(n,r+1):n.slice(r+1)}setTimeout(()=>pe(n))}}),children:typeof l==`function`?l({isCurrentTabStop:m,hasTabStop:y!=null}):l})})});le.displayName=ce;var ue={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function de(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function fe(e,t,n){let r=de(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ue[r]}function pe(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function me(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var he=oe,ge=le,z=[`Enter`,` `],_e=[`ArrowDown`,`PageUp`,`Home`],ve=[`ArrowUp`,`PageDown`,`End`],ye=[..._e,...ve],be={ltr:[...z,`ArrowRight`],rtl:[...z,`ArrowLeft`]},xe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},B=`Menu`,[V,Se,Ce]=w(B),[H,we]=o(B,[Ce,b,L]),U=b(),Te=L(),[Ee,W]=H(B),[De,G]=H(B),Oe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,c=U(t),[l,u]=D.useState(null),d=D.useRef(!1),f=a(o),p=E(i);return D.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),D.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,M.jsx)(x,{...c,children:(0,M.jsx)(Ee,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,M.jsx)(De,{scope:t,onClose:D.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})};Oe.displayName=B;var ke=`MenuAnchor`,K=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=U(n);return(0,M.jsx)(T,{...i,...r,ref:t})});K.displayName=ke;var q=`MenuPortal`,[Ae,je]=H(q,{forceMount:void 0}),Me=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=W(q,t);return(0,M.jsx)(Ae,{scope:t,forceMount:n,children:(0,M.jsx)(s,{present:n||a.open,children:(0,M.jsx)(m,{asChild:!0,container:i,children:r})})})};Me.displayName=q;var J=`MenuContent`,[Ne,Pe]=H(J),Fe=D.forwardRef((e,t)=>{let n=je(J,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=W(J,e.__scopeMenu),o=G(J,e.__scopeMenu);return(0,M.jsx)(V.Provider,{scope:e.__scopeMenu,children:(0,M.jsx)(s,{present:r||a.open,children:(0,M.jsx)(V.Slot,{scope:e.__scopeMenu,children:o.modal?(0,M.jsx)(Ie,{...i,ref:t}):(0,M.jsx)(Le,{...i,ref:t})})})})}),Ie=D.forwardRef((e,t)=>{let n=W(J,e.__scopeMenu),r=D.useRef(null),a=v(t,r);return D.useEffect(()=>{let e=r.current;if(e)return p(e)},[]),(0,M.jsx)(ze,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:i(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Le=D.forwardRef((e,t)=>{let n=W(J,e.__scopeMenu);return(0,M.jsx)(ze,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Re=y(`MenuContent.ScrollLock`),ze=D.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:_,onDismiss:y,disableOutsideScroll:b,...x}=e,C=W(J,n),w=G(J,n),T=U(n),E=Te(n),O=Se(n),[ee,k]=D.useState(null),A=D.useRef(null),te=v(t,A,C.onContentChange),j=D.useRef(0),N=D.useRef(``),ne=D.useRef(0),P=D.useRef(null),F=D.useRef(`right`),I=D.useRef(0),re=b?l:D.Fragment,ie=b?{as:Re,allowPinchZoom:!0}:void 0,L=e=>{let t=N.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=yt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){N.current=t,window.clearTimeout(j.current),t!==``&&(j.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};D.useEffect(()=>()=>window.clearTimeout(j.current),[]),d();let R=D.useCallback(e=>F.current===P.current?.side&&xt(e,P.current?.area),[]);return(0,M.jsx)(Ne,{scope:n,searchRef:N,onItemEnter:D.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:D.useCallback(e=>{R(e)||(A.current?.focus(),k(null))},[R]),onTriggerLeave:D.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:D.useCallback(e=>{P.current=e},[]),children:(0,M.jsx)(re,{...ie,children:(0,M.jsx)(f,{asChild:!0,trapped:a,onMountAutoFocus:i(o,e=>{e.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,M.jsx)(g,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:_,onDismiss:y,children:(0,M.jsx)(he,{asChild:!0,...E,dir:w.dir,orientation:`vertical`,loop:r,currentTabStopId:ee,onCurrentTabStopIdChange:k,onEntryFocus:i(u,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,M.jsx)(S,{role:`menu`,"aria-orientation":`vertical`,"data-state":ht(C.open),"data-radix-menu-content":``,dir:w.dir,...T,...x,ref:te,style:{outline:`none`,...x.style},onKeyDown:i(x.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&L(e.key));let i=A.current;if(e.target!==i||!ye.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);ve.includes(e.key)&&a.reverse(),_t(a)}),onBlur:i(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),N.current=``)}),onPointerMove:i(e.onPointerMove,$(e=>{let t=e.target,n=I.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>I.current?`right`:`left`;F.current=t,I.current=e.clientX}}))})})})})})})});Fe.displayName=J;var Be=`MenuGroup`,Ve=D.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,M.jsx)(r.div,{role:`group`,...i,ref:t})});Ve.displayName=Be;var He=`MenuLabel`,Ue=D.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,M.jsx)(r.div,{...i,ref:t})});Ue.displayName=He;var Y=`MenuItem`,We=`menu.itemSelect`,X=D.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...a}=e,o=D.useRef(null),s=G(Y,e.__scopeMenu),c=Pe(Y,e.__scopeMenu),l=v(t,o),u=D.useRef(!1),d=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(We,{bubbles:!0,cancelable:!0});e.addEventListener(We,e=>r?.(e),{once:!0}),h(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,M.jsx)(Ge,{...a,ref:l,disabled:n,onClick:i(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:i(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:i(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||z.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});X.displayName=Y;var Ge=D.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:a=!1,textValue:o,...s}=e,c=Pe(Y,n),l=Te(n),u=D.useRef(null),d=v(t,u),[f,p]=D.useState(!1),[m,h]=D.useState(``);return D.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[s.children]),(0,M.jsx)(V.ItemSlot,{scope:n,disabled:a,textValue:o??m,children:(0,M.jsx)(ge,{asChild:!0,...l,focusable:!a,children:(0,M.jsx)(r.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,...s,ref:d,onPointerMove:i(e.onPointerMove,$(e=>{a?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:i(e.onPointerLeave,$(e=>c.onItemLeave(e))),onFocus:i(e.onFocus,()=>p(!0)),onBlur:i(e.onBlur,()=>p(!1))})})})}),Ke=`MenuCheckboxItem`,qe=D.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...a}=e;return(0,M.jsx)(tt,{scope:e.__scopeMenu,checked:n,children:(0,M.jsx)(X,{role:`menuitemcheckbox`,"aria-checked":Q(n)?`mixed`:n,...a,ref:t,"data-state":gt(n),onSelect:i(a.onSelect,()=>r?.(Q(n)?!0:!n),{checkForDefaultPrevented:!1})})})});qe.displayName=Ke;var Je=`MenuRadioGroup`,[Ye,Xe]=H(Je,{value:void 0,onValueChange:()=>{}}),Ze=D.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,o=a(r);return(0,M.jsx)(Ye,{scope:e.__scopeMenu,value:n,onValueChange:o,children:(0,M.jsx)(Ve,{...i,ref:t})})});Ze.displayName=Je;var Qe=`MenuRadioItem`,$e=D.forwardRef((e,t)=>{let{value:n,...r}=e,a=Xe(Qe,e.__scopeMenu),o=n===a.value;return(0,M.jsx)(tt,{scope:e.__scopeMenu,checked:o,children:(0,M.jsx)(X,{role:`menuitemradio`,"aria-checked":o,...r,ref:t,"data-state":gt(o),onSelect:i(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});$e.displayName=Qe;var et=`MenuItemIndicator`,[tt,nt]=H(et,{checked:!1}),rt=D.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:i,...a}=e,o=nt(et,n);return(0,M.jsx)(s,{present:i||Q(o.checked)||o.checked===!0,children:(0,M.jsx)(r.span,{...a,ref:t,"data-state":gt(o.checked)})})});rt.displayName=et;var it=`MenuSeparator`,at=D.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,M.jsx)(r.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:t})});at.displayName=it;var ot=`MenuArrow`,st=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=U(n);return(0,M.jsx)(C,{...i,...r,ref:t})});st.displayName=ot;var ct=`MenuSub`,[lt,ut]=H(ct),dt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,o=W(ct,t),s=U(t),[c,l]=D.useState(null),[u,d]=D.useState(null),f=a(i);return D.useEffect(()=>(o.open===!1&&f(!1),()=>f(!1)),[o.open,f]),(0,M.jsx)(x,{...s,children:(0,M.jsx)(Ee,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:(0,M.jsx)(lt,{scope:t,contentId:_(),triggerId:_(),trigger:c,onTriggerChange:l,children:n})})})};dt.displayName=ct;var Z=`MenuSubTrigger`,ft=D.forwardRef((e,t)=>{let n=W(Z,e.__scopeMenu),r=G(Z,e.__scopeMenu),a=ut(Z,e.__scopeMenu),o=Pe(Z,e.__scopeMenu),s=D.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=D.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);D.useEffect(()=>d,[d]),D.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=v(t,a.onTriggerChange);return(0,M.jsx)(K,{asChild:!0,...u,children:(0,M.jsx)(Ge,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":ht(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:i(e.onPointerMove,$(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:i(e.onPointerLeave,$(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:i(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||be[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});ft.displayName=Z;var pt=`MenuSubContent`,mt=D.forwardRef((e,t)=>{let n=je(J,e.__scopeMenu),{forceMount:r=n.forceMount,align:a=`start`,...o}=e,c=W(J,e.__scopeMenu),l=G(J,e.__scopeMenu),u=ut(pt,e.__scopeMenu),d=D.useRef(null),f=v(t,d);return(0,M.jsx)(V.Provider,{scope:e.__scopeMenu,children:(0,M.jsx)(s,{present:r||c.open,children:(0,M.jsx)(V.Slot,{scope:e.__scopeMenu,children:(0,M.jsx)(ze,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:a,side:l.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:i(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:i(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:i(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=xe[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})});mt.displayName=pt;function ht(e){return e?`open`:`closed`}function Q(e){return e===`indeterminate`}function gt(e){return Q(e)?`indeterminate`:e?`checked`:`unchecked`}function _t(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function vt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function yt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=vt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function bt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function xt(e,t){return t?bt({x:e.clientX,y:e.clientY},t):!1}function $(e){return t=>t.pointerType===`mouse`?e(t):void 0}var St=Oe,Ct=K,wt=Me,Tt=Fe,Et=Ve,Dt=Ue,Ot=X,kt=qe,At=Ze,jt=$e,Mt=rt,Nt=at,Pt=st,Ft=dt,It=ft,Lt=mt;export{we as _,Et as a,Dt as c,jt as d,St as f,It as g,Lt as h,Tt as i,wt as l,Ft as m,Pt as n,Ot as o,Nt as p,kt as r,Mt as s,Ct as t,At as u};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{C as r,E as i,S as a,T as o,_ as s,b as c,f as l,g as u,h as d,m as f,p,v as m,w as h,x as g,y as _}from"./dialog-DfdBRe6G.js";import{o as v,r as y}from"./x-CbfJFzGo.js";import{_ as b,g as x,h as S,m as C,n as w,p as T,t as E}from"./dist-CNoWjXWo.js";var D=e(t(),1),O=!1;function ee(){let[e,t]=D.useState(O);return D.useEffect(()=>{O||(O=!0,t(!0))},[]),e}var k=D.useSyncExternalStore;function A(){return()=>{}}function te(){return k(A,()=>!0,()=>!1)}var j=typeof k==`function`?te:ee,M=n(),N=`rovingFocusGroup.onEntryFocus`,ne={bubbles:!1,cancelable:!0},P=`RovingFocusGroup`,[F,I,re]=w(P),[ie,L]=o(P,[re]),[R,ae]=ie(P),oe=D.forwardRef((e,t)=>(0,M.jsx)(F.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,M.jsx)(F.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,M.jsx)(se,{...e,ref:t})})}));oe.displayName=P;var se=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:m=!1,...h}=e,g=D.useRef(null),_=v(t,g),y=E(c),[b,x]=u({prop:l,defaultProp:d??null,onChange:f,caller:P}),[S,C]=D.useState(!1),w=a(p),T=I(n),O=D.useRef(!1),[ee,k]=D.useState(0);return D.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(N,w),()=>e.removeEventListener(N,w)},[w]),(0,M.jsx)(R,{scope:n,orientation:o,dir:y,loop:s,currentTabStopId:b,onItemFocus:D.useCallback(e=>x(e),[x]),onItemShiftTab:D.useCallback(()=>C(!0),[]),onFocusableItemAdd:D.useCallback(()=>k(e=>e+1),[]),onFocusableItemRemove:D.useCallback(()=>k(e=>e-1),[]),children:(0,M.jsx)(r.div,{tabIndex:S||ee===0?-1:0,"data-orientation":o,...h,ref:_,style:{outline:`none`,...e.style},onMouseDown:i(e.onMouseDown,()=>{O.current=!0}),onFocus:i(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent(N,ne);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);pe([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),m)}}O.current=!1}),onBlur:i(e.onBlur,()=>C(!1))})})}),ce=`RovingFocusGroupItem`,le=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:s,children:l,...u}=e,d=_(),f=s||d,p=ae(ce,n),m=p.currentTabStopId===f,h=I(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:y}=p,b=j();return c(()=>{if(!(!b||!a))return g(),()=>v()},[b,a,g,v]),D.useEffect(()=>{if(!(b||!a))return g(),()=>v()},[b,a,g,v]),(0,M.jsx)(F.ItemSlot,{scope:n,id:f,focusable:a,active:o,children:(0,M.jsx)(r.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:i(e.onMouseDown,e=>{a?p.onItemFocus(f):e.preventDefault()}),onFocus:i(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:i(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=fe(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?me(n,r+1):n.slice(r+1)}setTimeout(()=>pe(n))}}),children:typeof l==`function`?l({isCurrentTabStop:m,hasTabStop:y!=null}):l})})});le.displayName=ce;var ue={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function de(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function fe(e,t,n){let r=de(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ue[r]}function pe(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function me(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var he=oe,ge=le,z=[`Enter`,` `],_e=[`ArrowDown`,`PageUp`,`Home`],ve=[`ArrowUp`,`PageDown`,`End`],ye=[..._e,...ve],be={ltr:[...z,`ArrowRight`],rtl:[...z,`ArrowLeft`]},xe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},B=`Menu`,[V,Se,Ce]=w(B),[H,we]=o(B,[Ce,b,L]),U=b(),Te=L(),[Ee,W]=H(B),[De,G]=H(B),Oe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,c=U(t),[l,u]=D.useState(null),d=D.useRef(!1),f=a(o),p=E(i);return D.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),D.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,M.jsx)(x,{...c,children:(0,M.jsx)(Ee,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,M.jsx)(De,{scope:t,onClose:D.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})};Oe.displayName=B;var ke=`MenuAnchor`,K=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=U(n);return(0,M.jsx)(T,{...i,...r,ref:t})});K.displayName=ke;var q=`MenuPortal`,[Ae,je]=H(q,{forceMount:void 0}),Me=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=W(q,t);return(0,M.jsx)(Ae,{scope:t,forceMount:n,children:(0,M.jsx)(s,{present:n||a.open,children:(0,M.jsx)(m,{asChild:!0,container:i,children:r})})})};Me.displayName=q;var J=`MenuContent`,[Ne,Pe]=H(J),Fe=D.forwardRef((e,t)=>{let n=je(J,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=W(J,e.__scopeMenu),o=G(J,e.__scopeMenu);return(0,M.jsx)(V.Provider,{scope:e.__scopeMenu,children:(0,M.jsx)(s,{present:r||a.open,children:(0,M.jsx)(V.Slot,{scope:e.__scopeMenu,children:o.modal?(0,M.jsx)(Ie,{...i,ref:t}):(0,M.jsx)(Le,{...i,ref:t})})})})}),Ie=D.forwardRef((e,t)=>{let n=W(J,e.__scopeMenu),r=D.useRef(null),a=v(t,r);return D.useEffect(()=>{let e=r.current;if(e)return p(e)},[]),(0,M.jsx)(ze,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:i(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Le=D.forwardRef((e,t)=>{let n=W(J,e.__scopeMenu);return(0,M.jsx)(ze,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Re=y(`MenuContent.ScrollLock`),ze=D.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:_,onDismiss:y,disableOutsideScroll:b,...x}=e,C=W(J,n),w=G(J,n),T=U(n),E=Te(n),O=Se(n),[ee,k]=D.useState(null),A=D.useRef(null),te=v(t,A,C.onContentChange),j=D.useRef(0),N=D.useRef(``),ne=D.useRef(0),P=D.useRef(null),F=D.useRef(`right`),I=D.useRef(0),re=b?l:D.Fragment,ie=b?{as:Re,allowPinchZoom:!0}:void 0,L=e=>{let t=N.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=yt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){N.current=t,window.clearTimeout(j.current),t!==``&&(j.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};D.useEffect(()=>()=>window.clearTimeout(j.current),[]),d();let R=D.useCallback(e=>F.current===P.current?.side&&xt(e,P.current?.area),[]);return(0,M.jsx)(Ne,{scope:n,searchRef:N,onItemEnter:D.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:D.useCallback(e=>{R(e)||(A.current?.focus(),k(null))},[R]),onTriggerLeave:D.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:D.useCallback(e=>{P.current=e},[]),children:(0,M.jsx)(re,{...ie,children:(0,M.jsx)(f,{asChild:!0,trapped:a,onMountAutoFocus:i(o,e=>{e.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,M.jsx)(g,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:_,onDismiss:y,children:(0,M.jsx)(he,{asChild:!0,...E,dir:w.dir,orientation:`vertical`,loop:r,currentTabStopId:ee,onCurrentTabStopIdChange:k,onEntryFocus:i(u,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,M.jsx)(S,{role:`menu`,"aria-orientation":`vertical`,"data-state":ht(C.open),"data-radix-menu-content":``,dir:w.dir,...T,...x,ref:te,style:{outline:`none`,...x.style},onKeyDown:i(x.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&L(e.key));let i=A.current;if(e.target!==i||!ye.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);ve.includes(e.key)&&a.reverse(),_t(a)}),onBlur:i(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),N.current=``)}),onPointerMove:i(e.onPointerMove,$(e=>{let t=e.target,n=I.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>I.current?`right`:`left`;F.current=t,I.current=e.clientX}}))})})})})})})});Fe.displayName=J;var Be=`MenuGroup`,Ve=D.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,M.jsx)(r.div,{role:`group`,...i,ref:t})});Ve.displayName=Be;var He=`MenuLabel`,Ue=D.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,M.jsx)(r.div,{...i,ref:t})});Ue.displayName=He;var Y=`MenuItem`,We=`menu.itemSelect`,X=D.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...a}=e,o=D.useRef(null),s=G(Y,e.__scopeMenu),c=Pe(Y,e.__scopeMenu),l=v(t,o),u=D.useRef(!1),d=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(We,{bubbles:!0,cancelable:!0});e.addEventListener(We,e=>r?.(e),{once:!0}),h(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,M.jsx)(Ge,{...a,ref:l,disabled:n,onClick:i(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:i(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:i(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||z.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});X.displayName=Y;var Ge=D.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:a=!1,textValue:o,...s}=e,c=Pe(Y,n),l=Te(n),u=D.useRef(null),d=v(t,u),[f,p]=D.useState(!1),[m,h]=D.useState(``);return D.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[s.children]),(0,M.jsx)(V.ItemSlot,{scope:n,disabled:a,textValue:o??m,children:(0,M.jsx)(ge,{asChild:!0,...l,focusable:!a,children:(0,M.jsx)(r.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,...s,ref:d,onPointerMove:i(e.onPointerMove,$(e=>{a?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:i(e.onPointerLeave,$(e=>c.onItemLeave(e))),onFocus:i(e.onFocus,()=>p(!0)),onBlur:i(e.onBlur,()=>p(!1))})})})}),Ke=`MenuCheckboxItem`,qe=D.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...a}=e;return(0,M.jsx)(tt,{scope:e.__scopeMenu,checked:n,children:(0,M.jsx)(X,{role:`menuitemcheckbox`,"aria-checked":Q(n)?`mixed`:n,...a,ref:t,"data-state":gt(n),onSelect:i(a.onSelect,()=>r?.(Q(n)?!0:!n),{checkForDefaultPrevented:!1})})})});qe.displayName=Ke;var Je=`MenuRadioGroup`,[Ye,Xe]=H(Je,{value:void 0,onValueChange:()=>{}}),Ze=D.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,o=a(r);return(0,M.jsx)(Ye,{scope:e.__scopeMenu,value:n,onValueChange:o,children:(0,M.jsx)(Ve,{...i,ref:t})})});Ze.displayName=Je;var Qe=`MenuRadioItem`,$e=D.forwardRef((e,t)=>{let{value:n,...r}=e,a=Xe(Qe,e.__scopeMenu),o=n===a.value;return(0,M.jsx)(tt,{scope:e.__scopeMenu,checked:o,children:(0,M.jsx)(X,{role:`menuitemradio`,"aria-checked":o,...r,ref:t,"data-state":gt(o),onSelect:i(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});$e.displayName=Qe;var et=`MenuItemIndicator`,[tt,nt]=H(et,{checked:!1}),rt=D.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:i,...a}=e,o=nt(et,n);return(0,M.jsx)(s,{present:i||Q(o.checked)||o.checked===!0,children:(0,M.jsx)(r.span,{...a,ref:t,"data-state":gt(o.checked)})})});rt.displayName=et;var it=`MenuSeparator`,at=D.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,M.jsx)(r.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:t})});at.displayName=it;var ot=`MenuArrow`,st=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=U(n);return(0,M.jsx)(C,{...i,...r,ref:t})});st.displayName=ot;var ct=`MenuSub`,[lt,ut]=H(ct),dt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,o=W(ct,t),s=U(t),[c,l]=D.useState(null),[u,d]=D.useState(null),f=a(i);return D.useEffect(()=>(o.open===!1&&f(!1),()=>f(!1)),[o.open,f]),(0,M.jsx)(x,{...s,children:(0,M.jsx)(Ee,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:(0,M.jsx)(lt,{scope:t,contentId:_(),triggerId:_(),trigger:c,onTriggerChange:l,children:n})})})};dt.displayName=ct;var Z=`MenuSubTrigger`,ft=D.forwardRef((e,t)=>{let n=W(Z,e.__scopeMenu),r=G(Z,e.__scopeMenu),a=ut(Z,e.__scopeMenu),o=Pe(Z,e.__scopeMenu),s=D.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=D.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);D.useEffect(()=>d,[d]),D.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=v(t,a.onTriggerChange);return(0,M.jsx)(K,{asChild:!0,...u,children:(0,M.jsx)(Ge,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":ht(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:i(e.onPointerMove,$(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:i(e.onPointerLeave,$(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:i(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||be[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});ft.displayName=Z;var pt=`MenuSubContent`,mt=D.forwardRef((e,t)=>{let n=je(J,e.__scopeMenu),{forceMount:r=n.forceMount,align:a=`start`,...o}=e,c=W(J,e.__scopeMenu),l=G(J,e.__scopeMenu),u=ut(pt,e.__scopeMenu),d=D.useRef(null),f=v(t,d);return(0,M.jsx)(V.Provider,{scope:e.__scopeMenu,children:(0,M.jsx)(s,{present:r||c.open,children:(0,M.jsx)(V.Slot,{scope:e.__scopeMenu,children:(0,M.jsx)(ze,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:a,side:l.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:i(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:i(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:i(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=xe[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})});mt.displayName=pt;function ht(e){return e?`open`:`closed`}function Q(e){return e===`indeterminate`}function gt(e){return Q(e)?`indeterminate`:e?`checked`:`unchecked`}function _t(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function vt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function yt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=vt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function bt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function xt(e,t){return t?bt({x:e.clientX,y:e.clientY},t):!1}function $(e){return t=>t.pointerType===`mouse`?e(t):void 0}var St=Oe,Ct=K,wt=Me,Tt=Fe,Et=Ve,Dt=Ue,Ot=X,kt=qe,At=Ze,jt=$e,Mt=rt,Nt=at,Pt=st,Ft=dt,It=ft,Lt=mt;export{we as _,Et as a,Dt as c,jt as d,St as f,It as g,Lt as h,Tt as i,wt as l,Ft as m,Pt as n,Ot as o,Nt as p,kt as r,Mt as s,Ct as t,At as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n}from"./jsx-runtime-ffCh33zF.js";var r=e(t(),1),i=e(n(),1);function a(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var o=e=>{switch(e){case`success`:return l;case`info`:return d;case`warning`:return u;case`error`:return f;default:return null}},s=Array(12).fill(0),c=({visible:e,className:t})=>r.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},r.createElement(`div`,{className:`sonner-spinner`},s.map((e,t)=>r.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),l=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),u=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),d=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),f=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),p=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},r.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),r.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ee=()=>{let[e,t]=r.useState(document.hidden);return r.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},m=1,h=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:m++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let i=Promise.resolve(e instanceof Function?e():e),a=n!==void 0,o,s=i.then(async e=>{if(o=[`resolve`,e],r.isValidElement(e))a=!1,this.create({id:n,type:`default`,message:e});else if(_(e)&&!e.ok){a=!1;let i=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){a=!1;let i=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){a=!1;let i=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){a=!1;let i=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||m++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},g=(e,t)=>{let n=t?.id||m++;return h.addToast({title:e,...t,id:n}),n},_=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,v=Object.assign(g,{success:h.success,info:h.info,warning:h.warning,error:h.error,custom:h.custom,message:h.message,promise:h.promise,dismiss:h.dismiss,loading:h.loading},{getHistory:()=>h.toasts,getToasts:()=>h.getActiveToasts()});a(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function y(e){return e.label!==void 0}var te=3,b=`24px`,x=`16px`,S=4e3,C=356,w=14,T=45,E=200;function D(...e){return e.filter(Boolean).join(` `)}function ne(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var O=e=>{let{invert:t,toast:n,unstyled:i,interacting:a,setHeights:s,visibleToasts:l,heights:u,index:d,toasts:f,expanded:m,removeToast:h,defaultRichColors:g,closeButton:_,style:v,cancelButtonStyle:te,actionButtonStyle:b,className:x=``,descriptionClassName:C=``,duration:w,position:O,gap:k,expandByDefault:A,classNames:j,icons:M,closeButtonAriaLabel:re=`Close toast`}=e,[N,P]=r.useState(null),[F,ie]=r.useState(null),[I,L]=r.useState(!1),[R,z]=r.useState(!1),[B,V]=r.useState(!1),[ae,oe]=r.useState(!1),[se,ce]=r.useState(!1),[le,H]=r.useState(0),[ue,U]=r.useState(0),W=r.useRef(n.duration||w||S),de=r.useRef(null),G=r.useRef(null),fe=d===0,pe=d+1<=l,K=n.type,q=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,J=r.useMemo(()=>u.findIndex(e=>e.toastId===n.id)||0,[u,n.id]),ge=r.useMemo(()=>n.closeButton??_,[n.closeButton,_]),_e=r.useMemo(()=>n.duration||w||S,[n.duration,w]),Y=r.useRef(0),X=r.useRef(0),ve=r.useRef(0),Z=r.useRef(null),[ye,be]=O.split(`-`),xe=r.useMemo(()=>u.reduce((e,t,n)=>n>=J?e:e+t.height,0),[u,J]),Se=ee(),Ce=n.invert||t,Q=K===`loading`;X.current=r.useMemo(()=>J*k+xe,[J,xe]),r.useEffect(()=>{W.current=_e},[_e]),r.useEffect(()=>{L(!0)},[]),r.useEffect(()=>{let e=G.current;if(e){let t=e.getBoundingClientRect().height;return U(t),s(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>s(e=>e.filter(e=>e.toastId!==n.id))}},[s,n.id]),r.useLayoutEffect(()=>{if(!I)return;let e=G.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),s(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[I,n.title,n.description,s,n.id,n.jsx,n.action,n.cancel]);let $=r.useCallback(()=>{z(!0),H(X.current),s(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{h(n)},E)},[n,h,s,X]);r.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return m||a||Se?(()=>{if(ve.current<Y.current){let e=new Date().getTime()-Y.current;W.current-=e}ve.current=new Date().getTime()})():W.current!==1/0&&(Y.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[m,a,n,K,Se,$]),r.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return M?.loading?r.createElement(`div`,{className:D(j?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},M.loading):r.createElement(c,{className:D(j?.loader,n?.classNames?.loader),visible:K===`loading`})}let Te=n.icon||M?.[K]||o(K);return r.createElement(`li`,{tabIndex:0,ref:G,className:D(x,me,j?.toast,n?.classNames?.toast,j?.default,j?.[K],n?.classNames?.[K]),"data-sonner-toast":``,"data-rich-colors":n.richColors??g,"data-styled":!(n.jsx||n.unstyled||i),"data-mounted":I,"data-promise":!!n.promise,"data-swiped":se,"data-removed":R,"data-visible":pe,"data-y-position":ye,"data-x-position":be,"data-index":d,"data-front":fe,"data-swiping":B,"data-dismissible":q,"data-type":K,"data-invert":Ce,"data-swipe-out":ae,"data-swipe-direction":F,"data-expanded":!!(m||A&&I),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${R?le:X.current}px`,"--initial-height":A?`auto`:`${ue}px`,...v,...n.style},onDragEnd:()=>{V(!1),P(null),Z.current=null},onPointerDown:e=>{e.button!==2&&(Q||!q||(de.current=new Date,H(X.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(V(!0),Z.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(ae||!q)return;Z.current=null;let e=Number(G.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(G.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=N===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=T||a>.11){H(X.current),n.onDismiss==null||n.onDismiss.call(n,n),ie(N===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),oe(!0);return}else{var o,s;(o=G.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=G.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ce(!1),V(!1),P(null)},onPointerMove:t=>{var n,r;if(!Z.current||!q||window.getSelection()?.toString().length>0)return;let i=t.clientY-Z.current.y,a=t.clientX-Z.current.x,o=e.swipeDirections??ne(O);!N&&(Math.abs(a)>1||Math.abs(i)>1)&&P(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(N===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(N===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ce(!0),(n=G.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=G.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx&&K!==`loading`?r.createElement(`button`,{"aria-label":re,"data-disabled":Q,"data-close-button":!0,onClick:Q||!q?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:D(j?.closeButton,n?.classNames?.closeButton)},M?.close??p):null,(K||n.icon||n.promise)&&n.icon!==null&&(M?.[K]!==null||n.icon)?r.createElement(`div`,{"data-icon":``,className:D(j?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,r.createElement(`div`,{"data-content":``,className:D(j?.content,n?.classNames?.content)},r.createElement(`div`,{"data-title":``,className:D(j?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?r.createElement(`div`,{"data-description":``,className:D(C,he,j?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),r.isValidElement(n.cancel)?n.cancel:n.cancel&&y(n.cancel)?r.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||te,onClick:e=>{y(n.cancel)&&q&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:D(j?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,r.isValidElement(n.action)?n.action:n.action&&y(n.action)?r.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||b,onClick:e=>{y(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:D(j?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function k(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function A(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?x:b;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var j=r.forwardRef(function(e,t){let{id:n,invert:a,position:o=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:ee,duration:m,style:g,visibleToasts:_=te,toastOptions:v,dir:y=k(),gap:b=w,icons:x,containerAriaLabel:S=`Notifications`}=e,[T,E]=r.useState([]),D=r.useMemo(()=>n?T.filter(e=>e.toasterId===n):T.filter(e=>!e.toasterId),[T,n]),ne=r.useMemo(()=>Array.from(new Set([o].concat(D.filter(e=>e.position).map(e=>e.position)))),[D,o]),[j,M]=r.useState([]),[re,N]=r.useState(!1),[P,F]=r.useState(!1),[ie,I]=r.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),L=r.useRef(null),R=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),z=r.useRef(null),B=r.useRef(!1),V=r.useCallback(e=>{E(t=>(t.find(t=>t.id===e.id)?.delete||h.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return r.useEffect(()=>h.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{E(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{i.flushSync(()=>{E(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[T]),r.useEffect(()=>{if(p!==`system`){I(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?I(`dark`):I(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{I(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{I(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),r.useEffect(()=>{T.length<=1&&N(!1)},[T]),r.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;N(!0),(t=L.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===L.current||L.current?.contains(document.activeElement))&&N(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),r.useEffect(()=>{if(L.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,B.current=!1)}},[L.current]),r.createElement(`section`,{ref:t,"aria-label":`${S} ${R}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},ne.map((t,n)=>{let[i,o]=t.split(`-`);return D.length?r.createElement(`ol`,{key:t,dir:y===`auto`?k():y,tabIndex:-1,ref:L,className:u,"data-sonner-toaster":!0,"data-sonner-theme":ie,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${j[0]?.height||0}px`,"--width":`${C}px`,"--gap":`${b}px`,...g,...A(d,f)},onBlur:e=>{B.current&&!e.currentTarget.contains(e.relatedTarget)&&(B.current=!1,z.current&&=(z.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||B.current||(B.current=!0,z.current=e.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{P||N(!1)},onDragEnd:()=>N(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||F(!0)},onPointerUp:()=>F(!1)},D.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>r.createElement(O,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:ee,duration:v?.duration??m,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:a,visibleToasts:_,closeButton:v?.closeButton??l,interacting:P,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:V,toasts:D.filter(e=>e.position==n.position),heights:j.filter(e=>e.position==n.position),setHeights:M,expandByDefault:c,gap:b,expanded:re,swipeDirections:e.swipeDirections}))):null}))});export{v as n,j as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Jt as e,Yt as t}from"./local-store-3IuC2qMo.js";import{t as n}from"./debounce-B9DrqirV.js";var r=`puddle-drafts`,i=1,a=`drafts`,o=`by_session`,s=1e3;function c(e,n,r,i){return e.content===n?`discard`:e.baseRevision||i?t(e.baseRevision,i)?`restore`:`offer`:e.base_mtime_ms===r?`restore`:`offer`}function l(e,t,n){let r=`${encodeURIComponent(e)}:${encodeURIComponent(t)}`;return n===void 0?r:`${r}:${encodeURIComponent(n)}`}function u(){return new Promise((e,t)=>{if(typeof indexedDB>`u`){t(Error(`indexedDB is unavailable in this environment`));return}let n=indexedDB.open(r,i);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(a)||e.createObjectStore(a).createIndex(o,`session`,{unique:!1})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))})}function d(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error??Error(`indexedDB request failed`))})}function f(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>n(e.error??Error(`indexedDB transaction failed`)),e.onabort=()=>n(e.error??Error(`indexedDB transaction aborted`))})}async function p(e,t){let n=await u();try{let r=n.transaction(a,e),i=await t(r.objectStore(a));return await f(r),i}finally{n.close()}}async function m(e,t,n,r,i,a){let o={session:e,path:t,content:n,base_mtime_ms:r,updated_at:Date.now(),...a?{baseRevision:a}:{},...i===void 0?{}:{root:i}};try{await p(`readwrite`,n=>d(n.put(o,l(e,t,i))))}catch(e){console.warn(`saveDraft failed: ${e.message}`)}}async function h(t,n,r){try{let i=await p(`readonly`,e=>d(e.get(l(t,n,r))));return i?{...i,baseRevision:e(i.baseRevision)}:null}catch(e){return console.warn(`loadDraft failed: ${e.message}`),null}}async function g(e,t,n){try{await p(`readwrite`,r=>d(r.delete(l(e,t,n))))}catch(e){console.warn(`deleteDraft failed: ${e.message}`)}}function _(e,t,r){return n((n,i,a)=>{m(e,t,n,i,r,a)},s)}export{h as a,_ as i,c as n,m as o,l as r,g as t};
|