@hearsay-tools/squawk 0.17.0-dev.5723 → 0.17.0-dev.5734

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +19 -19
  2. package/dist/application-update/discovery.js +19 -11
  3. package/dist/application-update/discovery.js.map +1 -1
  4. package/dist/application-update/service.js +2 -2
  5. package/dist/application-update/service.js.map +1 -1
  6. package/dist/delegation/entry-exists.d.ts +2 -0
  7. package/dist/delegation/entry-exists.js +10 -0
  8. package/dist/delegation/entry-exists.js.map +1 -0
  9. package/dist/delegation/identity-file-store.d.ts +22 -0
  10. package/dist/delegation/identity-file-store.js +16 -0
  11. package/dist/delegation/identity-file-store.js.map +1 -0
  12. package/dist/delegation/posix-workspace-identity.d.ts +3 -0
  13. package/dist/delegation/posix-workspace-identity.js +68 -0
  14. package/dist/delegation/posix-workspace-identity.js.map +1 -0
  15. package/dist/delegation/routes.d.ts +75 -75
  16. package/dist/delegation/transport.d.ts +13 -13
  17. package/dist/delegation/windows-identity-store.d.ts +5 -0
  18. package/dist/delegation/windows-identity-store.js +15 -0
  19. package/dist/delegation/windows-identity-store.js.map +1 -0
  20. package/dist/delegation/workspace.js +9 -75
  21. package/dist/delegation/workspace.js.map +1 -1
  22. package/dist/home/command.js +2 -2
  23. package/dist/home/command.js.map +1 -1
  24. package/dist/home/identity.d.ts +38 -14
  25. package/dist/home/identity.js +18 -8
  26. package/dist/home/identity.js.map +1 -1
  27. package/dist/index.js +3 -0
  28. package/dist/index.js.map +1 -1
  29. package/dist/install-as-command.d.ts +1 -1
  30. package/dist/release/manifests.d.ts +10 -15
  31. package/dist/release/manifests.js +17 -10
  32. package/dist/release/manifests.js.map +1 -1
  33. package/dist/release/snapshot.d.ts +3 -3
  34. package/dist/release/snapshot.js +3 -4
  35. package/dist/release/snapshot.js.map +1 -1
  36. package/dist/self-update/launcher.js +2 -2
  37. package/dist/self-update/launcher.js.map +1 -1
  38. package/dist/self-update/layout.d.ts +1 -1
  39. package/dist/serve-command.js +7 -1
  40. package/dist/serve-command.js.map +1 -1
  41. package/dist/server/activity-routes.d.ts +23 -23
  42. package/dist/server/live-routes.d.ts +6 -6
  43. package/dist/server/server.d.ts +1571 -1571
  44. package/dist/server-install/npx-cache.d.ts +5 -1
  45. package/dist/server-install/npx-cache.js +15 -4
  46. package/dist/server-install/npx-cache.js.map +1 -1
  47. package/dist/server-install/platforms/macosx-launchd-files.js +4 -2
  48. package/dist/server-install/platforms/macosx-launchd-files.js.map +1 -1
  49. package/dist/server-install/platforms/macosx-ngrok.js +6 -6
  50. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -1
  51. package/dist/server-install/platforms/ubuntu-vps.d.ts +5 -4
  52. package/dist/server-install/platforms/ubuntu-vps.js +11 -11
  53. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  54. package/package.json +4 -4
  55. package/scripts/benchmark-family-reconcile.ts +4 -0
  56. package/scripts/benchmark-run-store.ts +4 -0
  57. package/scripts/benchmark-stuck-destroys.ts +4 -0
  58. package/scripts/benchmark-workspace-events.ts +4 -0
  59. package/web/dist/assets/{activity-motion-SGth5vR4.js → activity-motion-hhx0e841.js} +1 -1
  60. package/web/dist/assets/{activity-route-D8otXwOA.js → activity-route-De0BnSrc.js} +1 -1
  61. package/web/dist/assets/{agent-accounts-6EuZhy-N.js → agent-accounts-BCg-578Q.js} +1 -1
  62. package/web/dist/assets/{alert-dialog-vFjLgfK4.js → alert-dialog-Dj464rjk.js} +1 -1
  63. package/web/dist/assets/{button-BEK7XKhS.js → button-CHUAMTHK.js} +1 -1
  64. package/web/dist/assets/{centered-state-CPgI8cCO.js → centered-state-DGyy0SuA.js} +1 -1
  65. package/web/dist/assets/{commit-diff-panel-DzyWgn1Z.js → commit-diff-panel-DYtYc_dH.js} +1 -1
  66. package/web/dist/assets/{control-locations-CexZsd3M.js → control-locations-CA9TMupq.js} +1 -1
  67. package/web/dist/assets/{diff-controls-DXyB0aDl.js → diff-controls-BR2uqhwG.js} +1 -1
  68. package/web/dist/assets/{diff-DBDiZl58.js → diff-tVGVhYyc.js} +2 -2
  69. package/web/dist/assets/{diff-view-DiKAwVMH.js → diff-view-CNM3u77o.js} +1 -1
  70. package/web/dist/assets/{dropdown-menu-DYflHa4m.js → dropdown-menu-DhrBcVgr.js} +1 -1
  71. package/web/dist/assets/{es2015-BO600Xfi.js → es2015-D345RR4o.js} +1 -1
  72. package/web/dist/assets/{file-preview-DTSRkmMo.js → file-preview-C1eTdJLJ.js} +1 -1
  73. package/web/dist/assets/{git-toolbar-U4s46kUd.js → git-toolbar-Dwz8p8GW.js} +1 -1
  74. package/web/dist/assets/{github-UaBp2yRF.js → github-BSezqH6f.js} +1 -1
  75. package/web/dist/assets/{github-sidebar-model-czjLsgVJ.js → github-sidebar-model-Ct0DltOv.js} +1 -1
  76. package/web/dist/assets/{global-activity-route-B2N2Nz0H.js → global-activity-route-BZiYz-B0.js} +1 -1
  77. package/web/dist/assets/{image-preview-XPCPclpG.js → image-preview-Cq1vDiEo.js} +1 -1
  78. package/web/dist/assets/{index-xj-3O89_.js → index-D489J7QW.js} +5 -5
  79. package/web/dist/assets/{live-refetch-C-Ony2Yr.js → live-refetch-C0kQc3-z.js} +1 -1
  80. package/web/dist/assets/{markdown-UdZ_toya.js → markdown-D7DUNWcJ.js} +1 -1
  81. package/web/dist/assets/{nav-row-styles-BE99gD3_.js → nav-row-styles-BZUUavOF.js} +1 -1
  82. package/web/dist/assets/{popover-CpULuQSm.js → popover-DRcRI46x.js} +1 -1
  83. package/web/dist/assets/{preview-pane-connected-CgRK7GzB.js → preview-pane-connected-DGkEs_L3.js} +1 -1
  84. package/web/dist/assets/{project-router-CimAoN1H.js → project-router-1m_VlC22.js} +1 -1
  85. package/web/dist/assets/{project-scope-context-DMpvJqIm.js → project-scope-context-CaUqlAd7.js} +1 -1
  86. package/web/dist/assets/{queries-BIOp8jLx.js → queries-DYfIpJ-d.js} +1 -1
  87. package/web/dist/assets/{repo-git-XkyTfP9G.js → repo-git-CU1S5P-y.js} +1 -1
  88. package/web/dist/assets/{report-reader-CZjYS5Aw.js → report-reader-DlZol2Ux.js} +1 -1
  89. package/web/dist/assets/{reports-D_2sFE1y.js → reports-DIGGjk7C.js} +1 -1
  90. package/web/dist/assets/{run-header-BwPDVPpg.js → run-header-DPjiPKRe.js} +1 -1
  91. package/web/dist/assets/{skills-BkXe4p4q.js → skills-BMwanop_.js} +1 -1
  92. package/web/dist/assets/{tab-link-BIweqlIZ.js → tab-link-DCUifQ46.js} +1 -1
  93. package/web/dist/assets/{task-changes-USNHNm_T.js → task-changes-BZXWvQN3.js} +1 -1
  94. package/web/dist/assets/{task-commits-kHqlOJe_.js → task-commits-ByI9MSfc.js} +1 -1
  95. package/web/dist/assets/{task-files-wTWwLR39.js → task-files-LJbenpiH.js} +1 -1
  96. package/web/dist/assets/{task-github-item-GzaQjkF1.js → task-github-item-B0CU9lGR.js} +1 -1
  97. package/web/dist/assets/{task-thread-BZX863UN.js → task-thread-CXCN__1a.js} +1 -1
  98. package/web/dist/assets/{textarea-FAUkHz1K.js → textarea-DlVUfdWG.js} +1 -1
  99. package/web/dist/assets/{thread-state-CBzx2hmX.js → thread-state-BLaCzqeX.js} +1 -1
  100. package/web/dist/assets/{toaster-pthKGWiE.js → toaster-B1MyeHiE.js} +1 -1
  101. package/web/dist/assets/{use-hand-to-agent-state-Bav9eT3b.js → use-hand-to-agent-state-BkmKad8x.js} +1 -1
  102. package/web/dist/assets/{useInfiniteQuery-CQI4BO4C.js → useInfiniteQuery-qEY8OhKb.js} +1 -1
  103. package/web/dist/assets/useQuery-DOJQOEBO.js +1 -0
  104. package/web/dist/assets/{workflows-D871Gx--.js → workflows-Dbxb-d-6.js} +1 -1
  105. package/web/dist/assets/{ws-DspW9wBH.js → ws-DvGmrP4z.js} +1 -1
  106. package/web/dist/assets/{zoomable-image-DNc6ORaF.js → zoomable-image-5pOUaPEg.js} +1 -1
  107. package/web/dist/index.html +21 -21
  108. package/web/dist/assets/useQuery-Bkq-x4Id.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,p as n,u as r}from"./button-BEK7XKhS.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Ln as o,Rn as s,Zt as c,it as l}from"./queries-BIOp8jLx.js";import{n as u,r as d,t as f}from"./popover-CpULuQSm.js";import{F as p,I as m,N as h,P as g,U as _,_ as v,ct as y,g as b,h as x,m as S,p as C}from"./design-icons-DmYTv2r1.js";import{t as w}from"./createLucideIcon-BHp8sXmF.js";var T=w(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),E=e(i(),1),D=a(),O=(0,E.createContext)(null);function k({children:e}){let[t,n]=(0,E.useState)(()=>new Map),r=(0,E.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,E.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=l((0,E.useMemo)(()=>[...t.values()].flat(),[t])),o=(0,E.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,D.jsx)(O.Provider,{value:o,children:e})}var A=(0,E.createContext)(null);function j({projectId:e,repoBase:t,requests:n,children:r}){let i=(0,E.useContext)(O),a=(0,E.useContext)(A),o=(0,E.useId)();(0,E.useEffect)(()=>{if(i)return i.publish(o,n),()=>i.retract(o)},[i,o,n.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`)]);let s=l(i?M:n),c=i?.lookup??s,u=t??(a&&a.projectId===e?a.repoBase:void 0),d=(0,E.useMemo)(()=>({lookup:c,projectId:e,repoBase:u}),[c,e,u]);return(0,D.jsx)(A.Provider,{value:d,children:r})}var M=[];function N(e,t,n){let r=(0,E.useContext)(A),i=n??r?.projectId;return!r||!i||t===void 0?te:r.lookup({projectId:i,kind:e,number:t})}function ee(e,t){let n=(0,E.useContext)(A),r=t??n?.projectId;return!n||!r?[]:e.filter(e=>n.lookup({projectId:r,kind:`PR`,number:e}).conflicting===!0)}function P(){let e=(0,E.useContext)(A);return{projectId:e?.projectId,repoBase:e?.repoBase}}var te=Object.freeze({state:`idle`}),F={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,accent:`border-accent-strong/35 text-accent-text`,merged:`border-merged-strong/35 text-merged-text`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},I={success:`text-success`,danger:`text-danger`,accent:`text-merged-text`,merged:`text-merged-text`,info:`text-info`,neutral:`text-soft-foreground`,pending:`text-pending-strong`,conflict:`text-conflict`},ne={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,accent:`hover:bg-accent-strong/10`,merged:`hover:bg-merged-strong/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},re={draft:p,"review-required":m,"changes-requested":_,"checks-pending":null,"checks-failing":v,ready:C,merged:h,closed:g,open:S,completed:C,"not-planned":b};function L(e){return e===`PR`?`pr-chip`:`issue-chip`}function R(e){return e?{"data-conflicting":`true`}:{}}function z(e,t,n,r){return!n||r!==void 0&&c({kind:e,number:t??0,url:n},r)}function B(e,t,n){return e===`PR`&&(t??n)===!0}function V({plain:e,inert:t,conflicting:n,className:i,tone:a}){return e?r(`inline-flex items-center gap-1 rounded-[2px] text-inherit`,n&&`text-conflict font-medium`,!t&&`group/reference focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground`,i):r(`inline-flex h-[22px] items-center gap-1 rounded-md border px-1.5 font-mono text-[12px] font-normal`,F[a],i)}function H(e,t,n,r){return n&&!r?t?`${e===`PR`?`PR `:``}#${t}`:e:t?`${!r&&e===`Issue`?`Issue `:``}#${t}`:e}function U(e){return e===`PR`?`pull request`:`issue`}function W(e,t,n,r){return`Open the ${e}${t?` #${t}`:``} for ${n}${r?` — ${r.label}`:``}`}function G(e,t){return e&&t?I[t.tone]:void 0}function K(e,n){return!e&&(!n||!t(n))}function q({conflicting:e,presentation:t,status:n,plain:i,compact:a,inert:o,kind:s,label:c,glyphClass:l}){return(0,D.jsxs)(D.Fragment,{children:[e?(0,D.jsx)(y,{className:r(`size-2.5 shrink-0`,l),"aria-hidden":`true`}):(0,D.jsx)($,{status:t?n:void 0,className:i?r(`size-2.5`,l):void 0}),i&&a?s===`PR`?(0,D.jsx)(m,{"data-slot":`reference-kind`,className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,D.jsx)(S,{"data-slot":`reference-kind`,className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null,i?(0,D.jsx)(`span`,{className:o?void 0:`underline-offset-2 group-hover/reference:underline group-focus-visible/reference:underline`,children:c}):c]})}function J({kind:e,status:t,conflicting:n,chipClass:r,body:i}){return(0,D.jsx)(`span`,{"data-slot":L(e),"data-status":t,"data-inert":`true`,...R(n),className:r,children:i})}function Y({kind:e,number:n,tooltip:r,url:i}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`block font-medium`,children:[e===`PR`?`Pull request`:`Issue`,n?` #${n}`:``,` · `,r.headline]}),(0,D.jsx)(`span`,{className:`block`,children:r.detail}),r.also?(0,D.jsx)(`span`,{className:`block opacity-70`,children:r.also}):null,i&&t(i)?(0,D.jsx)(`span`,{className:`block opacity-70`,children:i.replace(/^https?:\/\//,``)}):null]})}function ie({reference:e,taskTitle:t,status:n,conflicting:i,conflictAction:a,projectId:c,repoBase:l,to:u,className:d,compact:f=!1,plain:p=!1,inert:m=!1}){let{kind:h,number:g,url:_}=e,v=P(),y=N(h,z(h,g,_,l??v.repoBase)?g:void 0,c),b=n??y.status,x=s(b),S=B(h,i,y.conflicting),C=S?o:x,w=C?.tone??`accent`,T=V({plain:p,inert:m,conflicting:S,className:d,tone:w}),E=le(y,C,S?x:void 0),O=H(h,g,p,f),k=U(h),A=W(k,g,t,C),j=(0,D.jsx)(q,{conflicting:S,presentation:C,status:b,plain:p,compact:f,inert:m,kind:h,label:O,glyphClass:G(p,C)});if(m)return(0,D.jsx)(J,{kind:h,status:b,conflicting:S,chipClass:T,body:j});let M=K(u,_)?(0,D.jsx)(`span`,{"data-slot":L(h),"data-status":b,...R(S),"aria-label":C?`${k} ${O} — ${C.label}`:void 0,className:T,children:j}):(0,D.jsx)(ae,{to:u,url:_,"data-slot":L(h),"data-status":b,...R(S),title:E?void 0:_,"aria-label":A,className:p?T:r(T,ne[w]),children:j});return E?(0,D.jsx)(ce,{chip:M,action:S?a:void 0,state:y.state,children:(0,D.jsx)(Y,{kind:h,number:g,tooltip:E,url:_})}):M}function ae({to:e,url:t,children:r,...i}){return e?(0,D.jsx)(n,{to:e,...i,children:r}):(0,D.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,...i,children:r})}var X=(0,E.createContext)(()=>{});function oe(){return(0,E.useContext)(X)}var se=150,Z=120;function ce({chip:e,action:t,state:n,children:r}){let[i,a]=(0,E.useState)(!1),o=(0,E.useRef)(null),s=(0,E.useRef)(null),c=(0,E.useRef)(void 0),l=(0,E.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),p=(0,E.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,E.useEffect)(()=>()=>clearTimeout(c.current),[]);let m=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,D.jsxs)(f,{open:i,onOpenChange:e=>e?a(!0):p(),children:[(0,D.jsx)(u,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,se)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,Z)},onFocus:()=>a(!0),onBlur:e=>{m(e.relatedTarget)||p()},onKeyDown:e=>{if(e.key===`Escape`)return p();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,D.jsxs)(d,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),m(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,Z)},children:[(0,D.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,D.jsx)(X.Provider,{value:p,children:t}):null]})]})}function le(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${ue(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function ue(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Q({kind:e,number:t,className:n}){let i=N(e,t),a=s(i.status),c=e===`PR`&&i.conflicting===!0,l=c?o:a;if(!l)return null;let u=r(`size-2.5`,I[l.tone]);return(0,D.jsx)(`span`,{"data-slot":`reference-status-glyph`,"data-status":i.status,...c?{"data-conflicting":`true`}:{},"aria-hidden":`true`,className:r(`inline-flex items-center`,n),children:c?(0,D.jsx)(y,{className:r(`shrink-0`,u),"aria-hidden":`true`}):(0,D.jsx)($,{status:i.status,className:u})})}function $({status:e,className:t}){if(!e)return null;if(e===`checks-pending`)return(0,D.jsx)(x,{"data-slot":`status-dot`,"data-tone":`pending`,className:r(`size-3 animate-pulse motion-reduce:animate-none`,t),"aria-hidden":`true`});let n=re[e];return n?(0,D.jsx)(n,{className:r(`size-2.5 shrink-0`,t),"aria-hidden":`true`}):null}var de={general:[`Settings`,`General`],webhooks:[`Settings`,`General`,`Webhooks`],providers:[`Settings`,`Agents`,`Providers`],projects:[`Settings`,`Projects`],worktrees:[`Settings`,`Worktrees`],sidebar:[`Settings`,`Sidebar`]};function fe(e,t=` → `){return de[e].join(t)}export{j as a,P as c,oe as i,N as l,ie as n,k as o,Q as r,ee as s,fe as t,T as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,p as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Ln as o,Rn as s,Zt as c,it as l}from"./queries-DYfIpJ-d.js";import{n as u,r as d,t as f}from"./popover-DRcRI46x.js";import{F as p,I as m,N as h,P as g,U as _,_ as v,ct as y,g as b,h as x,m as S,p as C}from"./design-icons-DmYTv2r1.js";import{t as w}from"./createLucideIcon-BHp8sXmF.js";var T=w(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),E=e(i(),1),D=a(),O=(0,E.createContext)(null);function k({children:e}){let[t,n]=(0,E.useState)(()=>new Map),r=(0,E.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,E.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=l((0,E.useMemo)(()=>[...t.values()].flat(),[t])),o=(0,E.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,D.jsx)(O.Provider,{value:o,children:e})}var A=(0,E.createContext)(null);function j({projectId:e,repoBase:t,requests:n,children:r}){let i=(0,E.useContext)(O),a=(0,E.useContext)(A),o=(0,E.useId)();(0,E.useEffect)(()=>{if(i)return i.publish(o,n),()=>i.retract(o)},[i,o,n.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`)]);let s=l(i?M:n),c=i?.lookup??s,u=t??(a&&a.projectId===e?a.repoBase:void 0),d=(0,E.useMemo)(()=>({lookup:c,projectId:e,repoBase:u}),[c,e,u]);return(0,D.jsx)(A.Provider,{value:d,children:r})}var M=[];function N(e,t,n){let r=(0,E.useContext)(A),i=n??r?.projectId;return!r||!i||t===void 0?te:r.lookup({projectId:i,kind:e,number:t})}function ee(e,t){let n=(0,E.useContext)(A),r=t??n?.projectId;return!n||!r?[]:e.filter(e=>n.lookup({projectId:r,kind:`PR`,number:e}).conflicting===!0)}function P(){let e=(0,E.useContext)(A);return{projectId:e?.projectId,repoBase:e?.repoBase}}var te=Object.freeze({state:`idle`}),F={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,accent:`border-accent-strong/35 text-accent-text`,merged:`border-merged-strong/35 text-merged-text`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},I={success:`text-success`,danger:`text-danger`,accent:`text-merged-text`,merged:`text-merged-text`,info:`text-info`,neutral:`text-soft-foreground`,pending:`text-pending-strong`,conflict:`text-conflict`},ne={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,accent:`hover:bg-accent-strong/10`,merged:`hover:bg-merged-strong/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},re={draft:p,"review-required":m,"changes-requested":_,"checks-pending":null,"checks-failing":v,ready:C,merged:h,closed:g,open:S,completed:C,"not-planned":b};function L(e){return e===`PR`?`pr-chip`:`issue-chip`}function R(e){return e?{"data-conflicting":`true`}:{}}function z(e,t,n,r){return!n||r!==void 0&&c({kind:e,number:t??0,url:n},r)}function B(e,t,n){return e===`PR`&&(t??n)===!0}function V({plain:e,inert:t,conflicting:n,className:i,tone:a}){return e?r(`inline-flex items-center gap-1 rounded-[2px] text-inherit`,n&&`text-conflict font-medium`,!t&&`group/reference focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground`,i):r(`inline-flex h-[22px] items-center gap-1 rounded-md border px-1.5 font-mono text-[12px] font-normal`,F[a],i)}function H(e,t,n,r){return n&&!r?t?`${e===`PR`?`PR `:``}#${t}`:e:t?`${!r&&e===`Issue`?`Issue `:``}#${t}`:e}function U(e){return e===`PR`?`pull request`:`issue`}function W(e,t,n,r){return`Open the ${e}${t?` #${t}`:``} for ${n}${r?` — ${r.label}`:``}`}function G(e,t){return e&&t?I[t.tone]:void 0}function K(e,n){return!e&&(!n||!t(n))}function q({conflicting:e,presentation:t,status:n,plain:i,compact:a,inert:o,kind:s,label:c,glyphClass:l}){return(0,D.jsxs)(D.Fragment,{children:[e?(0,D.jsx)(y,{className:r(`size-2.5 shrink-0`,l),"aria-hidden":`true`}):(0,D.jsx)($,{status:t?n:void 0,className:i?r(`size-2.5`,l):void 0}),i&&a?s===`PR`?(0,D.jsx)(m,{"data-slot":`reference-kind`,className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,D.jsx)(S,{"data-slot":`reference-kind`,className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null,i?(0,D.jsx)(`span`,{className:o?void 0:`underline-offset-2 group-hover/reference:underline group-focus-visible/reference:underline`,children:c}):c]})}function J({kind:e,status:t,conflicting:n,chipClass:r,body:i}){return(0,D.jsx)(`span`,{"data-slot":L(e),"data-status":t,"data-inert":`true`,...R(n),className:r,children:i})}function Y({kind:e,number:n,tooltip:r,url:i}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`block font-medium`,children:[e===`PR`?`Pull request`:`Issue`,n?` #${n}`:``,` · `,r.headline]}),(0,D.jsx)(`span`,{className:`block`,children:r.detail}),r.also?(0,D.jsx)(`span`,{className:`block opacity-70`,children:r.also}):null,i&&t(i)?(0,D.jsx)(`span`,{className:`block opacity-70`,children:i.replace(/^https?:\/\//,``)}):null]})}function ie({reference:e,taskTitle:t,status:n,conflicting:i,conflictAction:a,projectId:c,repoBase:l,to:u,className:d,compact:f=!1,plain:p=!1,inert:m=!1}){let{kind:h,number:g,url:_}=e,v=P(),y=N(h,z(h,g,_,l??v.repoBase)?g:void 0,c),b=n??y.status,x=s(b),S=B(h,i,y.conflicting),C=S?o:x,w=C?.tone??`accent`,T=V({plain:p,inert:m,conflicting:S,className:d,tone:w}),E=le(y,C,S?x:void 0),O=H(h,g,p,f),k=U(h),A=W(k,g,t,C),j=(0,D.jsx)(q,{conflicting:S,presentation:C,status:b,plain:p,compact:f,inert:m,kind:h,label:O,glyphClass:G(p,C)});if(m)return(0,D.jsx)(J,{kind:h,status:b,conflicting:S,chipClass:T,body:j});let M=K(u,_)?(0,D.jsx)(`span`,{"data-slot":L(h),"data-status":b,...R(S),"aria-label":C?`${k} ${O} — ${C.label}`:void 0,className:T,children:j}):(0,D.jsx)(ae,{to:u,url:_,"data-slot":L(h),"data-status":b,...R(S),title:E?void 0:_,"aria-label":A,className:p?T:r(T,ne[w]),children:j});return E?(0,D.jsx)(ce,{chip:M,action:S?a:void 0,state:y.state,children:(0,D.jsx)(Y,{kind:h,number:g,tooltip:E,url:_})}):M}function ae({to:e,url:t,children:r,...i}){return e?(0,D.jsx)(n,{to:e,...i,children:r}):(0,D.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,...i,children:r})}var X=(0,E.createContext)(()=>{});function oe(){return(0,E.useContext)(X)}var se=150,Z=120;function ce({chip:e,action:t,state:n,children:r}){let[i,a]=(0,E.useState)(!1),o=(0,E.useRef)(null),s=(0,E.useRef)(null),c=(0,E.useRef)(void 0),l=(0,E.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),p=(0,E.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,E.useEffect)(()=>()=>clearTimeout(c.current),[]);let m=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,D.jsxs)(f,{open:i,onOpenChange:e=>e?a(!0):p(),children:[(0,D.jsx)(u,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,se)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,Z)},onFocus:()=>a(!0),onBlur:e=>{m(e.relatedTarget)||p()},onKeyDown:e=>{if(e.key===`Escape`)return p();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,D.jsxs)(d,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),m(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,Z)},children:[(0,D.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,D.jsx)(X.Provider,{value:p,children:t}):null]})]})}function le(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${ue(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function ue(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Q({kind:e,number:t,className:n}){let i=N(e,t),a=s(i.status),c=e===`PR`&&i.conflicting===!0,l=c?o:a;if(!l)return null;let u=r(`size-2.5`,I[l.tone]);return(0,D.jsx)(`span`,{"data-slot":`reference-status-glyph`,"data-status":i.status,...c?{"data-conflicting":`true`}:{},"aria-hidden":`true`,className:r(`inline-flex items-center`,n),children:c?(0,D.jsx)(y,{className:r(`shrink-0`,u),"aria-hidden":`true`}):(0,D.jsx)($,{status:i.status,className:u})})}function $({status:e,className:t}){if(!e)return null;if(e===`checks-pending`)return(0,D.jsx)(x,{"data-slot":`status-dot`,"data-tone":`pending`,className:r(`size-3 animate-pulse motion-reduce:animate-none`,t),"aria-hidden":`true`});let n=re[e];return n?(0,D.jsx)(n,{className:r(`size-2.5 shrink-0`,t),"aria-hidden":`true`}):null}var de={general:[`Settings`,`General`],webhooks:[`Settings`,`General`,`Webhooks`],providers:[`Settings`,`Agents`,`Providers`],projects:[`Settings`,`Projects`],worktrees:[`Settings`,`Worktrees`],sidebar:[`Settings`,`Sidebar`]};function fe(e,t=` → `){return de[e].join(t)}export{j as a,P as c,oe as i,N as l,ie as n,k as o,Q as r,ee as s,fe as t,T as u};
@@ -1 +1 @@
1
- import{t as e,u as t}from"./button-BEK7XKhS.js";import{t as n}from"./react-runtime-CCIEwYL0.js";import{j as r,v as i}from"./design-icons-DmYTv2r1.js";import{t as a}from"./createLucideIcon-BHp8sXmF.js";import{t as o}from"./eye-B8okNWXU.js";var s=a(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c=a(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),l=n();function u({mode:n,wrap:r,onModeChange:i,onWrapChange:a}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center gap-2`,children:[(0,l.jsx)(f,{current:n,value:`unified`,onModeChange:i}),(0,l.jsx)(f,{current:n,value:`split`,onModeChange:i})]}),(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":r,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:t(`size-11`,r&&`bg-muted text-foreground`),onClick:()=>a(!r),children:(0,l.jsx)(c,{"aria-hidden":`true`})})]})}function d({preview:n,onPreviewChange:r}){return(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":n,"aria-label":`Preview Markdown`,title:n?`Show Markdown as a diff`:`Preview Markdown`,className:t(`size-11`,n&&`bg-muted text-foreground`),onClick:()=>r(!n),children:(0,l.jsx)(o,{"aria-hidden":`true`})})}function f({current:e,value:n,onModeChange:r}){let a=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":a,onClick:()=>r(n),className:t(`inline-flex items-center gap-2 min-h-11 rounded-lg border border-border bg-card px-3 text-xs font-medium capitalize`,a?`border-accent-text/40 text-accent-text`:`text-muted-foreground hover:text-foreground`),children:[n===`unified`?(0,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function p({branch:e}){return(0,l.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,l.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{u as n,d as r,p as t};
1
+ import{t as e,u as t}from"./button-CHUAMTHK.js";import{t as n}from"./react-runtime-CCIEwYL0.js";import{j as r,v as i}from"./design-icons-DmYTv2r1.js";import{t as a}from"./createLucideIcon-BHp8sXmF.js";import{t as o}from"./eye-B8okNWXU.js";var s=a(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c=a(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),l=n();function u({mode:n,wrap:r,onModeChange:i,onWrapChange:a}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center gap-2`,children:[(0,l.jsx)(f,{current:n,value:`unified`,onModeChange:i}),(0,l.jsx)(f,{current:n,value:`split`,onModeChange:i})]}),(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":r,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:t(`size-11`,r&&`bg-muted text-foreground`),onClick:()=>a(!r),children:(0,l.jsx)(c,{"aria-hidden":`true`})})]})}function d({preview:n,onPreviewChange:r}){return(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":n,"aria-label":`Preview Markdown`,title:n?`Show Markdown as a diff`:`Preview Markdown`,className:t(`size-11`,n&&`bg-muted text-foreground`),onClick:()=>r(!n),children:(0,l.jsx)(o,{"aria-hidden":`true`})})}function f({current:e,value:n,onModeChange:r}){let a=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":a,onClick:()=>r(n),className:t(`inline-flex items-center gap-2 min-h-11 rounded-lg border border-border bg-card px-3 text-xs font-medium capitalize`,a?`border-accent-text/40 text-accent-text`:`text-muted-foreground hover:text-foreground`),children:[n===`unified`?(0,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function p({branch:e}){return(0,l.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,l.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{u as n,d as r,p as t};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-DiKAwVMH.js","assets/rolldown-runtime-QTnfLwEv.js","assets/button-BEK7XKhS.js","assets/react-runtime-CCIEwYL0.js","assets/bundle-mjs-BT31bpU6.js","assets/eye-B8okNWXU.js","assets/createLucideIcon-BHp8sXmF.js","assets/markdown-UdZ_toya.js","assets/alert-dialog-vFjLgfK4.js","assets/es2015-BO600Xfi.js","assets/chunk-BO2N2NFS-DE6qKn3r.js","assets/lib-BxQXEXDF.js","assets/index-xj-3O89_.js","assets/live-refetch-C-Ony2Yr.js","assets/project-scope-context-DMpvJqIm.js","assets/live-protocol-BDY7JJpT.js","assets/useInfiniteQuery-CQI4BO4C.js","assets/queries-BIOp8jLx.js","assets/useQuery-Bkq-x4Id.js","assets/ws-DspW9wBH.js","assets/toaster-pthKGWiE.js","assets/cez-idle-BT0U4GN_.js","assets/dropdown-menu-DYflHa4m.js","assets/design-icons-DmYTv2r1.js","assets/github-sidebar-model-czjLsgVJ.js","assets/popover-CpULuQSm.js","assets/textarea-FAUkHz1K.js","assets/project-router-CimAoN1H.js","assets/agent-accounts-6EuZhy-N.js","assets/skills-DFBiAuJG.js","assets/skills-workflows-C21NystW.css","assets/loader-circle-CZkGEdoI.js","assets/nav-row-styles-BE99gD3_.js","assets/control-locations-CexZsd3M.js","assets/centered-state-CPgI8cCO.js","assets/sortable.esm-zp_qkYGV.js","assets/index-B18AqW0Z.css","assets/image-preview-XPCPclpG.js","assets/zoomable-image-DNc6ORaF.js","assets/markdown-BBDDg-4t.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-BEK7XKhS.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{K as a}from"./index-xj-3O89_.js";import{n as o,t as s}from"./image-preview-XPCPclpG.js";var c=e(n(),1),l=r();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-DiKAwVMH.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:n=!1,imageSrc:r,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:t(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:n,imageSrc:r,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:n,imageSrc:r,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:r,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:t(`py-2 font-mono text-xs leading-[1.7]`,n?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-CNM3u77o.js","assets/rolldown-runtime-QTnfLwEv.js","assets/button-CHUAMTHK.js","assets/react-runtime-CCIEwYL0.js","assets/bundle-mjs-BT31bpU6.js","assets/eye-B8okNWXU.js","assets/createLucideIcon-BHp8sXmF.js","assets/markdown-D7DUNWcJ.js","assets/alert-dialog-Dj464rjk.js","assets/es2015-D345RR4o.js","assets/chunk-BO2N2NFS-DE6qKn3r.js","assets/lib-BxQXEXDF.js","assets/index-D489J7QW.js","assets/live-refetch-C0kQc3-z.js","assets/project-scope-context-CaUqlAd7.js","assets/live-protocol-BDY7JJpT.js","assets/useInfiniteQuery-qEY8OhKb.js","assets/queries-DYfIpJ-d.js","assets/useQuery-DOJQOEBO.js","assets/ws-DvGmrP4z.js","assets/toaster-B1MyeHiE.js","assets/cez-idle-BT0U4GN_.js","assets/dropdown-menu-DhrBcVgr.js","assets/design-icons-DmYTv2r1.js","assets/github-sidebar-model-Ct0DltOv.js","assets/popover-DRcRI46x.js","assets/textarea-DlVUfdWG.js","assets/project-router-1m_VlC22.js","assets/agent-accounts-BCg-578Q.js","assets/skills-DFBiAuJG.js","assets/skills-workflows-C21NystW.css","assets/loader-circle-CZkGEdoI.js","assets/nav-row-styles-BZUUavOF.js","assets/control-locations-CA9TMupq.js","assets/centered-state-DGyy0SuA.js","assets/sortable.esm-zp_qkYGV.js","assets/index-B18AqW0Z.css","assets/image-preview-Cq1vDiEo.js","assets/zoomable-image-5pOUaPEg.js","assets/markdown-BBDDg-4t.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{K as a}from"./index-D489J7QW.js";import{n as o,t as s}from"./image-preview-Cq1vDiEo.js";var c=e(n(),1),l=r();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-CNM3u77o.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:n=!1,imageSrc:r,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:t(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:n,imageSrc:r,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:n,imageSrc:r,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:r,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:t(`py-2 font-mono text-xs leading-[1.7]`,n?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
3
3
  `).map((e,n)=>(0,l.jsxs)(`span`,{className:t(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},n))})]})}export{u as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-BEK7XKhS.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{t as i}from"./eye-B8okNWXU.js";import{h as a,m as o,p as s,t as c}from"./markdown-UdZ_toya.js";import{K as l,X as u,Xt as d}from"./index-xj-3O89_.js";import{n as f,t as p}from"./image-preview-XPCPclpG.js";import{n as m,t as h}from"./markdown-BBDDg-4t.js";var g=e(n(),1),_=44;function v(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{t as i}from"./eye-B8okNWXU.js";import{h as a,m as o,p as s,t as c}from"./markdown-D7DUNWcJ.js";import{K as l,X as u,Xt as d}from"./index-D489J7QW.js";import{n as f,t as p}from"./image-preview-Cq1vDiEo.js";import{n as m,t as h}from"./markdown-BBDDg-4t.js";var g=e(n(),1),_=44;function v(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
2
2
  `),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function y(e){return v(e)*20+_}function b(e){return e.reduce((e,t)=>e+v(t),0)}function x(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function S(e){return`${e.oldPath??``}→${e.path}`}function C(e){let t=0;for(let n of e.split(`
3
3
  `))n.length>t&&(t=n.length);return t}var w=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,T=300,E=.3;function D(e,t){if(e===t)return null;let n=e.match(w)??[],r=t.match(w)??[];if(n.length===0||r.length===0||n.length>T||r.length>T)return null;let i=O(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<E?null:k(n,r,i)}function O(e,t){let n=t.length+1,r=new Uint16Array((e.length+1)*n);for(let i=1;i<=e.length;i++)for(let a=1;a<=t.length;a++)r[i*n+a]=e[i-1]===t[a-1]?(r[(i-1)*n+(a-1)]??0)+1:Math.max(r[(i-1)*n+a]??0,r[i*n+(a-1)]??0);return r}function k(e,t,n){let r=t.length+1,i=Array.from({length:e.length},()=>!1),a=Array.from({length:t.length},()=>!1),o=e.length,s=t.length;for(;o>0&&s>0;)e[o-1]===t[s-1]?(i[o-1]=!0,a[s-1]=!0,o--,s--):(n[(o-1)*r+s]??0)>=(n[o*r+(s-1)]??0)?o--:s--;return{del:A(e,i),add:A(t,a)}}function A(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function j(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var M=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,N=`… (patch truncated)`;function P(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
4
4
  `);o.at(-1)===``&&o.pop();for(let e of o){let o=M.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(N)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function F(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function I(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function L(e,t){let n=Array.from({length:e.length}),r=Array.from({length:t.length}),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=D(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function R(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(L(t,i))}else t(i),r++}}function z(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),R(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function B(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),R(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var V=r();function H({file:e,loadFileText:t,imageSrc:n}){let r=(0,g.useMemo)(()=>U(e),[e]),i=(0,g.useRef)(t);i.current=t;let a=(0,g.useRef)(n);a.current=n;let o=t!==void 0,[s,l]=(0,g.useState)(null);(0,g.useEffect)(()=>{let t=i.current;if(!t)return;let n=!1;return t(e.path).then(t=>!n&&l({path:e.path,text:t}),()=>!n&&l({path:e.path,text:null})),()=>{n=!0}},[e.path,e.patch,o]);let u=(0,g.useCallback)(t=>{let n=a.current,r=n?m(e.path,t):null;return r===null||!n?null:n(r)},[e.path]),d=s?.path===e.path?s:null;if(o&&d===null)return(0,V.jsx)(`p`,{role:`status`,className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Loading preview…`});let f=d?.text??null;if(f===null&&r.text===``)return(0,V.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes to preview.`});let p=f!==null||r.complete?null:o?`The full file could not be loaded. Showing the changed sections only.`:`Showing the changed sections only.`;return(0,V.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,V.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[p?(0,V.jsx)(`p`,{className:`mb-4 text-xs text-soft-foreground`,children:p}):null,(0,V.jsx)(c,{document:!0,imageSrc:u,children:f??r.text})]})})}function U(e){let t=P(e.patch);return{text:t.hunks.map(e=>e.lines.filter(e=>e.kind!==`del`).map(e=>e.text).join(`
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,l as n,s as r,u as i}from"./button-BEK7XKhS.js";import{i as a,r as o,t as s}from"./react-runtime-CCIEwYL0.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,t as x,u as S}from"./es2015-BO600Xfi.js";import{d as C,h as w,l as T}from"./design-icons-DmYTv2r1.js";var E=e(a(),1),D=s();function O(e){let n=e+`CollectionProvider`,[i,a]=g(n),[o,s]=i(n,{collectionRef:{current:null},itemMap:new Map}),c=e=>{let{scope:t,children:n}=e,r=E.useRef(null),i=E.useRef(new Map).current;return(0,D.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})};c.displayName=n;let l=e+`CollectionSlot`,u=t(l),d=E.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=r(t,s(l,n).collectionRef);return(0,D.jsx)(u,{ref:a,children:i})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=t(f),h=E.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=E.useRef(null),c=r(t,o),l=s(f,n);return E.useEffect(()=>(l.itemMap.set(o,{ref:o,...a}),()=>void l.itemMap.delete(o))),(0,D.jsx)(m,{[p]:``,ref:c,children:i})});h.displayName=f;function _(t){let n=s(e+`CollectionConsumer`,t);return E.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));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:c,Slot:d,ItemSlot:h},_,a]}var k=E.createContext(void 0);function A(e){let t=E.useContext(k);return e||t||`ltr`}var j=e(o(),1);function M(e){let[t,n]=E.useState(void 0);return d(()=>{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 N=[`top`,`right`,`bottom`,`left`],P=Math.min,F=Math.max,I=Math.round,L=Math.floor,R=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function z(e,t,n){return F(e,P(t,n))}function B(e,t){return typeof e==`function`?e(t):e}function V(e){return e.split(`-`)[0]}function H(e){return e.split(`-`)[1]}function te(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function U(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return te(U(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=H(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=H(e),a=de(V(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=V(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(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 _e(e,t,n){let{reference:r,floating:i}=e,a=U(t),o=re(t),s=ne(o),c=V(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=H(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(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}=B(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(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},y=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(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<ye&&(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}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=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}=B(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=P(d[_],T),D=P(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=z(E,k,O),j=!c.arrow&&H(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Se=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}=B(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=V(r),_=U(o),v=V(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ie(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==U(t))||T.every(e=>U(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.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=T.filter(e=>{if(x){let t=U(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 Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return N.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=B(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=V(n),s=H(n),c=U(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=B(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 Oe=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 De(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}}}}},ke=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}=B(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=U(i),p=te(f),m=u[p],h=u[f],g=(e,t)=>z(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}}}}}},Ae=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}=B(e,t),u={x:n,y:r},d=U(i),f=te(d),p=u[f],m=u[d],h=B(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=Ee.has(V(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}}}},je=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}=B(e,t),c=await i.detectOverflow(t,s),l=V(n),u=H(n),d=U(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=P(p-c[m],g),y=P(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*F(c.left,c.right):S=p-2*F(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof W(e).Node:!1}function K(e){return Me()?e instanceof Element||e instanceof W(e).Element:!1}function q(e){return Me()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,J=e=>!!e&&e!==`none`,Ve;function He(e){let t=K(e)?Y(e):e;return J(t.transform)||J(t.translate)||J(t.scale)||J(t.rotate)||J(t.perspective)||!We()&&(J(t.backdropFilter)||J(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=qe(e);for(;q(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=qe(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function Y(e){return W(e).getComputedStyle(e)}function Ke(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||G(e);return Fe(t)?t.host:t}function Je(e){let t=qe(e);return Ge(t)?(e.ownerDocument||e).body:q(t)&&Ie(t)?t:Je(t)}function Ye(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Je(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Xe(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Ye(e):[])}else return t.concat(r,Ye(r,[],n))}function Xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ze(e){let t=Y(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=q(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=I(n)!==a||I(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Qe(e){return K(e)?e:e.contextElement}function $e(e){let t=Qe(e);if(!q(t))return R(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ze(t),o=(a?I(n.width):n.width)/r,s=(a?I(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var et=R(0);function tt(e){let t=W(e);return!We()||!t.visualViewport?et:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===W(e)}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Qe(e),o=R(1);t&&(r?K(r)&&(o=$e(r)):o=$e(e));let s=nt(a,n,r)?tt(a):R(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=W(a),t=K(r)?W(r):r,n=e,i=Xe(n);for(;i&&t!==n;){let e=$e(i),t=i.getBoundingClientRect(),r=Y(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=W(i),i=Xe(n)}}return ge({width:u,height:d,x:c,y:l})}function it(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:rt(G(e)).left+n}function at(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-it(e,n),y:n.top+t.scrollTop}}function ot(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=G(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=R(1),u=R(0),d=q(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=rt(r);l=$e(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?at(o,c):R(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 st(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ct(e){let t=Ke(e),n=e.ownerDocument.body,r=F(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=F(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+it(e),o=-t.scrollTop;return Y(n).direction===`rtl`&&(a+=F(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var lt=25;function ut(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=W(e),a=G(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(it(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<=lt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function dt(e,t){let n=rt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=$e(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ft(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ut(e,n,t);else if(t===`document`)r=ct(G(e));else if(K(t))r=dt(t,n);else{let n=tt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function pt(e,t){let n=t.get(e);if(n)return n;let r=Ye(e,[],!1).filter(e=>K(e)&&Ne(e)!==`body`),i=null,a=Y(e).position===`fixed`,o=a?qe(e):e;for(;K(o)&&!Ge(o);){let e=Y(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=qe(o)}return t.set(e,r),r}function mt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:pt(t,this._c):[].concat(n),r],o=ft(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=ft(t,a[e],i);s=F(n.top,s),c=P(n.right,c),l=P(n.bottom,l),u=F(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ht(e){let{width:t,height:n}=Ze(e);return{width:t,height:n}}function gt(e,t,n){let r=q(t),i=G(t),a=n===`fixed`,o=rt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=R(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=rt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=it(i));let l=i&&!r&&!a?at(i,s):R(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 _t(e){return Y(e).position===`static`}function vt(e,t){if(!q(e)||Y(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function yt(e,t){let n=W(e);if(Re(e))return n;if(!q(e)){let t=qe(e);for(;t&&!Ge(t);){if(K(t)&&!_t(t))return t;t=qe(t)}return n}let r=vt(e,t);for(;r&&Le(r)&&_t(r);)r=vt(r,t);return r&&Ge(r)&&_t(r)&&!He(r)?n:r||Ue(e)||n}var bt=async function(e){let t=this.getOffsetParent||yt,n=this.getDimensions,r=await n(e.floating);return{reference:gt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xt(e){return Y(e).direction===`rtl`}var St={convertOffsetParentRelativeRectToViewportRelativeRect:ot,getDocumentElement:G,getClippingRect:mt,getOffsetParent:yt,getElementRects:bt,getClientRects:st,getDimensions:ht,getScale:$e,isElement:K,isRTL:xt};function Ct(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wt(e,t,n){let r=null,i,a=G(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:f,height:p}=l;if(n||t(),!f||!p)return;let m=L(d),h=L(a.clientWidth-(u+f)),g=L(a.clientHeight-(d+p)),_=L(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:F(0,P(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ct(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=W(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Tt(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=Qe(e),u=i||a?[...l?Ye(l):[],...t?Ye(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?wt(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?rt(e):null;c&&g();function g(){let t=rt(e);h&&!Ct(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 Et=Oe,Dt=ke,Ot=Se,kt=je,At=Te,jt=xe,Mt=Ae,Nt=(e,t,n)=>{let r=new Map,i=n??{},a={...St,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Pt=typeof document<`u`?E.useLayoutEffect:function(){};function Ft(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(!Ft(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)&&!Ft(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function It(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lt(e,t){let n=It(e);return Math.round(t*n)/n}function Rt(e){let t=E.useRef(e);return Pt(()=>{t.current=e}),t}function zt(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,[u,d]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);Ft(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),w=E.useRef(u),T=c!=null,D=Rt(c),O=Rt(i),k=Rt(l),A=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Nt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};M.current&&!Ft(w.current,t)&&(w.current=t,j.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Pt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=E.useRef(!1);Pt(()=>(M.current=!0,()=>{M.current=!1}),[]),Pt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,T]);let N=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=E.useMemo(()=>({reference:b,floating:x}),[b,x]),F=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Lt(P.floating,u.x),r=Lt(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...It(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:A,refs:N,elements:P,floatingStyles:F}),[u,A,N,P,F])}var Bt=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?{}:jt({element:r.current,padding:i}).fn(n):r?jt({element:r,padding:i}).fn(n):{}}}},Vt=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ht=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>({fn:Mt(e).fn,options:[e,t]}),Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=kt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=(e,t)=>{let n=At(e);return{name:n.name,fn:n.fn,options:[e,t]}},qt=(e,t)=>{let n=Bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jt=`Arrow`,Yt=E.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,D.jsx)(p.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,D.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Yt.displayName=Jt;var Xt=Yt,Zt=`Popper`,[Qt,$t]=g(Zt),[en,tn]=Qt(Zt),nn=e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null),[a,o]=E.useState(void 0);return(0,D.jsx)(en,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};nn.displayName=Zt;var rn=`PopperAnchor`,an=E.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:i,...a}=e,o=tn(rn,n),s=E.useRef(null),c=o.onAnchorChange,l=r(t,E.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=E.useRef(null);E.useEffect(()=>{if(!i)return;let e=u.current;u.current=i.current,e!==u.current&&c(u.current)});let d=o.placementState&&hn(o.placementState),f=d?.[0],m=d?.[1];return i?null:(0,D.jsx)(p.div,{"data-radix-popper-side":f,"data-radix-popper-align":m,...a,ref:l})});an.displayName=rn;var on=`PopperContent`,[sn,cn]=Qt(on),ln=E.forwardRef((e,t)=>{let{__scopePopper:n,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h=`partial`,hideWhenDetached:g=!1,updatePositionStrategy:_=`optimized`,onPlaced:v,...y}=e,b=tn(on,n),[x,S]=E.useState(null),C=r(t,S),[w,T]=E.useState(null),O=M(w),k=O?.width??0,A=O?.height??0,j=i+(o===`center`?``:`-`+o),N=typeof m==`number`?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(f)?f:[f],F=P.length>0,I={padding:N,boundary:P.filter(pn),altBoundary:F},{refs:L,floatingStyles:R,placement:ee,isPositioned:z,middlewareData:B}=zt({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>Tt(...e,{animationFrame:_===`always`}),elements:{reference:b.anchor},middleware:[Vt({mainAxis:a+A,alignmentAxis:s}),u&&Ht({mainAxis:!0,crossAxis:!1,limiter:h===`partial`?Ut():void 0,...I}),u&&Wt({...I}),Gt({...I,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`)}}),w&&qt({element:w,padding:c}),mn({arrowWidth:k,arrowHeight:A}),g&&Kt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),V=b.setPlacementState;d(()=>(V(ee),()=>{V(void 0)}),[ee,V]);let[H,te]=hn(ee),ne=l(v);d(()=>{z&&ne?.()},[z,ne]);let U=B.arrow?.x,re=B.arrow?.y,ie=B.arrow?.centerOffset!==0,[ae,oe]=E.useState();return d(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),(0,D.jsx)(`div`,{ref:L.setFloating,"data-radix-popper-content-wrapper":``,style:{...R,transform:z?R.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(` `),...B.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,D.jsx)(sn,{scope:n,placedSide:H,placedAlign:te,onArrowChange:T,arrowX:U,arrowY:re,shouldHideArrow:ie,children:(0,D.jsx)(p.div,{"data-side":H,"data-align":te,...y,ref:C,style:{...y.style,animation:z?void 0:`none`}})})})});ln.displayName=on;var un=`PopperArrow`,dn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},fn=E.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=cn(un,n),a=dn[i.placedSide];return(0,D.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,D.jsx)(Xt,{...r,ref:t,style:{...r.style,display:`block`}})})});fn.displayName=un;function pn(e){return e!==null}var mn=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]=hn(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 hn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var gn=nn,_n=an,vn=ln,yn=fn,bn=!1;function xn(){let[e,t]=E.useState(bn);return E.useEffect(()=>{bn||(bn=!0,t(!0))},[]),e}var Sn=E.useSyncExternalStore;function Cn(){return()=>{}}function wn(){return Sn(Cn,()=>!0,()=>!1)}var Tn=typeof Sn==`function`?wn:xn,En=`rovingFocusGroup.onEntryFocus`,Dn={bubbles:!1,cancelable:!0},On=`RovingFocusGroup`,[kn,An,jn]=O(On),[Mn,Nn]=g(On,[jn]),[Pn,Fn]=Mn(On),In=E.forwardRef((e,t)=>(0,D.jsx)(kn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(kn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Ln,{...e,ref:t})})}));In.displayName=On;var Ln=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,g=E.useRef(null),_=r(t,g),v=A(o),[b,x]=u({prop:s,defaultProp:c??null,onChange:d,caller:On}),[S,C]=E.useState(!1),w=l(f),T=An(n),O=E.useRef(!1),[k,j]=E.useState(0);return E.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(En,w),()=>e.removeEventListener(En,w)},[w]),(0,D.jsx)(Pn,{scope:n,orientation:i,dir:v,loop:a,currentTabStopId:b,onItemFocus:E.useCallback(e=>x(e),[x]),onItemShiftTab:E.useCallback(()=>C(!0),[]),onFocusableItemAdd:E.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:E.useCallback(()=>j(e=>e-1),[]),children:(0,D.jsx)(p.div,{tabIndex:S||k===0?-1:0,"data-orientation":i,...h,ref:_,style:{outline:`none`,...e.style},onMouseDown:y(e.onMouseDown,()=>{O.current=!0}),onFocus:y(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent(En,Dn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);Un([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),m)}}O.current=!1}),onBlur:y(e.onBlur,()=>C(!1))})})}),Rn=`RovingFocusGroupItem`,zn=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=h(),l=a||c,u=Fn(Rn,n),f=u.currentTabStopId===l,m=An(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=u,b=Tn();return d(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),E.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,D.jsx)(kn.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,D.jsx)(p.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Hn(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().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=u.loop?Wn(n,r+1):n.slice(r+1)}setTimeout(()=>Un(n))}}),children:typeof o==`function`?o({isCurrentTabStop:f,hasTabStop:v!=null}):o})})});zn.displayName=Rn;var Bn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Vn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Hn(e,t,n){let r=Vn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Bn[r]}function Un(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gn=In,Kn=zn,qn=[`Enter`,` `],Jn=[`ArrowDown`,`PageUp`,`Home`],Yn=[`ArrowUp`,`PageDown`,`End`],Xn=[...Jn,...Yn],Zn={ltr:[...qn,`ArrowRight`],rtl:[...qn,`ArrowLeft`]},Qn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},$n=`Menu`,[er,tr,nr]=O($n),[X,rr]=g($n,[nr,$t,Nn]),ir=$t(),ar=Nn(),[or,Z]=X($n),[sr,cr]=X($n),lr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ir(t),[c,u]=E.useState(null),d=E.useRef(!1),f=l(a),p=A(i);return E.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})}},[]),E.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,D.jsx)(gn,{...s,children:(0,D.jsx)(or,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:(0,D.jsx)(sr,{scope:t,onClose:E.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};lr.displayName=$n;var ur=`MenuAnchor`,dr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ir(n);return(0,D.jsx)(_n,{...i,...r,ref:t})});dr.displayName=ur;var fr=`MenuPortal`,[pr,mr]=X(fr,{forceMount:void 0}),hr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Z(fr,t);return(0,D.jsx)(pr,{scope:t,forceMount:n,children:(0,D.jsx)(S,{present:n||a.open,children:(0,D.jsx)(m,{asChild:!0,container:i,children:r})})})};hr.displayName=fr;var Q=`MenuContent`,[gr,_r]=X(Q),vr=E.forwardRef((e,t)=>{let n=mr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=cr(Q,e.__scopeMenu);return(0,D.jsx)(er.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(S,{present:r||a.open,children:(0,D.jsx)(er.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(yr,{...i,ref:t}):(0,D.jsx)(br,{...i,ref:t})})})})}),yr=E.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),i=E.useRef(null),a=r(t,i);return E.useEffect(()=>{let e=i.current;if(e)return x(e)},[]),(0,D.jsx)(Sr,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),br=E.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,D.jsx)(Sr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),xr=t(`MenuContent.ScrollLock`),Sr=E.forwardRef((e,t)=>{let{__scopeMenu:n,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,...x}=e,S=Z(Q,n),C=cr(Q,n),w=ir(n),T=ar(n),O=tr(n),[k,A]=E.useState(null),j=E.useRef(null),M=r(t,j,S.onContentChange),N=E.useRef(0),P=E.useRef(``),F=E.useRef(0),I=E.useRef(null),L=E.useRef(`right`),R=E.useRef(0),ee=g?_:E.Fragment,z=g?{as:xr,allowPinchZoom:!0}:void 0,B=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=oi(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};E.useEffect(()=>()=>window.clearTimeout(N.current),[]),b();let V=E.useCallback(e=>L.current===I.current?.side&&ci(e,I.current?.area),[]);return(0,D.jsx)(gr,{scope:n,searchRef:P,onItemEnter:E.useCallback(e=>{V(e)&&e.preventDefault()},[V]),onItemLeave:E.useCallback(e=>{V(e)||(j.current?.focus(),A(null))},[V]),onTriggerLeave:E.useCallback(e=>{V(e)&&e.preventDefault()},[V]),pointerGraceTimerRef:F,onPointerGraceIntentChange:E.useCallback(e=>{I.current=e},[]),children:(0,D.jsx)(ee,{...z,children:(0,D.jsx)(c,{asChild:!0,trapped:a,onMountAutoFocus:y(o,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,D.jsx)(v,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,D.jsx)(Gn,{asChild:!0,...T,dir:C.dir,orientation:`vertical`,loop:i,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:y(u,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(vn,{role:`menu`,"aria-orientation":`vertical`,"data-state":ti(S.open),"data-radix-menu-content":``,dir:C.dir,...w,...x,ref:M,style:{outline:`none`,...x.style},onKeyDown:y(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&&B(e.key));let i=j.current;if(e.target!==i||!Xn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);Yn.includes(e.key)&&a.reverse(),ii(a)}),onBlur:y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:y(e.onPointerMove,li(e=>{let t=e.target,n=R.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>R.current?`right`:`left`;L.current=t,R.current=e.clientX}}))})})})})})})});vr.displayName=Q;var Cr=`MenuGroup`,wr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(p.div,{role:`group`,...r,ref:t})});wr.displayName=Cr;var Tr=`MenuLabel`,Er=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(p.div,{...r,ref:t})});Er.displayName=Tr;var Dr=`MenuItem`,Or=`menu.itemSelect`,kr=E.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:i,...a}=e,o=E.useRef(null),s=cr(Dr,e.__scopeMenu),c=_r(Dr,e.__scopeMenu),l=r(t,o),u=E.useRef(!1),d=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(Or,{bubbles:!0,cancelable:!0});e.addEventListener(Or,e=>i?.(e),{once:!0}),f(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,D.jsx)(Ar,{...a,ref:l,disabled:n,onClick:y(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:y(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:y(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||qn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});kr.displayName=Dr;var Ar=E.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:i=!1,textValue:a,...o}=e,s=_r(Dr,n),c=ar(n),l=E.useRef(null),u=r(t,l),[d,f]=E.useState(!1),[m,h]=E.useState(``);return E.useEffect(()=>{let e=l.current;e&&h((e.textContent??``).trim())},[o.children]),(0,D.jsx)(er.ItemSlot,{scope:n,disabled:i,textValue:a??m,children:(0,D.jsx)(Kn,{asChild:!0,...c,focusable:!i,children:(0,D.jsx)(p.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:u,onPointerMove:y(e.onPointerMove,li(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:y(e.onPointerLeave,li(e=>s.onItemLeave(e))),onFocus:y(e.onFocus,()=>f(!0)),onBlur:y(e.onBlur,()=>f(!1))})})})}),jr=`MenuCheckboxItem`,Mr=E.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,D.jsx)(Br,{scope:e.__scopeMenu,checked:n,children:(0,D.jsx)(kr,{role:`menuitemcheckbox`,"aria-checked":ni(n)?`mixed`:n,...i,ref:t,"data-state":ri(n),onSelect:y(i.onSelect,()=>r?.(ni(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Mr.displayName=jr;var Nr=`MenuRadioGroup`,[Pr,Fr]=X(Nr,{value:void 0,onValueChange:()=>{}}),Ir=E.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=l(r);return(0,D.jsx)(Pr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,D.jsx)(wr,{...i,ref:t})})});Ir.displayName=Nr;var Lr=`MenuRadioItem`,Rr=E.forwardRef((e,t)=>{let{value:n,...r}=e,i=Fr(Lr,e.__scopeMenu),a=n===i.value;return(0,D.jsx)(Br,{scope:e.__scopeMenu,checked:a,children:(0,D.jsx)(kr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ri(a),onSelect:y(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Rr.displayName=Lr;var zr=`MenuItemIndicator`,[Br,Vr]=X(zr,{checked:!1}),Hr=E.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Vr(zr,n);return(0,D.jsx)(S,{present:r||ni(a.checked)||a.checked===!0,children:(0,D.jsx)(p.span,{...i,ref:t,"data-state":ri(a.checked)})})});Hr.displayName=zr;var Ur=`MenuSeparator`,Wr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(p.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuArrow`,Kr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ir(n);return(0,D.jsx)(yn,{...i,...r,ref:t})});Kr.displayName=Gr;var qr=`MenuSub`,[Jr,Yr]=X(qr),Xr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(qr,t),o=ir(t),[s,c]=E.useState(null),[u,d]=E.useState(null),f=l(i);return E.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),(0,D.jsx)(gn,{...o,children:(0,D.jsx)(or,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:(0,D.jsx)(Jr,{scope:t,contentId:h(),triggerId:h(),trigger:s,onTriggerChange:c,children:n})})})};Xr.displayName=qr;var Zr=`MenuSubTrigger`,Qr=E.forwardRef((e,t)=>{let n=Z(Zr,e.__scopeMenu),i=cr(Zr,e.__scopeMenu),a=Yr(Zr,e.__scopeMenu),o=_r(Zr,e.__scopeMenu),s=E.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=E.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);E.useEffect(()=>d,[d]),E.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=r(t,a.onTriggerChange);return(0,D.jsx)(dr,{asChild:!0,...u,children:(0,D.jsx)(Ar,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":ti(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:y(e.onPointerMove,li(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:y(e.onPointerLeave,li(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:y(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||Zn[i.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Qr.displayName=Zr;var $r=`MenuSubContent`,ei=E.forwardRef((e,t)=>{let n=mr(Q,e.__scopeMenu),{forceMount:i=n.forceMount,align:a=`start`,...o}=e,s=Z(Q,e.__scopeMenu),c=cr(Q,e.__scopeMenu),l=Yr($r,e.__scopeMenu),u=E.useRef(null),d=r(t,u);return(0,D.jsx)(er.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(S,{present:i||s.open,children:(0,D.jsx)(er.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(Sr,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:a,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:y(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:y(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:y(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Qn[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});ei.displayName=$r;function ti(e){return e?`open`:`closed`}function ni(e){return e===`indeterminate`}function ri(e){return ni(e)?`indeterminate`:e?`checked`:`unchecked`}function ii(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ai(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function oi(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=ai(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 si(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 ci(e,t){return t?si({x:e.clientX,y:e.clientY},t):!1}function li(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ui=lr,di=dr,fi=hr,pi=vr,mi=wr,hi=Er,gi=kr,_i=Mr,vi=Ir,yi=Rr,bi=Hr,xi=Wr,Si=Kr,Ci=Xr,wi=Qr,Ti=ei,Ei=`DropdownMenu`,[Di,Oi]=g(Ei,[rr]),$=rr(),[ki,Ai]=Di(Ei),ji=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=E.useRef(null),[d,f]=u({prop:i,defaultProp:a??!1,onChange:o,caller:Ei});return(0,D.jsx)(ki,{scope:t,triggerId:h(),triggerRef:l,contentId:h(),open:d,onOpenChange:f,onOpenToggle:E.useCallback(()=>f(e=>!e),[f]),modal:s,children:(0,D.jsx)(ui,{...c,open:d,onOpenChange:f,dir:r,modal:s,children:n})})};ji.displayName=Ei;var Mi=`DropdownMenuTrigger`,Ni=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:i=!1,...a}=e,o=Ai(Mi,n),s=$(n),c=r(t,o.triggerRef);return(0,D.jsx)(di,{asChild:!0,...s,children:(0,D.jsx)(p.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:y(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:y(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ni.displayName=Mi;var Pi=`DropdownMenuPortal`,Fi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,D.jsx)(fi,{...r,...n})};Fi.displayName=Pi;var Ii=`DropdownMenuContent`,Li=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ai(Ii,n),a=$(n),o=E.useRef(!1);return(0,D.jsx)(pi,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:y(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:y(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Li.displayName=Ii;var Ri=`DropdownMenuGroup`,zi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(mi,{...i,...r,ref:t})});zi.displayName=Ri;var Bi=`DropdownMenuLabel`,Vi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(hi,{...i,...r,ref:t})});Vi.displayName=Bi;var Hi=`DropdownMenuItem`,Ui=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(gi,{...i,...r,ref:t})});Ui.displayName=Hi;var Wi=`DropdownMenuCheckboxItem`,Gi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(_i,{...i,...r,ref:t})});Gi.displayName=Wi;var Ki=`DropdownMenuRadioGroup`,qi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(vi,{...i,...r,ref:t})});qi.displayName=Ki;var Ji=`DropdownMenuRadioItem`,Yi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(yi,{...i,...r,ref:t})});Yi.displayName=Ji;var Xi=`DropdownMenuItemIndicator`,Zi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(bi,{...i,...r,ref:t})});Zi.displayName=Xi;var Qi=`DropdownMenuSeparator`,$i=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(xi,{...i,...r,ref:t})});$i.displayName=Qi;var ea=`DropdownMenuArrow`,ta=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(Si,{...i,...r,ref:t})});ta.displayName=ea;var na=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$(t),[s,c]=u({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,D.jsx)(Ci,{...o,open:s,onOpenChange:c,children:n})},ra=`DropdownMenuSubTrigger`,ia=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(wi,{...i,...r,ref:t})});ia.displayName=ra;var aa=`DropdownMenuSubContent`,oa=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(Ti,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});oa.displayName=aa;var sa=ji,ca=Ni,la=Fi,ua=Li,da=Vi,fa=Ui,pa=Gi,ma=qi,ha=Yi,ga=Zi,_a=$i,va=na,ya=ia,ba=oa;function xa({...e}){return(0,D.jsx)(sa,{"data-slot":`dropdown-menu`,...e})}function Sa({...e}){return(0,D.jsx)(la,{"data-slot":`dropdown-menu-portal`,...e})}function Ca({...e}){return(0,D.jsx)(ca,{"data-slot":`dropdown-menu-trigger`,...e})}function wa({className:e,sideOffset:t=4,...n}){return(0,D.jsx)(la,{children:(0,D.jsx)(ua,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:i(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...n})})}function Ta({className:e,inset:t,variant:n=`default`,...r}){return(0,D.jsx)(fa,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Ea({className:e,children:t,checked:r,...a}){return(0,D.jsxs)(pa,{"data-slot":`dropdown-menu-checkbox-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n({checked:r}),...a,children:[(0,D.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(ga,{children:(0,D.jsx)(T,{className:`size-4`})})}),t]})}function Da({...e}){return(0,D.jsx)(ma,{"data-slot":`dropdown-menu-radio-group`,...e})}function Oa({className:e,children:t,...n}){return(0,D.jsxs)(ha,{"data-slot":`dropdown-menu-radio-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,D.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(ga,{children:(0,D.jsx)(w,{className:`size-2 fill-current`})})}),t]})}function ka({className:e,inset:t,...n}){return(0,D.jsx)(da,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:i(`px-2 py-1.5 text-sm font-medium data-[inset]:ps-8`,e),...n})}function Aa({className:e,...t}){return(0,D.jsx)(_a,{"data-slot":`dropdown-menu-separator`,className:i(`-mx-1 my-1 h-px bg-border`,e),...t})}function ja({...e}){return(0,D.jsx)(va,{"data-slot":`dropdown-menu-sub`,...e})}function Ma({className:e,inset:t,children:n,...r}){return(0,D.jsxs)(ya,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:i(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:ps-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,D.jsx)(C,{className:`ms-auto size-4`})]})}function Na({className:e,...t}){return(0,D.jsx)(ba,{"data-slot":`dropdown-menu-sub-content`,className:i(`z-50 min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...t})}export{A as C,M as S,_n as _,ka as a,gn as b,Oa as c,Na as d,Ma as f,Nn as g,Gn as h,Ta as i,Aa as l,Kn as m,Ea as n,Sa as o,Ca as p,wa as r,Da as s,xa as t,ja as u,yn as v,O as w,$t as x,vn as y};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,l as n,s as r,u as i}from"./button-CHUAMTHK.js";import{i as a,r as o,t as s}from"./react-runtime-CCIEwYL0.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,t as x,u as S}from"./es2015-D345RR4o.js";import{d as C,h as w,l as T}from"./design-icons-DmYTv2r1.js";var E=e(a(),1),D=s();function O(e){let n=e+`CollectionProvider`,[i,a]=g(n),[o,s]=i(n,{collectionRef:{current:null},itemMap:new Map}),c=e=>{let{scope:t,children:n}=e,r=E.useRef(null),i=E.useRef(new Map).current;return(0,D.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})};c.displayName=n;let l=e+`CollectionSlot`,u=t(l),d=E.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=r(t,s(l,n).collectionRef);return(0,D.jsx)(u,{ref:a,children:i})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=t(f),h=E.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=E.useRef(null),c=r(t,o),l=s(f,n);return E.useEffect(()=>(l.itemMap.set(o,{ref:o,...a}),()=>void l.itemMap.delete(o))),(0,D.jsx)(m,{[p]:``,ref:c,children:i})});h.displayName=f;function _(t){let n=s(e+`CollectionConsumer`,t);return E.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));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:c,Slot:d,ItemSlot:h},_,a]}var k=E.createContext(void 0);function A(e){let t=E.useContext(k);return e||t||`ltr`}var j=e(o(),1);function M(e){let[t,n]=E.useState(void 0);return d(()=>{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 N=[`top`,`right`,`bottom`,`left`],P=Math.min,F=Math.max,I=Math.round,L=Math.floor,R=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function z(e,t,n){return F(e,P(t,n))}function B(e,t){return typeof e==`function`?e(t):e}function V(e){return e.split(`-`)[0]}function H(e){return e.split(`-`)[1]}function te(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function U(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return te(U(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=H(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=H(e),a=de(V(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=V(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(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 _e(e,t,n){let{reference:r,floating:i}=e,a=U(t),o=re(t),s=ne(o),c=V(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=H(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(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}=B(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(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},y=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(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<ye&&(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}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=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}=B(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=P(d[_],T),D=P(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=z(E,k,O),j=!c.arrow&&H(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Se=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}=B(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=V(r),_=U(o),v=V(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ie(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==U(t))||T.every(e=>U(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.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=T.filter(e=>{if(x){let t=U(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 Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return N.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=B(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=V(n),s=H(n),c=U(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=B(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 Oe=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 De(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}}}}},ke=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}=B(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=U(i),p=te(f),m=u[p],h=u[f],g=(e,t)=>z(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}}}}}},Ae=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}=B(e,t),u={x:n,y:r},d=U(i),f=te(d),p=u[f],m=u[d],h=B(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=Ee.has(V(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}}}},je=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}=B(e,t),c=await i.detectOverflow(t,s),l=V(n),u=H(n),d=U(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=P(p-c[m],g),y=P(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*F(c.left,c.right):S=p-2*F(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof W(e).Node:!1}function K(e){return Me()?e instanceof Element||e instanceof W(e).Element:!1}function q(e){return Me()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,J=e=>!!e&&e!==`none`,Ve;function He(e){let t=K(e)?Y(e):e;return J(t.transform)||J(t.translate)||J(t.scale)||J(t.rotate)||J(t.perspective)||!We()&&(J(t.backdropFilter)||J(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=qe(e);for(;q(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=qe(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function Y(e){return W(e).getComputedStyle(e)}function Ke(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||G(e);return Fe(t)?t.host:t}function Je(e){let t=qe(e);return Ge(t)?(e.ownerDocument||e).body:q(t)&&Ie(t)?t:Je(t)}function Ye(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Je(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Xe(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Ye(e):[])}else return t.concat(r,Ye(r,[],n))}function Xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ze(e){let t=Y(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=q(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=I(n)!==a||I(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Qe(e){return K(e)?e:e.contextElement}function $e(e){let t=Qe(e);if(!q(t))return R(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ze(t),o=(a?I(n.width):n.width)/r,s=(a?I(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var et=R(0);function tt(e){let t=W(e);return!We()||!t.visualViewport?et:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===W(e)}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Qe(e),o=R(1);t&&(r?K(r)&&(o=$e(r)):o=$e(e));let s=nt(a,n,r)?tt(a):R(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=W(a),t=K(r)?W(r):r,n=e,i=Xe(n);for(;i&&t!==n;){let e=$e(i),t=i.getBoundingClientRect(),r=Y(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=W(i),i=Xe(n)}}return ge({width:u,height:d,x:c,y:l})}function it(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:rt(G(e)).left+n}function at(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-it(e,n),y:n.top+t.scrollTop}}function ot(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=G(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=R(1),u=R(0),d=q(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=rt(r);l=$e(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?at(o,c):R(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 st(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ct(e){let t=Ke(e),n=e.ownerDocument.body,r=F(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=F(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+it(e),o=-t.scrollTop;return Y(n).direction===`rtl`&&(a+=F(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var lt=25;function ut(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=W(e),a=G(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(it(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<=lt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function dt(e,t){let n=rt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=$e(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ft(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ut(e,n,t);else if(t===`document`)r=ct(G(e));else if(K(t))r=dt(t,n);else{let n=tt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function pt(e,t){let n=t.get(e);if(n)return n;let r=Ye(e,[],!1).filter(e=>K(e)&&Ne(e)!==`body`),i=null,a=Y(e).position===`fixed`,o=a?qe(e):e;for(;K(o)&&!Ge(o);){let e=Y(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=qe(o)}return t.set(e,r),r}function mt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:pt(t,this._c):[].concat(n),r],o=ft(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=ft(t,a[e],i);s=F(n.top,s),c=P(n.right,c),l=P(n.bottom,l),u=F(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ht(e){let{width:t,height:n}=Ze(e);return{width:t,height:n}}function gt(e,t,n){let r=q(t),i=G(t),a=n===`fixed`,o=rt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=R(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=rt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=it(i));let l=i&&!r&&!a?at(i,s):R(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 _t(e){return Y(e).position===`static`}function vt(e,t){if(!q(e)||Y(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function yt(e,t){let n=W(e);if(Re(e))return n;if(!q(e)){let t=qe(e);for(;t&&!Ge(t);){if(K(t)&&!_t(t))return t;t=qe(t)}return n}let r=vt(e,t);for(;r&&Le(r)&&_t(r);)r=vt(r,t);return r&&Ge(r)&&_t(r)&&!He(r)?n:r||Ue(e)||n}var bt=async function(e){let t=this.getOffsetParent||yt,n=this.getDimensions,r=await n(e.floating);return{reference:gt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xt(e){return Y(e).direction===`rtl`}var St={convertOffsetParentRelativeRectToViewportRelativeRect:ot,getDocumentElement:G,getClippingRect:mt,getOffsetParent:yt,getElementRects:bt,getClientRects:st,getDimensions:ht,getScale:$e,isElement:K,isRTL:xt};function Ct(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wt(e,t,n){let r=null,i,a=G(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:f,height:p}=l;if(n||t(),!f||!p)return;let m=L(d),h=L(a.clientWidth-(u+f)),g=L(a.clientHeight-(d+p)),_=L(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:F(0,P(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ct(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=W(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Tt(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=Qe(e),u=i||a?[...l?Ye(l):[],...t?Ye(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?wt(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?rt(e):null;c&&g();function g(){let t=rt(e);h&&!Ct(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 Et=Oe,Dt=ke,Ot=Se,kt=je,At=Te,jt=xe,Mt=Ae,Nt=(e,t,n)=>{let r=new Map,i=n??{},a={...St,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Pt=typeof document<`u`?E.useLayoutEffect:function(){};function Ft(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(!Ft(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)&&!Ft(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function It(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lt(e,t){let n=It(e);return Math.round(t*n)/n}function Rt(e){let t=E.useRef(e);return Pt(()=>{t.current=e}),t}function zt(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,[u,d]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);Ft(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),w=E.useRef(u),T=c!=null,D=Rt(c),O=Rt(i),k=Rt(l),A=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Nt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};M.current&&!Ft(w.current,t)&&(w.current=t,j.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Pt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=E.useRef(!1);Pt(()=>(M.current=!0,()=>{M.current=!1}),[]),Pt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,T]);let N=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=E.useMemo(()=>({reference:b,floating:x}),[b,x]),F=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Lt(P.floating,u.x),r=Lt(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...It(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:A,refs:N,elements:P,floatingStyles:F}),[u,A,N,P,F])}var Bt=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?{}:jt({element:r.current,padding:i}).fn(n):r?jt({element:r,padding:i}).fn(n):{}}}},Vt=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ht=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>({fn:Mt(e).fn,options:[e,t]}),Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=kt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=(e,t)=>{let n=At(e);return{name:n.name,fn:n.fn,options:[e,t]}},qt=(e,t)=>{let n=Bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jt=`Arrow`,Yt=E.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,D.jsx)(p.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,D.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Yt.displayName=Jt;var Xt=Yt,Zt=`Popper`,[Qt,$t]=g(Zt),[en,tn]=Qt(Zt),nn=e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null),[a,o]=E.useState(void 0);return(0,D.jsx)(en,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};nn.displayName=Zt;var rn=`PopperAnchor`,an=E.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:i,...a}=e,o=tn(rn,n),s=E.useRef(null),c=o.onAnchorChange,l=r(t,E.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=E.useRef(null);E.useEffect(()=>{if(!i)return;let e=u.current;u.current=i.current,e!==u.current&&c(u.current)});let d=o.placementState&&hn(o.placementState),f=d?.[0],m=d?.[1];return i?null:(0,D.jsx)(p.div,{"data-radix-popper-side":f,"data-radix-popper-align":m,...a,ref:l})});an.displayName=rn;var on=`PopperContent`,[sn,cn]=Qt(on),ln=E.forwardRef((e,t)=>{let{__scopePopper:n,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h=`partial`,hideWhenDetached:g=!1,updatePositionStrategy:_=`optimized`,onPlaced:v,...y}=e,b=tn(on,n),[x,S]=E.useState(null),C=r(t,S),[w,T]=E.useState(null),O=M(w),k=O?.width??0,A=O?.height??0,j=i+(o===`center`?``:`-`+o),N=typeof m==`number`?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(f)?f:[f],F=P.length>0,I={padding:N,boundary:P.filter(pn),altBoundary:F},{refs:L,floatingStyles:R,placement:ee,isPositioned:z,middlewareData:B}=zt({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>Tt(...e,{animationFrame:_===`always`}),elements:{reference:b.anchor},middleware:[Vt({mainAxis:a+A,alignmentAxis:s}),u&&Ht({mainAxis:!0,crossAxis:!1,limiter:h===`partial`?Ut():void 0,...I}),u&&Wt({...I}),Gt({...I,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`)}}),w&&qt({element:w,padding:c}),mn({arrowWidth:k,arrowHeight:A}),g&&Kt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),V=b.setPlacementState;d(()=>(V(ee),()=>{V(void 0)}),[ee,V]);let[H,te]=hn(ee),ne=l(v);d(()=>{z&&ne?.()},[z,ne]);let U=B.arrow?.x,re=B.arrow?.y,ie=B.arrow?.centerOffset!==0,[ae,oe]=E.useState();return d(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),(0,D.jsx)(`div`,{ref:L.setFloating,"data-radix-popper-content-wrapper":``,style:{...R,transform:z?R.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(` `),...B.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,D.jsx)(sn,{scope:n,placedSide:H,placedAlign:te,onArrowChange:T,arrowX:U,arrowY:re,shouldHideArrow:ie,children:(0,D.jsx)(p.div,{"data-side":H,"data-align":te,...y,ref:C,style:{...y.style,animation:z?void 0:`none`}})})})});ln.displayName=on;var un=`PopperArrow`,dn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},fn=E.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=cn(un,n),a=dn[i.placedSide];return(0,D.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,D.jsx)(Xt,{...r,ref:t,style:{...r.style,display:`block`}})})});fn.displayName=un;function pn(e){return e!==null}var mn=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]=hn(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 hn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var gn=nn,_n=an,vn=ln,yn=fn,bn=!1;function xn(){let[e,t]=E.useState(bn);return E.useEffect(()=>{bn||(bn=!0,t(!0))},[]),e}var Sn=E.useSyncExternalStore;function Cn(){return()=>{}}function wn(){return Sn(Cn,()=>!0,()=>!1)}var Tn=typeof Sn==`function`?wn:xn,En=`rovingFocusGroup.onEntryFocus`,Dn={bubbles:!1,cancelable:!0},On=`RovingFocusGroup`,[kn,An,jn]=O(On),[Mn,Nn]=g(On,[jn]),[Pn,Fn]=Mn(On),In=E.forwardRef((e,t)=>(0,D.jsx)(kn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(kn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Ln,{...e,ref:t})})}));In.displayName=On;var Ln=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,g=E.useRef(null),_=r(t,g),v=A(o),[b,x]=u({prop:s,defaultProp:c??null,onChange:d,caller:On}),[S,C]=E.useState(!1),w=l(f),T=An(n),O=E.useRef(!1),[k,j]=E.useState(0);return E.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(En,w),()=>e.removeEventListener(En,w)},[w]),(0,D.jsx)(Pn,{scope:n,orientation:i,dir:v,loop:a,currentTabStopId:b,onItemFocus:E.useCallback(e=>x(e),[x]),onItemShiftTab:E.useCallback(()=>C(!0),[]),onFocusableItemAdd:E.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:E.useCallback(()=>j(e=>e-1),[]),children:(0,D.jsx)(p.div,{tabIndex:S||k===0?-1:0,"data-orientation":i,...h,ref:_,style:{outline:`none`,...e.style},onMouseDown:y(e.onMouseDown,()=>{O.current=!0}),onFocus:y(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent(En,Dn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);Un([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),m)}}O.current=!1}),onBlur:y(e.onBlur,()=>C(!1))})})}),Rn=`RovingFocusGroupItem`,zn=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=h(),l=a||c,u=Fn(Rn,n),f=u.currentTabStopId===l,m=An(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=u,b=Tn();return d(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),E.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,D.jsx)(kn.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,D.jsx)(p.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Hn(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().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=u.loop?Wn(n,r+1):n.slice(r+1)}setTimeout(()=>Un(n))}}),children:typeof o==`function`?o({isCurrentTabStop:f,hasTabStop:v!=null}):o})})});zn.displayName=Rn;var Bn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Vn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Hn(e,t,n){let r=Vn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Bn[r]}function Un(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gn=In,Kn=zn,qn=[`Enter`,` `],Jn=[`ArrowDown`,`PageUp`,`Home`],Yn=[`ArrowUp`,`PageDown`,`End`],Xn=[...Jn,...Yn],Zn={ltr:[...qn,`ArrowRight`],rtl:[...qn,`ArrowLeft`]},Qn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},$n=`Menu`,[er,tr,nr]=O($n),[X,rr]=g($n,[nr,$t,Nn]),ir=$t(),ar=Nn(),[or,Z]=X($n),[sr,cr]=X($n),lr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ir(t),[c,u]=E.useState(null),d=E.useRef(!1),f=l(a),p=A(i);return E.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})}},[]),E.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,D.jsx)(gn,{...s,children:(0,D.jsx)(or,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:(0,D.jsx)(sr,{scope:t,onClose:E.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};lr.displayName=$n;var ur=`MenuAnchor`,dr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ir(n);return(0,D.jsx)(_n,{...i,...r,ref:t})});dr.displayName=ur;var fr=`MenuPortal`,[pr,mr]=X(fr,{forceMount:void 0}),hr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Z(fr,t);return(0,D.jsx)(pr,{scope:t,forceMount:n,children:(0,D.jsx)(S,{present:n||a.open,children:(0,D.jsx)(m,{asChild:!0,container:i,children:r})})})};hr.displayName=fr;var Q=`MenuContent`,[gr,_r]=X(Q),vr=E.forwardRef((e,t)=>{let n=mr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=cr(Q,e.__scopeMenu);return(0,D.jsx)(er.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(S,{present:r||a.open,children:(0,D.jsx)(er.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(yr,{...i,ref:t}):(0,D.jsx)(br,{...i,ref:t})})})})}),yr=E.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),i=E.useRef(null),a=r(t,i);return E.useEffect(()=>{let e=i.current;if(e)return x(e)},[]),(0,D.jsx)(Sr,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),br=E.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,D.jsx)(Sr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),xr=t(`MenuContent.ScrollLock`),Sr=E.forwardRef((e,t)=>{let{__scopeMenu:n,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,...x}=e,S=Z(Q,n),C=cr(Q,n),w=ir(n),T=ar(n),O=tr(n),[k,A]=E.useState(null),j=E.useRef(null),M=r(t,j,S.onContentChange),N=E.useRef(0),P=E.useRef(``),F=E.useRef(0),I=E.useRef(null),L=E.useRef(`right`),R=E.useRef(0),ee=g?_:E.Fragment,z=g?{as:xr,allowPinchZoom:!0}:void 0,B=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=oi(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};E.useEffect(()=>()=>window.clearTimeout(N.current),[]),b();let V=E.useCallback(e=>L.current===I.current?.side&&ci(e,I.current?.area),[]);return(0,D.jsx)(gr,{scope:n,searchRef:P,onItemEnter:E.useCallback(e=>{V(e)&&e.preventDefault()},[V]),onItemLeave:E.useCallback(e=>{V(e)||(j.current?.focus(),A(null))},[V]),onTriggerLeave:E.useCallback(e=>{V(e)&&e.preventDefault()},[V]),pointerGraceTimerRef:F,onPointerGraceIntentChange:E.useCallback(e=>{I.current=e},[]),children:(0,D.jsx)(ee,{...z,children:(0,D.jsx)(c,{asChild:!0,trapped:a,onMountAutoFocus:y(o,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,D.jsx)(v,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,D.jsx)(Gn,{asChild:!0,...T,dir:C.dir,orientation:`vertical`,loop:i,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:y(u,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(vn,{role:`menu`,"aria-orientation":`vertical`,"data-state":ti(S.open),"data-radix-menu-content":``,dir:C.dir,...w,...x,ref:M,style:{outline:`none`,...x.style},onKeyDown:y(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&&B(e.key));let i=j.current;if(e.target!==i||!Xn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);Yn.includes(e.key)&&a.reverse(),ii(a)}),onBlur:y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:y(e.onPointerMove,li(e=>{let t=e.target,n=R.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>R.current?`right`:`left`;L.current=t,R.current=e.clientX}}))})})})})})})});vr.displayName=Q;var Cr=`MenuGroup`,wr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(p.div,{role:`group`,...r,ref:t})});wr.displayName=Cr;var Tr=`MenuLabel`,Er=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(p.div,{...r,ref:t})});Er.displayName=Tr;var Dr=`MenuItem`,Or=`menu.itemSelect`,kr=E.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:i,...a}=e,o=E.useRef(null),s=cr(Dr,e.__scopeMenu),c=_r(Dr,e.__scopeMenu),l=r(t,o),u=E.useRef(!1),d=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(Or,{bubbles:!0,cancelable:!0});e.addEventListener(Or,e=>i?.(e),{once:!0}),f(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,D.jsx)(Ar,{...a,ref:l,disabled:n,onClick:y(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:y(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:y(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||qn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});kr.displayName=Dr;var Ar=E.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:i=!1,textValue:a,...o}=e,s=_r(Dr,n),c=ar(n),l=E.useRef(null),u=r(t,l),[d,f]=E.useState(!1),[m,h]=E.useState(``);return E.useEffect(()=>{let e=l.current;e&&h((e.textContent??``).trim())},[o.children]),(0,D.jsx)(er.ItemSlot,{scope:n,disabled:i,textValue:a??m,children:(0,D.jsx)(Kn,{asChild:!0,...c,focusable:!i,children:(0,D.jsx)(p.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:u,onPointerMove:y(e.onPointerMove,li(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:y(e.onPointerLeave,li(e=>s.onItemLeave(e))),onFocus:y(e.onFocus,()=>f(!0)),onBlur:y(e.onBlur,()=>f(!1))})})})}),jr=`MenuCheckboxItem`,Mr=E.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,D.jsx)(Br,{scope:e.__scopeMenu,checked:n,children:(0,D.jsx)(kr,{role:`menuitemcheckbox`,"aria-checked":ni(n)?`mixed`:n,...i,ref:t,"data-state":ri(n),onSelect:y(i.onSelect,()=>r?.(ni(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Mr.displayName=jr;var Nr=`MenuRadioGroup`,[Pr,Fr]=X(Nr,{value:void 0,onValueChange:()=>{}}),Ir=E.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=l(r);return(0,D.jsx)(Pr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,D.jsx)(wr,{...i,ref:t})})});Ir.displayName=Nr;var Lr=`MenuRadioItem`,Rr=E.forwardRef((e,t)=>{let{value:n,...r}=e,i=Fr(Lr,e.__scopeMenu),a=n===i.value;return(0,D.jsx)(Br,{scope:e.__scopeMenu,checked:a,children:(0,D.jsx)(kr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ri(a),onSelect:y(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Rr.displayName=Lr;var zr=`MenuItemIndicator`,[Br,Vr]=X(zr,{checked:!1}),Hr=E.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Vr(zr,n);return(0,D.jsx)(S,{present:r||ni(a.checked)||a.checked===!0,children:(0,D.jsx)(p.span,{...i,ref:t,"data-state":ri(a.checked)})})});Hr.displayName=zr;var Ur=`MenuSeparator`,Wr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(p.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuArrow`,Kr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ir(n);return(0,D.jsx)(yn,{...i,...r,ref:t})});Kr.displayName=Gr;var qr=`MenuSub`,[Jr,Yr]=X(qr),Xr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(qr,t),o=ir(t),[s,c]=E.useState(null),[u,d]=E.useState(null),f=l(i);return E.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),(0,D.jsx)(gn,{...o,children:(0,D.jsx)(or,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:(0,D.jsx)(Jr,{scope:t,contentId:h(),triggerId:h(),trigger:s,onTriggerChange:c,children:n})})})};Xr.displayName=qr;var Zr=`MenuSubTrigger`,Qr=E.forwardRef((e,t)=>{let n=Z(Zr,e.__scopeMenu),i=cr(Zr,e.__scopeMenu),a=Yr(Zr,e.__scopeMenu),o=_r(Zr,e.__scopeMenu),s=E.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=E.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);E.useEffect(()=>d,[d]),E.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=r(t,a.onTriggerChange);return(0,D.jsx)(dr,{asChild:!0,...u,children:(0,D.jsx)(Ar,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":ti(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:y(e.onPointerMove,li(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:y(e.onPointerLeave,li(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:y(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||Zn[i.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Qr.displayName=Zr;var $r=`MenuSubContent`,ei=E.forwardRef((e,t)=>{let n=mr(Q,e.__scopeMenu),{forceMount:i=n.forceMount,align:a=`start`,...o}=e,s=Z(Q,e.__scopeMenu),c=cr(Q,e.__scopeMenu),l=Yr($r,e.__scopeMenu),u=E.useRef(null),d=r(t,u);return(0,D.jsx)(er.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(S,{present:i||s.open,children:(0,D.jsx)(er.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(Sr,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:a,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:y(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:y(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:y(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Qn[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});ei.displayName=$r;function ti(e){return e?`open`:`closed`}function ni(e){return e===`indeterminate`}function ri(e){return ni(e)?`indeterminate`:e?`checked`:`unchecked`}function ii(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ai(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function oi(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=ai(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 si(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 ci(e,t){return t?si({x:e.clientX,y:e.clientY},t):!1}function li(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ui=lr,di=dr,fi=hr,pi=vr,mi=wr,hi=Er,gi=kr,_i=Mr,vi=Ir,yi=Rr,bi=Hr,xi=Wr,Si=Kr,Ci=Xr,wi=Qr,Ti=ei,Ei=`DropdownMenu`,[Di,Oi]=g(Ei,[rr]),$=rr(),[ki,Ai]=Di(Ei),ji=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=E.useRef(null),[d,f]=u({prop:i,defaultProp:a??!1,onChange:o,caller:Ei});return(0,D.jsx)(ki,{scope:t,triggerId:h(),triggerRef:l,contentId:h(),open:d,onOpenChange:f,onOpenToggle:E.useCallback(()=>f(e=>!e),[f]),modal:s,children:(0,D.jsx)(ui,{...c,open:d,onOpenChange:f,dir:r,modal:s,children:n})})};ji.displayName=Ei;var Mi=`DropdownMenuTrigger`,Ni=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:i=!1,...a}=e,o=Ai(Mi,n),s=$(n),c=r(t,o.triggerRef);return(0,D.jsx)(di,{asChild:!0,...s,children:(0,D.jsx)(p.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:y(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:y(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ni.displayName=Mi;var Pi=`DropdownMenuPortal`,Fi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,D.jsx)(fi,{...r,...n})};Fi.displayName=Pi;var Ii=`DropdownMenuContent`,Li=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ai(Ii,n),a=$(n),o=E.useRef(!1);return(0,D.jsx)(pi,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:y(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:y(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Li.displayName=Ii;var Ri=`DropdownMenuGroup`,zi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(mi,{...i,...r,ref:t})});zi.displayName=Ri;var Bi=`DropdownMenuLabel`,Vi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(hi,{...i,...r,ref:t})});Vi.displayName=Bi;var Hi=`DropdownMenuItem`,Ui=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(gi,{...i,...r,ref:t})});Ui.displayName=Hi;var Wi=`DropdownMenuCheckboxItem`,Gi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(_i,{...i,...r,ref:t})});Gi.displayName=Wi;var Ki=`DropdownMenuRadioGroup`,qi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(vi,{...i,...r,ref:t})});qi.displayName=Ki;var Ji=`DropdownMenuRadioItem`,Yi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(yi,{...i,...r,ref:t})});Yi.displayName=Ji;var Xi=`DropdownMenuItemIndicator`,Zi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(bi,{...i,...r,ref:t})});Zi.displayName=Xi;var Qi=`DropdownMenuSeparator`,$i=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(xi,{...i,...r,ref:t})});$i.displayName=Qi;var ea=`DropdownMenuArrow`,ta=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(Si,{...i,...r,ref:t})});ta.displayName=ea;var na=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$(t),[s,c]=u({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,D.jsx)(Ci,{...o,open:s,onOpenChange:c,children:n})},ra=`DropdownMenuSubTrigger`,ia=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(wi,{...i,...r,ref:t})});ia.displayName=ra;var aa=`DropdownMenuSubContent`,oa=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(Ti,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});oa.displayName=aa;var sa=ji,ca=Ni,la=Fi,ua=Li,da=Vi,fa=Ui,pa=Gi,ma=qi,ha=Yi,ga=Zi,_a=$i,va=na,ya=ia,ba=oa;function xa({...e}){return(0,D.jsx)(sa,{"data-slot":`dropdown-menu`,...e})}function Sa({...e}){return(0,D.jsx)(la,{"data-slot":`dropdown-menu-portal`,...e})}function Ca({...e}){return(0,D.jsx)(ca,{"data-slot":`dropdown-menu-trigger`,...e})}function wa({className:e,sideOffset:t=4,...n}){return(0,D.jsx)(la,{children:(0,D.jsx)(ua,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:i(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...n})})}function Ta({className:e,inset:t,variant:n=`default`,...r}){return(0,D.jsx)(fa,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Ea({className:e,children:t,checked:r,...a}){return(0,D.jsxs)(pa,{"data-slot":`dropdown-menu-checkbox-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n({checked:r}),...a,children:[(0,D.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(ga,{children:(0,D.jsx)(T,{className:`size-4`})})}),t]})}function Da({...e}){return(0,D.jsx)(ma,{"data-slot":`dropdown-menu-radio-group`,...e})}function Oa({className:e,children:t,...n}){return(0,D.jsxs)(ha,{"data-slot":`dropdown-menu-radio-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,D.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(ga,{children:(0,D.jsx)(w,{className:`size-2 fill-current`})})}),t]})}function ka({className:e,inset:t,...n}){return(0,D.jsx)(da,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:i(`px-2 py-1.5 text-sm font-medium data-[inset]:ps-8`,e),...n})}function Aa({className:e,...t}){return(0,D.jsx)(_a,{"data-slot":`dropdown-menu-separator`,className:i(`-mx-1 my-1 h-px bg-border`,e),...t})}function ja({...e}){return(0,D.jsx)(va,{"data-slot":`dropdown-menu-sub`,...e})}function Ma({className:e,inset:t,children:n,...r}){return(0,D.jsxs)(ya,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:i(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:ps-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,D.jsx)(C,{className:`ms-auto size-4`})]})}function Na({className:e,...t}){return(0,D.jsx)(ba,{"data-slot":`dropdown-menu-sub-content`,className:i(`z-50 min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...t})}export{A as C,M as S,_n as _,ka as a,gn as b,Oa as c,Na as d,Ma as f,Nn as g,Gn as h,Ta as i,Aa as l,Kn as m,Ea as n,Sa as o,Ca as p,wa as r,Da as s,xa as t,ja as u,yn as v,O as w,$t as x,vn as y};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,s as n}from"./button-BEK7XKhS.js";import{i as r,r as i,t as a}from"./react-runtime-CCIEwYL0.js";var o=e(r(),1),s=e(i(),1),c=a(),l=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=t(`Primitive.${n}`),i=o.forwardRef((e,t)=>{let{asChild:i,...a}=e,o=i?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:t})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function u(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}function d(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,l=n?.[e]?.[a]||i,u=o.useMemo(()=>s,Object.values(s));return(0,c.jsx)(l.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function l(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,l]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.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 o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var m=globalThis?.document?o.useLayoutEffect:()=>{},h=o.useInsertionEffect||m;function g({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=_({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`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=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=v(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function _({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return h(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function v(e){return typeof e==`function`}function y(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var b=e=>{let{present:t,children:n}=e,r=x(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=C(r.ref,ee(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};b.displayName=`Presence`;function x(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=y(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??w(r.current),s.current=void 0):a.current=`none`},[c]),m(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=w(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),m(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=w(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=w(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(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=w(t)}else r.current=null;n(e)},[])}}function S(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function C(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=S(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():S(n[e],null)}}},[])}function w(e){return e?.animationName||`none`}function ee(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 T=o.useId||(()=>void 0),E=0;function te(e){let[t,n]=o.useState(T());return m(()=>{e||n(e=>e??String(E++))},[e]),e||(t?`radix-${t}`:``)}function D(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}var ne=`DismissableLayer`,O=`dismissableLayer.update`,k=`dismissableLayer.pointerDownOutside`,A=`dismissableLayer.focusOutside`,re,j=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ie=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...m}=e,h=o.useContext(j),[g,_]=o.useState(null),v=g?.ownerDocument??globalThis?.document,[,y]=o.useState({}),b=n(t,_),x=Array.from(h.layers),[S]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S?x.indexOf(S):-1,w=g?x.indexOf(g):-1,ee=h.layersWithOutsidePointerEventsDisabled.size>0,T=w>=C,E=o.useRef(!1),te=le(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...h.branches].some(t=>t.contains(e));return T&&!t},[h.branches,T])}),ne=ue(e=>{if(i&&E.current)return;let t=e.target;[...h.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},v),k=g?w===x.length-1:!1,A=D(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return o.useEffect(()=>{if(k)return v.addEventListener(`keydown`,A,{capture:!0}),()=>v.removeEventListener(`keydown`,A,{capture:!0})},[v,k,A]),o.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(re=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),de(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=re))}},[g,v,r,h]),o.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),de())},[g,h]),o.useEffect(()=>{let e=()=>y({});return document.addEventListener(O,e),()=>document.removeEventListener(O,e)},[]),(0,c.jsx)(l.div,{...m,ref:b,style:{pointerEvents:ee?T?`auto`:`none`:void 0,...e.style},onFocusCapture:p(e.onFocusCapture,ne.onFocusCapture),onBlurCapture:p(e.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:p(e.onPointerDownCapture,te.onPointerDownCapture)})});ie.displayName=ne;var ae=`DismissableLayerBranch`,oe=o.forwardRef((e,t)=>{let r=o.useContext(j),i=o.useRef(null),a=n(t,i);return o.useEffect(()=>{let e=i.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,c.jsx)(l.div,{...e,ref:a})});oe.displayName=ae;function se(){let e=o.useContext(j),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ce=()=>!0;function le(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=ce}=t,c=D(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function o(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 o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||fe(k,c,p,{discrete:!0})};if(!s(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?o():(n.removeEventListener(`click`,f.current),f.current=o,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,o,!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,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:()=>l.current=!0}}function ue(e,t=globalThis?.document){let n=D(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&fe(A,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 de(){let e=new CustomEvent(O);document.dispatchEvent(e)}function fe(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?u(i,a):i.dispatchEvent(a)}var M=`focusScope.autoFocusOnMount`,N=`focusScope.autoFocusOnUnmount`,pe={bubbles:!1,cancelable:!0},me=`FocusScope`,he=o.forwardRef((e,t)=>{let{loop:r=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...u}=e,[d,f]=o.useState(null),p=D(a),m=D(s),h=o.useRef(null),g=n(t,f),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(i){let e=function(e){if(_.paused||!d)return;let t=e.target;d.contains(t)?h.current=t:P(h.current,{select:!0})},t=function(e){if(_.paused||!d)return;let t=e.relatedTarget;t!==null&&(d.contains(t)||P(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&P(d)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return d&&r.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[i,d,_.paused]),o.useEffect(()=>{if(d){Se.add(_);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(M,pe);d.addEventListener(M,p),d.dispatchEvent(t),t.defaultPrevented||(ge(Te(ve(d)),{select:!0}),document.activeElement===e&&P(d))}return()=>{d.removeEventListener(M,p),setTimeout(()=>{let t=new CustomEvent(N,pe);d.addEventListener(N,m),d.dispatchEvent(t),t.defaultPrevented||P(e??document.body,{select:!0}),d.removeEventListener(N,m),Se.remove(_)},0)}}},[d,p,m,_]);let v=o.useCallback(e=>{if(!r&&!i||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[i,a]=_e(t);i&&a?!e.shiftKey&&n===a?(e.preventDefault(),r&&P(i,{select:!0})):e.shiftKey&&n===i&&(e.preventDefault(),r&&P(a,{select:!0})):n===t&&e.preventDefault()}},[r,i,_.paused]);return(0,c.jsx)(l.div,{tabIndex:-1,...u,ref:g,onKeyDown:v})});he.displayName=me;function ge(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(P(r,{select:t}),document.activeElement!==n)return}function _e(e){let t=ve(e);return[ye(t,e),ye(t.reverse(),e)]}function ve(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 ye(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):be(r,{upTo:t})))return r}function be(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 xe(e){return e instanceof HTMLInputElement&&`select`in e}function P(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xe(e)&&t&&e.select()}}var Se=Ce();function Ce(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=we(e,t),e.unshift(t)},remove(t){e=we(e,t),e[0]?.resume()}}}function we(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Te(e){return e.filter(e=>e.tagName!==`A`)}var Ee=`Portal`,De=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);m(()=>a(!0),[]);let u=n||i&&globalThis?.document?.body;return u?s.createPortal((0,c.jsx)(l.div,{...r,ref:t}),u):null});De.displayName=Ee;var F=0,I=null;function Oe(){o.useEffect(()=>{I||={start:ke(),end:ke()};let{start:e,end:t}=I;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),F++,()=>{F===1&&(I?.start.remove(),I?.end.remove(),I=null),F=Math.max(0,F-1)}},[])}function ke(){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 L=function(){return L=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},L.apply(this,arguments)};function Ae(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 je(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 R=`right-scroll-bar-position`,z=`width-before-scroll-bar`,Me=`with-scroll-bars-hidden`,Ne=`--removed-body-scroll-bar-size`;function B(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pe(e,t){var n=(0,o.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 Fe=typeof window<`u`?o.useLayoutEffect:o.useEffect,Ie=new WeakMap;function Le(e,t){var n=Pe(t||null,function(t){return e.forEach(function(e){return B(e,t)})});return Fe(function(){var t=Ie.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||B(e,null)}),i.forEach(function(e){r.has(e)||B(e,a)})}Ie.set(n,e)},[e]),n}function Re(e){return e}function ze(e,t){t===void 0&&(t=Re);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 Be(e){e===void 0&&(e={});var t=ze(null);return t.options=L({async:!0,ssr:!1},e),t}var Ve=function(e){var t=e.sideCar,n=Ae(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 o.createElement(r,L({},n))};Ve.isSideCarExport=!0;function He(e,t){return e.useMedium(t),Ve}var Ue=Be(),V=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:V,onWheelCapture:V,onTouchMoveCapture:V}),i=r[0],a=r[1],s=e.forwardProps,c=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,x=Ae(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Le([n,t]),w=L(L({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Ue,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),L(L({},w),{ref:C})):o.createElement(y,L({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:z,zeroRight:R};var We,Ge=function(){if(We)return We;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ke(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ge();return t&&e.setAttribute(`nonce`,t),e}function qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Je(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ye=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ke())&&(qe(t,n),Je(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xe=function(){var e=Ye();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ze=function(){var e=Xe();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Qe={left:0,top:0,right:0,gap:0},U=function(e){return parseInt(e||``,10)||0},$e=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[U(n),U(r),U(i)]},et=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Qe;var t=$e(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])}},tt=Ze(),W=`data-scroll-locked`,nt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,s as n}from"./button-CHUAMTHK.js";import{i as r,r as i,t as a}from"./react-runtime-CCIEwYL0.js";var o=e(r(),1),s=e(i(),1),c=a(),l=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=t(`Primitive.${n}`),i=o.forwardRef((e,t)=>{let{asChild:i,...a}=e,o=i?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:t})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function u(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}function d(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,l=n?.[e]?.[a]||i,u=o.useMemo(()=>s,Object.values(s));return(0,c.jsx)(l.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function l(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,l]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.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 o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var m=globalThis?.document?o.useLayoutEffect:()=>{},h=o.useInsertionEffect||m;function g({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=_({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`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=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=v(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function _({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return h(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function v(e){return typeof e==`function`}function y(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var b=e=>{let{present:t,children:n}=e,r=x(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=C(r.ref,ee(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};b.displayName=`Presence`;function x(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=y(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??w(r.current),s.current=void 0):a.current=`none`},[c]),m(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=w(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),m(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=w(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=w(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(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=w(t)}else r.current=null;n(e)},[])}}function S(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function C(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=S(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():S(n[e],null)}}},[])}function w(e){return e?.animationName||`none`}function ee(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 T=o.useId||(()=>void 0),E=0;function te(e){let[t,n]=o.useState(T());return m(()=>{e||n(e=>e??String(E++))},[e]),e||(t?`radix-${t}`:``)}function D(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}var ne=`DismissableLayer`,O=`dismissableLayer.update`,k=`dismissableLayer.pointerDownOutside`,A=`dismissableLayer.focusOutside`,re,j=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ie=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...m}=e,h=o.useContext(j),[g,_]=o.useState(null),v=g?.ownerDocument??globalThis?.document,[,y]=o.useState({}),b=n(t,_),x=Array.from(h.layers),[S]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S?x.indexOf(S):-1,w=g?x.indexOf(g):-1,ee=h.layersWithOutsidePointerEventsDisabled.size>0,T=w>=C,E=o.useRef(!1),te=le(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...h.branches].some(t=>t.contains(e));return T&&!t},[h.branches,T])}),ne=ue(e=>{if(i&&E.current)return;let t=e.target;[...h.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},v),k=g?w===x.length-1:!1,A=D(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return o.useEffect(()=>{if(k)return v.addEventListener(`keydown`,A,{capture:!0}),()=>v.removeEventListener(`keydown`,A,{capture:!0})},[v,k,A]),o.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(re=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),de(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=re))}},[g,v,r,h]),o.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),de())},[g,h]),o.useEffect(()=>{let e=()=>y({});return document.addEventListener(O,e),()=>document.removeEventListener(O,e)},[]),(0,c.jsx)(l.div,{...m,ref:b,style:{pointerEvents:ee?T?`auto`:`none`:void 0,...e.style},onFocusCapture:p(e.onFocusCapture,ne.onFocusCapture),onBlurCapture:p(e.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:p(e.onPointerDownCapture,te.onPointerDownCapture)})});ie.displayName=ne;var ae=`DismissableLayerBranch`,oe=o.forwardRef((e,t)=>{let r=o.useContext(j),i=o.useRef(null),a=n(t,i);return o.useEffect(()=>{let e=i.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,c.jsx)(l.div,{...e,ref:a})});oe.displayName=ae;function se(){let e=o.useContext(j),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ce=()=>!0;function le(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=ce}=t,c=D(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function o(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 o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||fe(k,c,p,{discrete:!0})};if(!s(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?o():(n.removeEventListener(`click`,f.current),f.current=o,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,o,!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,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:()=>l.current=!0}}function ue(e,t=globalThis?.document){let n=D(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&fe(A,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 de(){let e=new CustomEvent(O);document.dispatchEvent(e)}function fe(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?u(i,a):i.dispatchEvent(a)}var M=`focusScope.autoFocusOnMount`,N=`focusScope.autoFocusOnUnmount`,pe={bubbles:!1,cancelable:!0},me=`FocusScope`,he=o.forwardRef((e,t)=>{let{loop:r=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...u}=e,[d,f]=o.useState(null),p=D(a),m=D(s),h=o.useRef(null),g=n(t,f),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(i){let e=function(e){if(_.paused||!d)return;let t=e.target;d.contains(t)?h.current=t:P(h.current,{select:!0})},t=function(e){if(_.paused||!d)return;let t=e.relatedTarget;t!==null&&(d.contains(t)||P(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&P(d)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return d&&r.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[i,d,_.paused]),o.useEffect(()=>{if(d){Se.add(_);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(M,pe);d.addEventListener(M,p),d.dispatchEvent(t),t.defaultPrevented||(ge(Te(ve(d)),{select:!0}),document.activeElement===e&&P(d))}return()=>{d.removeEventListener(M,p),setTimeout(()=>{let t=new CustomEvent(N,pe);d.addEventListener(N,m),d.dispatchEvent(t),t.defaultPrevented||P(e??document.body,{select:!0}),d.removeEventListener(N,m),Se.remove(_)},0)}}},[d,p,m,_]);let v=o.useCallback(e=>{if(!r&&!i||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[i,a]=_e(t);i&&a?!e.shiftKey&&n===a?(e.preventDefault(),r&&P(i,{select:!0})):e.shiftKey&&n===i&&(e.preventDefault(),r&&P(a,{select:!0})):n===t&&e.preventDefault()}},[r,i,_.paused]);return(0,c.jsx)(l.div,{tabIndex:-1,...u,ref:g,onKeyDown:v})});he.displayName=me;function ge(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(P(r,{select:t}),document.activeElement!==n)return}function _e(e){let t=ve(e);return[ye(t,e),ye(t.reverse(),e)]}function ve(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 ye(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):be(r,{upTo:t})))return r}function be(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 xe(e){return e instanceof HTMLInputElement&&`select`in e}function P(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xe(e)&&t&&e.select()}}var Se=Ce();function Ce(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=we(e,t),e.unshift(t)},remove(t){e=we(e,t),e[0]?.resume()}}}function we(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Te(e){return e.filter(e=>e.tagName!==`A`)}var Ee=`Portal`,De=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);m(()=>a(!0),[]);let u=n||i&&globalThis?.document?.body;return u?s.createPortal((0,c.jsx)(l.div,{...r,ref:t}),u):null});De.displayName=Ee;var F=0,I=null;function Oe(){o.useEffect(()=>{I||={start:ke(),end:ke()};let{start:e,end:t}=I;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),F++,()=>{F===1&&(I?.start.remove(),I?.end.remove(),I=null),F=Math.max(0,F-1)}},[])}function ke(){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 L=function(){return L=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},L.apply(this,arguments)};function Ae(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 je(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 R=`right-scroll-bar-position`,z=`width-before-scroll-bar`,Me=`with-scroll-bars-hidden`,Ne=`--removed-body-scroll-bar-size`;function B(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pe(e,t){var n=(0,o.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 Fe=typeof window<`u`?o.useLayoutEffect:o.useEffect,Ie=new WeakMap;function Le(e,t){var n=Pe(t||null,function(t){return e.forEach(function(e){return B(e,t)})});return Fe(function(){var t=Ie.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||B(e,null)}),i.forEach(function(e){r.has(e)||B(e,a)})}Ie.set(n,e)},[e]),n}function Re(e){return e}function ze(e,t){t===void 0&&(t=Re);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 Be(e){e===void 0&&(e={});var t=ze(null);return t.options=L({async:!0,ssr:!1},e),t}var Ve=function(e){var t=e.sideCar,n=Ae(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 o.createElement(r,L({},n))};Ve.isSideCarExport=!0;function He(e,t){return e.useMedium(t),Ve}var Ue=Be(),V=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:V,onWheelCapture:V,onTouchMoveCapture:V}),i=r[0],a=r[1],s=e.forwardProps,c=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,x=Ae(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Le([n,t]),w=L(L({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Ue,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),L(L({},w),{ref:C})):o.createElement(y,L({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:z,zeroRight:R};var We,Ge=function(){if(We)return We;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ke(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ge();return t&&e.setAttribute(`nonce`,t),e}function qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Je(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ye=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ke())&&(qe(t,n),Je(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xe=function(){var e=Ye();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ze=function(){var e=Xe();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Qe={left:0,top:0,right:0,gap:0},U=function(e){return parseInt(e||``,10)||0},$e=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[U(n),U(r),U(i)]},et=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Qe;var t=$e(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])}},tt=Ze(),W=`data-scroll-locked`,nt=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
2
  .${Me} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,u as n,w as r}from"./button-BEK7XKhS.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,vn as s}from"./project-scope-context-DMpvJqIm.js";import{xt as c}from"./queries-BIOp8jLx.js";import{T as l,ct as u}from"./design-icons-DmYTv2r1.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{t as f}from"./centered-state-CPgI8cCO.js";import{a as p,c as m,d as h,h as g,l as _,m as v,n as y,o as b,p as x,s as S,t as C,u as w}from"./markdown-UdZ_toya.js";var T=d(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=d(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=e(i(),1),k=a(),A=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function j(e){let t=A.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var M={};function N(e){let t=(0,O.useMemo)(()=>w(e),[e]).join(` `),[n,r]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return h(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:M}function P({html:e,title:t,fragment:r,className:i}){let a=N(e);return a?(0,k.jsx)(F,{html:e,title:t,fragment:r,className:i,libraries:a}):(0,k.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:n(`flex min-h-0 flex-col`,i)})}function F({html:e,title:t,fragment:r,className:i,libraries:a}){let{srcdoc:o,blocked:s}=(0,O.useMemo)(()=>{let n=m(e,a);return{srcdoc:_(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{r&&/^#\S+$/.test(r)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${r}`)},l=j(s);return(0,k.jsxs)(`div`,{"data-slot":`html-report`,className:n(`flex min-h-0 flex-col`,i),children:[l?(0,k.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,k.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:b,allow:p,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var I=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function L(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:I.has(t.slice(n+1).toLowerCase())}function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return L(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function z(e){return e.tooLarge?`too-large`:R(e.path)?`image`:e.binary?`binary`:`text`}function B(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function V({runId:e,path:t,className:n}){let r=c(e,t??void 0);if(t===null)return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(l,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,k.jsx)(K,{className:n,children:(0,k.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof o&&r.error.status===409;return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:e?(0,k.jsx)(D,{}):(0,k.jsx)(u,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,k.jsx)(H,{runId:e,entry:r.data,className:n}):(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function H({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,readerHref:o,documentPreview:s=!1}){let[c,l]=(0,O.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=s&&S(t.path),f=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),p=s&&f&&t.size<=10*1024*1024?`image`:z(t),m=(u||d)&&p===`text`;return(0,k.jsxs)(K,{className:n,children:[(0,k.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:B(t.size)})]}),a||i||m?(0,k.jsx)(W,{snapshot:a,downloadUrl:i,source:m?c:null,onSource:()=>l(e=>!e),readerHref:d&&p===`text`?o:void 0}):null,(0,k.jsx)(U,{runId:e,entry:t,kind:p,showImage:p===`image`&&(!s||f),rendered:c?null:u?`markdown`:d?`html`:null,imageUrl:r})]})}function U({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a}){return r?(0,k.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,k.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??s(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,k.jsx)(f,{icon:(0,k.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${B(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${B(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(C,{document:!0,children:t.content??``})}):i===`html`?(0,k.jsx)(P,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,k.jsx)(Y,{path:t.path,text:t.content??``})}function W({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,k.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,k.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,k.jsx)(G,{href:i}):null]})}function G({href:e}){let n=r(),i=t();return(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:t=>y(t,n,e,i),children:`Open reader`})}function K({className:e,children:t}){return(0,k.jsx)(`section`,{"data-slot":`file-preview`,className:n(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var q=1500;function J(e,t){let n=(0,O.useMemo)(()=>t.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,u as n,w as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,vn as s}from"./project-scope-context-CaUqlAd7.js";import{xt as c}from"./queries-DYfIpJ-d.js";import{T as l,ct as u}from"./design-icons-DmYTv2r1.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{t as f}from"./centered-state-DGyy0SuA.js";import{a as p,c as m,d as h,h as g,l as _,m as v,n as y,o as b,p as x,s as S,t as C,u as w}from"./markdown-D7DUNWcJ.js";var T=d(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=d(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=e(i(),1),k=a(),A=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function j(e){let t=A.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var M={};function N(e){let t=(0,O.useMemo)(()=>w(e),[e]).join(` `),[n,r]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return h(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:M}function P({html:e,title:t,fragment:r,className:i}){let a=N(e);return a?(0,k.jsx)(F,{html:e,title:t,fragment:r,className:i,libraries:a}):(0,k.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:n(`flex min-h-0 flex-col`,i)})}function F({html:e,title:t,fragment:r,className:i,libraries:a}){let{srcdoc:o,blocked:s}=(0,O.useMemo)(()=>{let n=m(e,a);return{srcdoc:_(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{r&&/^#\S+$/.test(r)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${r}`)},l=j(s);return(0,k.jsxs)(`div`,{"data-slot":`html-report`,className:n(`flex min-h-0 flex-col`,i),children:[l?(0,k.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,k.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:b,allow:p,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var I=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function L(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:I.has(t.slice(n+1).toLowerCase())}function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return L(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function z(e){return e.tooLarge?`too-large`:R(e.path)?`image`:e.binary?`binary`:`text`}function B(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function V({runId:e,path:t,className:n}){let r=c(e,t??void 0);if(t===null)return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(l,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,k.jsx)(K,{className:n,children:(0,k.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof o&&r.error.status===409;return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:e?(0,k.jsx)(D,{}):(0,k.jsx)(u,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,k.jsx)(H,{runId:e,entry:r.data,className:n}):(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function H({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,readerHref:o,documentPreview:s=!1}){let[c,l]=(0,O.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=s&&S(t.path),f=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),p=s&&f&&t.size<=10*1024*1024?`image`:z(t),m=(u||d)&&p===`text`;return(0,k.jsxs)(K,{className:n,children:[(0,k.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:B(t.size)})]}),a||i||m?(0,k.jsx)(W,{snapshot:a,downloadUrl:i,source:m?c:null,onSource:()=>l(e=>!e),readerHref:d&&p===`text`?o:void 0}):null,(0,k.jsx)(U,{runId:e,entry:t,kind:p,showImage:p===`image`&&(!s||f),rendered:c?null:u?`markdown`:d?`html`:null,imageUrl:r})]})}function U({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a}){return r?(0,k.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,k.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??s(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,k.jsx)(f,{icon:(0,k.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${B(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${B(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(C,{document:!0,children:t.content??``})}):i===`html`?(0,k.jsx)(P,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,k.jsx)(Y,{path:t.path,text:t.content??``})}function W({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,k.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,k.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,k.jsx)(G,{href:i}):null]})}function G({href:e}){let n=r(),i=t();return(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:t=>y(t,n,e,i),children:`Open reader`})}function K({className:e,children:t}){return(0,k.jsx)(`section`,{"data-slot":`file-preview`,className:n(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var q=1500;function J(e,t){let n=(0,O.useMemo)(()=>t.split(`
2
2
  `).map(e=>[{content:e}]),[t]),r=(0,O.useMemo)(()=>g(e),[e]),i=n.length>q,[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(r===null||i)return;let n=!1;return x(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:v(t,r)?.tokens??n}function Y({path:e,text:t}){let n=J(e,t);return(0,k.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":g(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,k.jsxs)(`div`,{className:`flex px-4`,children:[(0,k.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,k.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}export{R as a,E as c,B as i,T as l,H as n,P as o,V as r,D as s,Y as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,t as n,u as r}from"./button-BEK7XKhS.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,p as s,r as c,t as l}from"./dropdown-menu-DYflHa4m.js";import{s as u}from"./popover-CpULuQSm.js";import{E as d,I as f,M as p,d as m,lt as h}from"./design-icons-DmYTv2r1.js";import{t as g}from"./createLucideIcon-BHp8sXmF.js";import{n as _,r as v,t as y}from"./diff-controls-DXyB0aDl.js";import{K as b,Lt as x}from"./index-xj-3O89_.js";var S=g(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),C=g(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),w=e(i(),1),T=a();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:i}){let[a,o]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,T.jsx)(m,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,T.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),a?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>i(e.path),className:r(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,healthReady:t,branch:i,stat:a,mode:u,wrap:d,preview:f=!1,onModeChange:p,onWrapChange:m,onPreviewChange:h,onAction:g}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[i?(0,T.jsx)(y,{branch:i}):null,a?(0,T.jsx)(R,{stat:a}):null,h?(0,T.jsx)(`span`,{className:`ml-auto flex items-center`,children:(0,T.jsx)(v,{preview:f,onPreviewChange:h})}):null,(0,T.jsxs)(`span`,{className:r(`flex items-center gap-1`,h?`max-md:ml-auto`:`ml-auto`),children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(_,{mode:u,wrap:d,onModeChange:p,onWrapChange:m})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:g},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:g}),e.menu.length>0?(0,T.jsxs)(l,{children:[(0,T.jsx)(s,{asChild:!0,children:(0,T.jsx)(n,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(S,{"aria-hidden":`true`})})}),(0,T.jsx)(c,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(o,{disabled:!e.enabled,title:e.reason,onSelect:()=>g(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(p,{size:16,"aria-hidden":`true`}),push:(0,T.jsx)(h,{size:16,"aria-hidden":`true`}),"create-pr":(0,T.jsx)(f,{size:16,"aria-hidden":`true`}),"view-pr":(0,T.jsx)(u,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(x,{"aria-hidden":`true`})};function L({action:e,variant:r,onAction:i}){return e.id===`view-pr`?t(e.href)?(0,T.jsx)(n,{asChild:!0,variant:r,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>i(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(b,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{E as i,F as n,P as r,R as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,t as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,p as s,r as c,t as l}from"./dropdown-menu-DhrBcVgr.js";import{s as u}from"./popover-DRcRI46x.js";import{E as d,I as f,M as p,d as m,lt as h}from"./design-icons-DmYTv2r1.js";import{t as g}from"./createLucideIcon-BHp8sXmF.js";import{n as _,r as v,t as y}from"./diff-controls-BR2uqhwG.js";import{K as b,Lt as x}from"./index-D489J7QW.js";var S=g(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),C=g(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),w=e(i(),1),T=a();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:i}){let[a,o]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,T.jsx)(m,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,T.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),a?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>i(e.path),className:r(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,healthReady:t,branch:i,stat:a,mode:u,wrap:d,preview:f=!1,onModeChange:p,onWrapChange:m,onPreviewChange:h,onAction:g}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[i?(0,T.jsx)(y,{branch:i}):null,a?(0,T.jsx)(R,{stat:a}):null,h?(0,T.jsx)(`span`,{className:`ml-auto flex items-center`,children:(0,T.jsx)(v,{preview:f,onPreviewChange:h})}):null,(0,T.jsxs)(`span`,{className:r(`flex items-center gap-1`,h?`max-md:ml-auto`:`ml-auto`),children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(_,{mode:u,wrap:d,onModeChange:p,onWrapChange:m})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:g},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:g}),e.menu.length>0?(0,T.jsxs)(l,{children:[(0,T.jsx)(s,{asChild:!0,children:(0,T.jsx)(n,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(S,{"aria-hidden":`true`})})}),(0,T.jsx)(c,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(o,{disabled:!e.enabled,title:e.reason,onSelect:()=>g(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(p,{size:16,"aria-hidden":`true`}),push:(0,T.jsx)(h,{size:16,"aria-hidden":`true`}),"create-pr":(0,T.jsx)(f,{size:16,"aria-hidden":`true`}),"view-pr":(0,T.jsx)(u,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(x,{"aria-hidden":`true`})};function L({action:e,variant:r,onAction:i}){return e.id===`view-pr`?t(e.href)?(0,T.jsx)(n,{asChild:!0,variant:r,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>i(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(b,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{E as i,F as n,P as r,R as t};