@hearsay-tools/squawk 0.19.0-dev.8877 → 0.19.0-dev.8881
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/web/dist/assets/accounts-section-BM-HWieF.js +1 -0
- package/web/dist/assets/activity-motion-BlDa0Oee.js +1 -0
- package/web/dist/assets/activity-route-BOozKrPn.js +1 -0
- package/web/dist/assets/agent-config-section-Bg0OgLPn.js +7 -0
- package/web/dist/assets/agent-defaults-section-B-uXUUCT.js +1 -0
- package/web/dist/assets/appearance-Cv8Qr8nS.js +1 -0
- package/web/dist/assets/archive-on-merge-field-DExgXlBg.js +1 -0
- package/web/dist/assets/attention-CnhIF76m.js +1 -0
- package/web/dist/assets/{automations-route-Dj5mLsB_.js → automations-route-DqS_DIp2.js} +2 -2
- package/web/dist/assets/badge-B6B-xYQQ.js +1 -0
- package/web/dist/assets/button-C8jUIs8Q.js +1 -0
- package/web/dist/assets/centered-state-BgSV4e79.js +1 -0
- package/web/dist/assets/change-counts-wqSYI3W8.js +1 -0
- package/web/dist/assets/{code-editor-B4baSOhz.js → code-editor-GfQChdgl.js} +1 -1
- package/web/dist/assets/{collapsible-BEV4FO-1.js → collapsible-CW6CfTJO.js} +1 -1
- package/web/dist/assets/command-DuxcX6Hr.js +1 -0
- package/web/dist/assets/commit-list-a1vNhwzg.js +1 -0
- package/web/dist/assets/dialog-Dbu3HnqC.js +1 -0
- package/web/dist/assets/diff-DDjPsaQ6.js +3 -0
- package/web/dist/assets/diff-controls-QeCV3Sy1.js +1 -0
- package/web/dist/assets/diff-stat-Dy4uLuyP.js +1 -0
- package/web/dist/assets/{diff-view-mEcoOmP6.js → diff-view-Bv9YauBT.js} +1 -1
- package/web/dist/assets/{dist-Da4ckcJG.js → dist-BS5vYfFC.js} +1 -1
- package/web/dist/assets/dist-C_rn70hE.js +1 -0
- package/web/dist/assets/{dist-DXO3xwbC.js → dist-CtdIjNlG.js} +1 -1
- package/web/dist/assets/{dist-BAoXdNsT.js → dist-DDhqweuB.js} +1 -1
- package/web/dist/assets/{dist-C5mlVBmd.js → dist-Tubgdd25.js} +1 -1
- package/web/dist/assets/dist-VPUfzsfL.js +1 -0
- package/web/dist/assets/dropdown-menu-BaqO-x7U.js +1 -0
- package/web/dist/assets/{es2015-CQth82uv.js → es2015-DpKptHDx.js} +1 -1
- package/web/dist/assets/file-preview-CuwkUuqd.js +2 -0
- package/web/dist/assets/folder-browser-CK1mNIQi.js +1 -0
- package/web/dist/assets/git-toolbar-BWSmSiqy.js +1 -0
- package/web/dist/assets/github-CS_bLWjw.js +1 -0
- package/web/dist/assets/{global-activity-route-u1XpCWGK.js → global-activity-route-D7HmA4W3.js} +1 -1
- package/web/dist/assets/highlighter-Cfo7mLVB.js +3 -0
- package/web/dist/assets/html-report-frame-Ck76gKfA.js +1 -0
- package/web/dist/assets/{image-preview-DCUeM8u3.js → image-preview-CeEKI2T5.js} +1 -1
- package/web/dist/assets/index-B0_haEFL.js +21 -0
- package/web/dist/assets/index-D0mx-XUg.css +1 -0
- package/web/dist/assets/label-eNfbfYFG.js +1 -0
- package/web/dist/assets/markdown-Djjm7pRl.js +2 -0
- package/web/dist/assets/nav-row-styles-CgP5uNp4.js +1 -0
- package/web/dist/assets/{notifications-section-CBdv2T-_.js → notifications-section-Dcclastm.js} +1 -1
- package/web/dist/assets/{open-in-menu-VhRao_Jk.js → open-in-menu-CSbpfQy7.js} +1 -1
- package/web/dist/assets/option-select-DzjSpnye.js +1 -0
- package/web/dist/assets/page-shell-CpdYMj52.js +1 -0
- package/web/dist/assets/popover-CVo54-aS.js +1 -0
- package/web/dist/assets/{preview-pane-connected-B00yRXAd.js → preview-pane-connected-DOnixsSz.js} +3 -3
- package/web/dist/assets/{project-location-DATkk1gA.js → project-location-CBzVRz73.js} +1 -1
- package/web/dist/assets/{project-router-B9FTk0rB.js → project-router-CEnizJ8F.js} +1 -1
- package/web/dist/assets/projects-section-CJAE2fqb.js +1 -0
- package/web/dist/assets/prompt-templates-section-BqmYEq-d.js +1 -0
- package/web/dist/assets/queries-ByqTmyCs.js +1 -0
- package/web/dist/assets/reference-chip-hn8jj_Mo.js +1 -0
- package/web/dist/assets/{remote-settings-notice-BJwP8Vi8.js → remote-settings-notice-ChJJ2HzF.js} +1 -1
- package/web/dist/assets/repo-git-DzX-ZqFC.js +1 -0
- package/web/dist/assets/{report-reader-DDGKyj6B.js → report-reader-DMLkJxpC.js} +1 -1
- package/web/dist/assets/report-selection-BkBJw-sm.js +1 -0
- package/web/dist/assets/reports-DyilNFvz.js +1 -0
- package/web/dist/assets/resources-section-NWZHHXtk.js +1 -0
- package/web/dist/assets/{review-panel-5IbppuWS.js → review-panel-BsKM2hDc.js} +8 -8
- package/web/dist/assets/{run-detail-refresh-Ye2jcT7n.js → run-detail-refresh-BJ4laDVB.js} +1 -1
- package/web/dist/assets/run-header-DpTjMIK-.js +2 -0
- package/web/dist/assets/select-CvnOk0OI.js +1 -0
- package/web/dist/assets/{session-context-section-nSf23HuY.js → session-context-section-B3bs0GoD.js} +2 -2
- package/web/dist/assets/settings-agent-picker-DlX1-8_P.js +1 -0
- package/web/dist/assets/settings-shell-1FhhEiGa.css +1 -0
- package/web/dist/assets/{settings-shell-BlNdAbSK.js → settings-shell-twGuaJwv.js} +1 -1
- package/web/dist/assets/sidebar-section-Crbl2_-9.js +1 -0
- package/web/dist/assets/skills-CXdbXepC.js +1 -0
- package/web/dist/assets/status-dot-BXf-Ubd0.js +1 -0
- package/web/dist/assets/switch-DfPCm1H_.js +1 -0
- package/web/dist/assets/tab-link-3A_SF95U.js +1 -0
- package/web/dist/assets/task-changes-C8m5S54H.js +1 -0
- package/web/dist/assets/{task-commits-C3Aieqql.js → task-commits-CwNBsoyL.js} +1 -1
- package/web/dist/assets/{task-file-scope-EBj6BbvL.js → task-file-scope-C313CMq7.js} +1 -1
- package/web/dist/assets/task-files-CdpANvF1.js +1 -0
- package/web/dist/assets/task-github-item-f4J2WBEt.js +1 -0
- package/web/dist/assets/{task-groups-DD46syqv.js → task-groups-BRrlyl5P.js} +1 -1
- package/web/dist/assets/{task-thread-CbBHJkXy.js → task-thread-BqoX3viB.js} +2 -2
- package/web/dist/assets/{tasks-table-D17JLOhe.js → tasks-table-DtLW8U-4.js} +1 -1
- package/web/dist/assets/textarea-vEsJAUAV.js +1 -0
- package/web/dist/assets/thread-state-Bh4adRbN.js +4 -0
- package/web/dist/assets/toaster-Lf_4oY96.js +4 -0
- package/web/dist/assets/use-hand-to-agent-state-C3NlsVVQ.js +1 -0
- package/web/dist/assets/workflows-Df7ulEcU.js +7 -0
- package/web/dist/assets/{workspace-tools-C2ut23LU.js → workspace-tools-C_93GWNV.js} +1 -1
- package/web/dist/assets/{worktrees-section-BE61T3WC.js → worktrees-section-w9Q1xpeU.js} +4 -4
- package/web/dist/assets/zoomable-image-BUTgYpld.js +1 -0
- package/web/dist/index.html +33 -33
- package/web/dist/assets/accounts-section-UJZxye-z.js +0 -1
- package/web/dist/assets/activity-motion-BnRBlOlc.js +0 -1
- package/web/dist/assets/activity-route-weCjVQ4j.js +0 -1
- package/web/dist/assets/agent-config-section-CGrPPEQR.js +0 -7
- package/web/dist/assets/agent-defaults-section-mocZoAgX.js +0 -1
- package/web/dist/assets/appearance-dnjgFECm.js +0 -1
- package/web/dist/assets/archive-on-merge-field-BkwRlcuT.js +0 -1
- package/web/dist/assets/attention-ILOaW2-t.js +0 -1
- package/web/dist/assets/badge-DQ3U69Ht.js +0 -1
- package/web/dist/assets/button-B7MKxYjT.js +0 -1
- package/web/dist/assets/centered-state-V15AR_qo.js +0 -1
- package/web/dist/assets/change-counts-npLATh-3.js +0 -1
- package/web/dist/assets/command-KdW7aO0N.js +0 -1
- package/web/dist/assets/commit-list-C8pTI7mp.js +0 -1
- package/web/dist/assets/dialog-B531GGAo.js +0 -1
- package/web/dist/assets/diff-BUeqeifm.js +0 -3
- package/web/dist/assets/diff-controls-n4THBHKo.js +0 -1
- package/web/dist/assets/diff-stat-C7KB1kDX.js +0 -1
- package/web/dist/assets/dist-BW234Kg5.js +0 -1
- package/web/dist/assets/dropdown-menu-4e2iKSMT.js +0 -1
- package/web/dist/assets/file-preview-CQdNEFHu.js +0 -2
- package/web/dist/assets/folder-browser-B_jJl4is.js +0 -1
- package/web/dist/assets/git-toolbar-AbHPGj3l.js +0 -1
- package/web/dist/assets/github-DriOZy15.js +0 -1
- package/web/dist/assets/highlighter-DvLzHjjY.js +0 -3
- package/web/dist/assets/html-report-frame-DkHr39E2.js +0 -1
- package/web/dist/assets/index-DOVwFCfP.css +0 -1
- package/web/dist/assets/index-_LohQUeF.js +0 -21
- package/web/dist/assets/label-DMC9mkYa.js +0 -1
- package/web/dist/assets/markdown-DJkMnwyc.js +0 -2
- package/web/dist/assets/nav-row-styles-D5HpOmDZ.js +0 -1
- package/web/dist/assets/page-shell-7pLJMOgh.js +0 -1
- package/web/dist/assets/popover-CZV6tz9i.js +0 -1
- package/web/dist/assets/projects-section-BXkVtC6H.js +0 -1
- package/web/dist/assets/prompt-templates-section-RF3GKyNP.js +0 -1
- package/web/dist/assets/queries-hzlF788B.js +0 -1
- package/web/dist/assets/reference-chip-Dgo5aKeb.js +0 -1
- package/web/dist/assets/repo-git-DuPmx5Mc.js +0 -1
- package/web/dist/assets/report-selection-C-2DJb8L.js +0 -1
- package/web/dist/assets/reports-CUVVGSNs.js +0 -1
- package/web/dist/assets/resources-section-CO9ePehe.js +0 -1
- package/web/dist/assets/run-header-BbjUWTs-.js +0 -2
- package/web/dist/assets/select-Cnv2IYdg.js +0 -1
- package/web/dist/assets/settings-agent-picker-DFTg6k6E.js +0 -1
- package/web/dist/assets/settings-select-CCIMGnyA.js +0 -1
- package/web/dist/assets/settings-shell-AMRJAsgc.css +0 -1
- package/web/dist/assets/sidebar-section-DmBlDKYf.js +0 -1
- package/web/dist/assets/skills-BmwnEyVF.js +0 -1
- package/web/dist/assets/status-dot-BRzVlF2X.js +0 -1
- package/web/dist/assets/switch-DKqVf8-p.js +0 -1
- package/web/dist/assets/tab-link-BlZX-nKP.js +0 -1
- package/web/dist/assets/task-changes-BGxKFPHy.js +0 -1
- package/web/dist/assets/task-files-BkrKQUzS.js +0 -1
- package/web/dist/assets/task-github-item-DdpDpxtU.js +0 -1
- package/web/dist/assets/textarea-vJt9undk.js +0 -1
- package/web/dist/assets/thread-state-9hRlv8vK.js +0 -4
- package/web/dist/assets/toaster-fWyfEGWF.js +0 -4
- package/web/dist/assets/use-hand-to-agent-state-CCWMSRyA.js +0 -1
- package/web/dist/assets/utils-DSMR_WLb.js +0 -1
- package/web/dist/assets/workflows-XpPXRBCU.js +0 -7
- package/web/dist/assets/zoomable-image-6RTKhLGE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i}from"./dist-BW234Kg5.js";import{a,i as o,n as s}from"./dist-C5mlVBmd.js";import{c}from"./es2015-CQth82uv.js";import{t as l}from"./dist-DXO3xwbC.js";var u=e(t(),1),d=[`top`,`right`,`bottom`,`left`],f=Math.min,p=Math.max,m=Math.round,h=Math.floor,g=e=>({x:e,y:e}),_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function v(e,t,n){return p(e,f(t,n))}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return e.split(`-`)[0]}function x(e){return e.split(`-`)[1]}function S(e){return e===`x`?`y`:`x`}function C(e){return e===`y`?`height`:`width`}function w(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function T(e){return S(w(e))}function E(e,t,n){n===void 0&&(n=!1);let r=x(e),i=T(e),a=C(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=F(o)),[o,F(o)]}function D(e){let t=F(e);return[O(e),t,O(t)]}function O(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var k=[`left`,`right`],A=[`right`,`left`],j=[`top`,`bottom`],M=[`bottom`,`top`];function N(e,t,n){switch(e){case`top`:case`bottom`:return n?t?A:k:t?k:A;case`left`:case`right`:return t?j:M;default:return[]}}function P(e,t,n,r){let i=x(e),a=N(b(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(O)))),a}function F(e){let t=b(e);return _[t]+e.slice(t.length)}function I(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:I(e)}function L(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 R(e,t,n){let{reference:r,floating:i}=e,a=w(t),o=T(t),s=C(o),c=b(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=x(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function z(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=y(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=L(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/v.y,bottom:(b.bottom-h.bottom+p.bottom)/v.y,left:(h.left-b.left+p.left)/v.x,right:(b.right-h.right+p.right)/v.x}}var te=50,ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:z},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=R(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<te&&(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}=R(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=y(e,t)||{};if(l==null)return{};let d=ee(u),p={x:n,y:r},m=T(i),h=C(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,w=_?`clientHeight`:`clientWidth`,E=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[w]||a.floating[h]);let A=E/2-D/2,j=k/2-g[h]/2-1,M=f(d[b],j),N=f(d[S],j),P=k-g[h]-N,F=k/2-g[h]/2+A,I=v(M,F,P),L=!c.arrow&&x(i)!=null&&F!==I&&a.reference[h]/2-(F<M?M:N)-g[h]/2<0,R=L?F<M?F-M:F-P:0;return{[m]:p[m]+R,data:{[m]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=b(r),_=w(o),v=b(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[F(o)]:D(o)),C=p!==`none`;!d&&C&&S.push(...P(o,m,p,x));let T=[o,...S],O=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(O[g]),u){let e=E(r,a,x);k.push(O[e[0]],O[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=T[e];if(t&&(!(u===`alignment`&&_!==w(t))||A.every(e=>w(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=w(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return d.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=y(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=b(n),s=x(n),c=w(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=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 le(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}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=w(i),p=S(f),m=u[p],h=u[f],g=(e,t)=>v(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=y(e,t),u={x:n,y:r},d=w(i),f=S(d),p=u[f],m=u[d],h=y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(b(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=y(e,t),c=await i.detectOverflow(t,s),l=b(n),u=x(n),d=w(n)===`y`,{width:m,height:h}=r.floating,g,_;l===`top`||l===`bottom`?(g=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,g=u===`end`?`top`:`bottom`);let v=h-c.top-c.bottom,S=m-c.left-c.right,C=f(h-c[g],v),T=f(m-c[_],S),E=t.middlewareData.shift,D=!E,O=C,k=T;E!=null&&E.enabled.x&&(k=S),E!=null&&E.enabled.y&&(O=v),D&&!u&&(d?k=m-2*p(c.left,c.right):O=h-2*p(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return m!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<`u`}function B(e){return he(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((he(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function he(e){return me()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return me()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return me()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function ge(e){return!me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function _e(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ve(e){return/^(table|td|th)$/.test(B(e))}function ye(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var be=/transform|translate|scale|rotate|perspective|filter/,xe=/paint|layout|strict|content/,G=e=>!!e&&e!==`none`,Se;function Ce(e){let t=U(e)?q(e):e;return G(t.transform)||G(t.translate)||G(t.scale)||G(t.rotate)||G(t.perspective)||!Te()&&(G(t.backdropFilter)||G(t.filter))||be.test(t.willChange||``)||xe.test(t.contain||``)}function we(e){let t=J(e);for(;W(t)&&!K(t);){if(Ce(t))return t;if(ye(t))return null;t=J(t)}return null}function Te(){return Se??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Se}function K(e){return/^(html|body|#document)$/.test(B(e))}function q(e){return V(e).getComputedStyle(e)}function Ee(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(B(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ge(e)&&e.host||H(e);return ge(t)?t.host:t}function De(e){let t=J(e);return K(t)?(e.ownerDocument||e).body:W(t)&&_e(t)?t:De(t)}function Y(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=De(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=Oe(a);return t.concat(a,a.visualViewport||[],_e(r)?r:[],e&&n?Y(e):[])}else return t.concat(r,Y(r,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ke(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=m(n)!==a||m(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ae(e){return U(e)?e:e.contextElement}function X(e){let t=Ae(e);if(!W(t))return g(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ke(t),o=(a?m(n.width):n.width)/r,s=(a?m(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var je=g(0);function Me(e){let t=V(e);return!Te()||!t.visualViewport?je:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ne(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===V(e)}function Z(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ae(e),o=g(1);t&&(r?U(r)&&(o=X(r)):o=X(e));let s=Ne(a,n,r)?Me(a):g(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=V(a),t=U(r)?V(r):r,n=e,i=Oe(n);for(;i&&t!==n;){let e=X(i),t=i.getBoundingClientRect(),r=q(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=V(i),i=Oe(n)}}return L({width:u,height:d,x:c,y:l})}function Q(e,t){let n=Ee(e).scrollLeft;return t?t.left+n:Z(H(e)).left+n}function Pe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Q(e,n),y:n.top+t.scrollTop}}function Fe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?ye(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=g(1),u=g(0),d=W(r);if((d||!a)&&((B(r)!==`body`||_e(o))&&(c=Ee(r)),d)){let e=Z(r);l=X(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Pe(o,c):g(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ie(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Le(e){let t=Ee(e),n=e.ownerDocument.body,r=p(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=p(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Q(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=p(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Re=25;function ze(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=V(e),a=H(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Te()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Q(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Re&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Be(e,t){let n=Z(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=X(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ve(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ze(e,n,t);else if(t===`document`)r=Le(H(e));else if(U(t))r=Be(t,n);else{let n=Me(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return L(r)}function He(e,t){let n=t.get(e);if(n)return n;let r=Y(e,[],!1).filter(e=>U(e)&&B(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;U(o)&&!K(o);){let e=q(o),t=Ce(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function Ue(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ye(t)?[]:He(t,this._c):[].concat(n),r],o=Ve(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ve(t,a[e],i);s=p(n.top,s),c=f(n.right,c),l=f(n.bottom,l),u=p(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function We(e){let{width:t,height:n}=ke(e);return{width:t,height:n}}function Ge(e,t,n){let r=W(t),i=H(t),a=n===`fixed`,o=Z(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=g(0);if((r||!a)&&((B(t)!==`body`||_e(i))&&(s=Ee(t)),r)){let e=Z(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Q(i));let l=i&&!r&&!a?Pe(i,s):g(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ke(e){return q(e).position===`static`}function qe(e,t){if(!W(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function Je(e,t){let n=V(e);if(ye(e))return n;if(!W(e)){let t=J(e);for(;t&&!K(t);){if(U(t)&&!Ke(t))return t;t=J(t)}return n}let r=qe(e,t);for(;r&&ve(r)&&Ke(r);)r=qe(r,t);return r&&K(r)&&Ke(r)&&!Ce(r)?n:r||we(e)||n}var Ye=async function(e){let t=this.getOffsetParent||Je,n=this.getDimensions,r=await n(e.floating);return{reference:Ge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xe(e){return q(e).direction===`rtl`}var Ze={convertOffsetParentRelativeRectToViewportRelativeRect:Fe,getDocumentElement:H,getClippingRect:Ue,getOffsetParent:Je,getElementRects:Ye,getClientRects:Ie,getDimensions:We,getScale:X,isElement:U,isRTL:Xe};function Qe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $e(e,t,n){let r=null,i,a=H(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:m,height:g}=l;if(n||t(),!m||!g)return;let _=h(d),v=h(a.clientWidth-(u+m)),y=h(a.clientHeight-(d+g)),b=h(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:p(0,f(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(!Qe(l,e.getBoundingClientRect()))return s();if(n!==c){if(!S)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=V(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function et(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ae(e),u=i||a?[...l?Y(l):[],...t?Y(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?$e(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Z(e):null;c&&g();function g(){let t=Z(e);h&&!Qe(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var tt=ue,nt=de,rt=ie,it=pe,at=se,ot=re,st=fe,ct=(e,t,n)=>{let r=new Map,i=n??{},a={...Ze,...i.platform,_c:r};return ne(e,t,{...i,platform:a})},lt=e(n(),1),ut=typeof document<`u`?u.useLayoutEffect:function(){};function dt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!dt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!dt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ft(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pt(e,t){let n=ft(e);return Math.round(t*n)/n}function mt(e){let t=u.useRef(e);return ut(()=>{t.current=e}),t}function ht(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(r);dt(p,r)||m(r);let[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=u.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=u.useRef(null),w=u.useRef(null),T=u.useRef(d),E=c!=null,D=mt(c),O=mt(i),k=mt(l),A=u.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),ct(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!dt(T.current,t)&&(T.current=t,lt.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);ut(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=u.useRef(!1);ut(()=>(j.current=!0,()=>{j.current=!1}),[]),ut(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=u.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=u.useMemo(()=>({reference:x,floating:S}),[x,S]),P=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=pt(N.floating,d.x),r=pt(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ft(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var gt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ot({element:r.current,padding:i}).fn(n):r?ot({element:r,padding:i}).fn(n):{}}}},_t=(e,t)=>{let n=tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},vt=(e,t)=>{let n=nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},yt=(e,t)=>({fn:st(e).fn,options:[e,t]}),bt=(e,t)=>{let n=rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>{let n=gt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),wt=`Arrow`,Tt=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,$.jsx)(a.svg,{...o,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Tt.displayName=wt;var Et=Tt,Dt=`Popper`,[Ot,kt]=o(Dt),[At,jt]=Ot(Dt),Mt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null),[a,o]=u.useState(void 0);return(0,$.jsx)(At,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Mt.displayName=Dt;var Nt=`PopperAnchor`,Pt=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,s=jt(Nt,n),c=u.useRef(null),l=s.onAnchorChange,d=i(t,u.useCallback(e=>{c.current=e,e&&l(e)},[l])),f=u.useRef(null);u.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&l(f.current)});let p=s.placementState&&Wt(s.placementState),m=p?.[0],h=p?.[1];return r?null:(0,$.jsx)(a.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...o,ref:d})});Pt.displayName=Nt;var Ft=`PopperContent`,[It,Lt]=Ot(Ft),Rt=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:o=0,align:d=`center`,alignOffset:f=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:_=`partial`,hideWhenDetached:v=!1,updatePositionStrategy:y=`optimized`,onPlaced:b,...x}=e,S=jt(Ft,n),[C,w]=u.useState(null),T=i(t,w),[E,D]=u.useState(null),O=l(E),k=O?.width??0,A=O?.height??0,j=r+(d===`center`?``:`-`+d),M=typeof g==`number`?g:{top:0,right:0,bottom:0,left:0,...g},N=Array.isArray(h)?h:[h],P=N.length>0,F={padding:M,boundary:N.filter(Ht),altBoundary:P},{refs:I,floatingStyles:ee,placement:L,isPositioned:R,middlewareData:z}=ht({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>et(...e,{animationFrame:y===`always`}),elements:{reference:S.anchor},middleware:[_t({mainAxis:o+A,alignmentAxis:f}),m&&vt({mainAxis:!0,crossAxis:!1,limiter:_===`partial`?yt():void 0,...F}),m&&bt({...F}),xt({...F,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`)}}),E&&Ct({element:E,padding:p}),Ut({arrowWidth:k,arrowHeight:A}),v&&St({strategy:`referenceHidden`,...F,boundary:P?F.boundary:void 0})]}),te=S.setPlacementState;s(()=>(te(L),()=>{te(void 0)}),[L,te]);let[ne,re]=Wt(L),ie=c(b);s(()=>{R&&ie?.()},[R,ie]);let ae=z.arrow?.x,oe=z.arrow?.y,se=z.arrow?.centerOffset!==0,[ce,le]=u.useState();return s(()=>{C&&le(window.getComputedStyle(C).zIndex)},[C]),(0,$.jsx)(`div`,{ref:I.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:R?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(It,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:D,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,$.jsx)(a.div,{"data-side":ne,"data-align":re,...x,ref:T,style:{...x.style,animation:R?void 0:`none`}})})})});Rt.displayName=Ft;var zt=`PopperArrow`,Bt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Vt=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Lt(zt,n),a=Bt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(Et,{...r,ref:t,style:{...r.style,display:`block`}})})});Vt.displayName=zt;function Ht(e){return e!==null}var Ut=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]=Wt(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 Wt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Gt=Mt,Kt=Pt,qt=Rt,Jt=Vt;export{kt as a,Gt as i,Jt as n,qt as r,Kt as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i}from"./dist-C_rn70hE.js";import{a,i as o,n as s}from"./dist-Tubgdd25.js";import{c}from"./es2015-DpKptHDx.js";import{t as l}from"./dist-CtdIjNlG.js";var u=e(t(),1),d=[`top`,`right`,`bottom`,`left`],f=Math.min,p=Math.max,m=Math.round,h=Math.floor,g=e=>({x:e,y:e}),_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function v(e,t,n){return p(e,f(t,n))}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return e.split(`-`)[0]}function x(e){return e.split(`-`)[1]}function S(e){return e===`x`?`y`:`x`}function C(e){return e===`y`?`height`:`width`}function w(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function T(e){return S(w(e))}function E(e,t,n){n===void 0&&(n=!1);let r=x(e),i=T(e),a=C(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=F(o)),[o,F(o)]}function D(e){let t=F(e);return[O(e),t,O(t)]}function O(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var k=[`left`,`right`],A=[`right`,`left`],j=[`top`,`bottom`],M=[`bottom`,`top`];function N(e,t,n){switch(e){case`top`:case`bottom`:return n?t?A:k:t?k:A;case`left`:case`right`:return t?j:M;default:return[]}}function P(e,t,n,r){let i=x(e),a=N(b(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(O)))),a}function F(e){let t=b(e);return _[t]+e.slice(t.length)}function I(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:I(e)}function L(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 R(e,t,n){let{reference:r,floating:i}=e,a=w(t),o=T(t),s=C(o),c=b(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=x(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function z(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=y(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=L(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/v.y,bottom:(b.bottom-h.bottom+p.bottom)/v.y,left:(h.left-b.left+p.left)/v.x,right:(b.right-h.right+p.right)/v.x}}var te=50,ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:z},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=R(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<te&&(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}=R(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=y(e,t)||{};if(l==null)return{};let d=ee(u),p={x:n,y:r},m=T(i),h=C(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,w=_?`clientHeight`:`clientWidth`,E=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[w]||a.floating[h]);let A=E/2-D/2,j=k/2-g[h]/2-1,M=f(d[b],j),N=f(d[S],j),P=k-g[h]-N,F=k/2-g[h]/2+A,I=v(M,F,P),L=!c.arrow&&x(i)!=null&&F!==I&&a.reference[h]/2-(F<M?M:N)-g[h]/2<0,R=L?F<M?F-M:F-P:0;return{[m]:p[m]+R,data:{[m]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=b(r),_=w(o),v=b(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[F(o)]:D(o)),C=p!==`none`;!d&&C&&S.push(...P(o,m,p,x));let T=[o,...S],O=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(O[g]),u){let e=E(r,a,x);k.push(O[e[0]],O[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=T[e];if(t&&(!(u===`alignment`&&_!==w(t))||A.every(e=>w(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=w(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return d.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=y(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=b(n),s=x(n),c=w(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=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 le(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}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=w(i),p=S(f),m=u[p],h=u[f],g=(e,t)=>v(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=y(e,t),u={x:n,y:r},d=w(i),f=S(d),p=u[f],m=u[d],h=y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(b(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=y(e,t),c=await i.detectOverflow(t,s),l=b(n),u=x(n),d=w(n)===`y`,{width:m,height:h}=r.floating,g,_;l===`top`||l===`bottom`?(g=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,g=u===`end`?`top`:`bottom`);let v=h-c.top-c.bottom,S=m-c.left-c.right,C=f(h-c[g],v),T=f(m-c[_],S),E=t.middlewareData.shift,D=!E,O=C,k=T;E!=null&&E.enabled.x&&(k=S),E!=null&&E.enabled.y&&(O=v),D&&!u&&(d?k=m-2*p(c.left,c.right):O=h-2*p(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return m!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<`u`}function B(e){return he(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((he(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function he(e){return me()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return me()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return me()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function ge(e){return!me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function _e(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ve(e){return/^(table|td|th)$/.test(B(e))}function ye(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var be=/transform|translate|scale|rotate|perspective|filter/,xe=/paint|layout|strict|content/,G=e=>!!e&&e!==`none`,Se;function Ce(e){let t=U(e)?q(e):e;return G(t.transform)||G(t.translate)||G(t.scale)||G(t.rotate)||G(t.perspective)||!Te()&&(G(t.backdropFilter)||G(t.filter))||be.test(t.willChange||``)||xe.test(t.contain||``)}function we(e){let t=J(e);for(;W(t)&&!K(t);){if(Ce(t))return t;if(ye(t))return null;t=J(t)}return null}function Te(){return Se??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Se}function K(e){return/^(html|body|#document)$/.test(B(e))}function q(e){return V(e).getComputedStyle(e)}function Ee(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(B(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ge(e)&&e.host||H(e);return ge(t)?t.host:t}function De(e){let t=J(e);return K(t)?(e.ownerDocument||e).body:W(t)&&_e(t)?t:De(t)}function Y(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=De(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=Oe(a);return t.concat(a,a.visualViewport||[],_e(r)?r:[],e&&n?Y(e):[])}else return t.concat(r,Y(r,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ke(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=m(n)!==a||m(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ae(e){return U(e)?e:e.contextElement}function X(e){let t=Ae(e);if(!W(t))return g(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ke(t),o=(a?m(n.width):n.width)/r,s=(a?m(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var je=g(0);function Me(e){let t=V(e);return!Te()||!t.visualViewport?je:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ne(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===V(e)}function Z(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ae(e),o=g(1);t&&(r?U(r)&&(o=X(r)):o=X(e));let s=Ne(a,n,r)?Me(a):g(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=V(a),t=U(r)?V(r):r,n=e,i=Oe(n);for(;i&&t!==n;){let e=X(i),t=i.getBoundingClientRect(),r=q(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=V(i),i=Oe(n)}}return L({width:u,height:d,x:c,y:l})}function Q(e,t){let n=Ee(e).scrollLeft;return t?t.left+n:Z(H(e)).left+n}function Pe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Q(e,n),y:n.top+t.scrollTop}}function Fe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?ye(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=g(1),u=g(0),d=W(r);if((d||!a)&&((B(r)!==`body`||_e(o))&&(c=Ee(r)),d)){let e=Z(r);l=X(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Pe(o,c):g(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ie(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Le(e){let t=Ee(e),n=e.ownerDocument.body,r=p(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=p(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Q(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=p(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Re=25;function ze(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=V(e),a=H(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Te()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Q(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Re&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Be(e,t){let n=Z(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=X(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ve(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ze(e,n,t);else if(t===`document`)r=Le(H(e));else if(U(t))r=Be(t,n);else{let n=Me(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return L(r)}function He(e,t){let n=t.get(e);if(n)return n;let r=Y(e,[],!1).filter(e=>U(e)&&B(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;U(o)&&!K(o);){let e=q(o),t=Ce(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function Ue(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ye(t)?[]:He(t,this._c):[].concat(n),r],o=Ve(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ve(t,a[e],i);s=p(n.top,s),c=f(n.right,c),l=f(n.bottom,l),u=p(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function We(e){let{width:t,height:n}=ke(e);return{width:t,height:n}}function Ge(e,t,n){let r=W(t),i=H(t),a=n===`fixed`,o=Z(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=g(0);if((r||!a)&&((B(t)!==`body`||_e(i))&&(s=Ee(t)),r)){let e=Z(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Q(i));let l=i&&!r&&!a?Pe(i,s):g(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ke(e){return q(e).position===`static`}function qe(e,t){if(!W(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function Je(e,t){let n=V(e);if(ye(e))return n;if(!W(e)){let t=J(e);for(;t&&!K(t);){if(U(t)&&!Ke(t))return t;t=J(t)}return n}let r=qe(e,t);for(;r&&ve(r)&&Ke(r);)r=qe(r,t);return r&&K(r)&&Ke(r)&&!Ce(r)?n:r||we(e)||n}var Ye=async function(e){let t=this.getOffsetParent||Je,n=this.getDimensions,r=await n(e.floating);return{reference:Ge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xe(e){return q(e).direction===`rtl`}var Ze={convertOffsetParentRelativeRectToViewportRelativeRect:Fe,getDocumentElement:H,getClippingRect:Ue,getOffsetParent:Je,getElementRects:Ye,getClientRects:Ie,getDimensions:We,getScale:X,isElement:U,isRTL:Xe};function Qe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $e(e,t,n){let r=null,i,a=H(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:m,height:g}=l;if(n||t(),!m||!g)return;let _=h(d),v=h(a.clientWidth-(u+m)),y=h(a.clientHeight-(d+g)),b=h(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:p(0,f(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(!Qe(l,e.getBoundingClientRect()))return s();if(n!==c){if(!S)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=V(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function et(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ae(e),u=i||a?[...l?Y(l):[],...t?Y(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?$e(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Z(e):null;c&&g();function g(){let t=Z(e);h&&!Qe(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var tt=ue,nt=de,rt=ie,it=pe,at=se,ot=re,st=fe,ct=(e,t,n)=>{let r=new Map,i=n??{},a={...Ze,...i.platform,_c:r};return ne(e,t,{...i,platform:a})},lt=e(n(),1),ut=typeof document<`u`?u.useLayoutEffect:function(){};function dt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!dt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!dt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ft(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pt(e,t){let n=ft(e);return Math.round(t*n)/n}function mt(e){let t=u.useRef(e);return ut(()=>{t.current=e}),t}function ht(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(r);dt(p,r)||m(r);let[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=u.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=u.useRef(null),w=u.useRef(null),T=u.useRef(d),E=c!=null,D=mt(c),O=mt(i),k=mt(l),A=u.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),ct(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!dt(T.current,t)&&(T.current=t,lt.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);ut(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=u.useRef(!1);ut(()=>(j.current=!0,()=>{j.current=!1}),[]),ut(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=u.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=u.useMemo(()=>({reference:x,floating:S}),[x,S]),P=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=pt(N.floating,d.x),r=pt(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ft(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var gt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ot({element:r.current,padding:i}).fn(n):r?ot({element:r,padding:i}).fn(n):{}}}},_t=(e,t)=>{let n=tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},vt=(e,t)=>{let n=nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},yt=(e,t)=>({fn:st(e).fn,options:[e,t]}),bt=(e,t)=>{let n=rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>{let n=gt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),wt=`Arrow`,Tt=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,$.jsx)(a.svg,{...o,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Tt.displayName=wt;var Et=Tt,Dt=`Popper`,[Ot,kt]=o(Dt),[At,jt]=Ot(Dt),Mt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null),[a,o]=u.useState(void 0);return(0,$.jsx)(At,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Mt.displayName=Dt;var Nt=`PopperAnchor`,Pt=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,s=jt(Nt,n),c=u.useRef(null),l=s.onAnchorChange,d=i(t,u.useCallback(e=>{c.current=e,e&&l(e)},[l])),f=u.useRef(null);u.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&l(f.current)});let p=s.placementState&&Wt(s.placementState),m=p?.[0],h=p?.[1];return r?null:(0,$.jsx)(a.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...o,ref:d})});Pt.displayName=Nt;var Ft=`PopperContent`,[It,Lt]=Ot(Ft),Rt=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:o=0,align:d=`center`,alignOffset:f=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:_=`partial`,hideWhenDetached:v=!1,updatePositionStrategy:y=`optimized`,onPlaced:b,...x}=e,S=jt(Ft,n),[C,w]=u.useState(null),T=i(t,w),[E,D]=u.useState(null),O=l(E),k=O?.width??0,A=O?.height??0,j=r+(d===`center`?``:`-`+d),M=typeof g==`number`?g:{top:0,right:0,bottom:0,left:0,...g},N=Array.isArray(h)?h:[h],P=N.length>0,F={padding:M,boundary:N.filter(Ht),altBoundary:P},{refs:I,floatingStyles:ee,placement:L,isPositioned:R,middlewareData:z}=ht({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>et(...e,{animationFrame:y===`always`}),elements:{reference:S.anchor},middleware:[_t({mainAxis:o+A,alignmentAxis:f}),m&&vt({mainAxis:!0,crossAxis:!1,limiter:_===`partial`?yt():void 0,...F}),m&&bt({...F}),xt({...F,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`)}}),E&&Ct({element:E,padding:p}),Ut({arrowWidth:k,arrowHeight:A}),v&&St({strategy:`referenceHidden`,...F,boundary:P?F.boundary:void 0})]}),te=S.setPlacementState;s(()=>(te(L),()=>{te(void 0)}),[L,te]);let[ne,re]=Wt(L),ie=c(b);s(()=>{R&&ie?.()},[R,ie]);let ae=z.arrow?.x,oe=z.arrow?.y,se=z.arrow?.centerOffset!==0,[ce,le]=u.useState();return s(()=>{C&&le(window.getComputedStyle(C).zIndex)},[C]),(0,$.jsx)(`div`,{ref:I.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:R?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(It,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:D,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,$.jsx)(a.div,{"data-side":ne,"data-align":re,...x,ref:T,style:{...x.style,animation:R?void 0:`none`}})})})});Rt.displayName=Ft;var zt=`PopperArrow`,Bt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Vt=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Lt(zt,n),a=Bt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(Et,{...r,ref:t,style:{...r.style,display:`block`}})})});Vt.displayName=zt;function Ht(e){return e!==null}var Ut=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]=Wt(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 Wt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Gt=Mt,Kt=Pt,qt=Rt,Jt=Vt;export{kt as a,Gt as i,Jt as n,qt as r,Kt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{n as i}from"./dist-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{n as i}from"./dist-C_rn70hE.js";var a=e(t(),1),o=e(n(),1),s=r(),c=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=i(`Primitive.${t}`),r=a.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,s.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function l(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}function u(e,t=[]){let n=[];function r(t,r){let i=a.createContext(r);i.displayName=t+`Context`;let o=n.length;n=[...n,r];let c=t=>{let{scope:n,children:r,...c}=t,l=n?.[e]?.[o]||i,u=a.useMemo(()=>c,Object.values(c));return(0,s.jsx)(l.Provider,{value:u,children:r})};c.displayName=t+`Provider`;function l(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[o]||i,d=a.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[c,l]}let i=()=>{let t=n.map(e=>a.createContext(e));return function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,d(i,...t)]}function d(...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 a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function f(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var p=globalThis?.document?a.useLayoutEffect:()=>{},m=a.useInsertionEffect||p;function h({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,s]=g({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=a.useRef(e!==void 0);a.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,a.useCallback(t=>{if(c){let n=_(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}function g({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return m(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function _(e){return typeof e==`function`}export{c as a,u as i,p as n,l as o,f as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,n as i}from"./dist-C_rn70hE.js";import{i as a}from"./dist-Tubgdd25.js";var o=e(t(),1),s=n();function c(e){let t=e+`CollectionProvider`,[n,c]=a(t),[l,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=o.useRef(null),i=o.useRef(new Map).current;return(0,s.jsx)(l,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=i(f),m=o.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=r(t,u(f,n).collectionRef);return(0,s.jsx)(p,{ref:a,children:i})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=i(h),v=o.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,c=o.useRef(null),l=r(t,c),d=u(h,n);return o.useEffect(()=>(d.itemMap.set(c,{ref:c,...a}),()=>void d.itemMap.delete(c))),(0,s.jsx)(_,{[g]:``,ref:l,children:i})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));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:d,Slot:m,ItemSlot:v},y,c]}var l=o.createContext(void 0);function u(e){let t=o.useContext(l);return e||t||`ltr`}export{c as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,c as i,n as a,o}from"./dist-C_rn70hE.js";import{c as s,m as c,u as l}from"./design-icons-CzEoMH9c.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./dist-Tubgdd25.js";import{n as g,t as _}from"./dist-VPUfzsfL.js";import{a as ee,c as v,i as y,l as b,n as te,o as ne,r as x,t as S,u as C}from"./es2015-DpKptHDx.js";import{a as w,i as T,n as E,r as re,t as ie}from"./dist-DDhqweuB.js";var D=e(t(),1),O=!1;function k(){let[e,t]=D.useState(O);return D.useEffect(()=>{O||(O=!0,t(!0))},[]),e}var A=D.useSyncExternalStore;function j(){return()=>{}}function ae(){return A(j,()=>!0,()=>!1)}var M=typeof A==`function`?ae:k,N=n(),P=`rovingFocusGroup.onEntryFocus`,oe={bubbles:!1,cancelable:!0},F=`RovingFocusGroup`,[I,se,ce]=g(F),[le,ue]=d(F,[ce]),[de,fe]=le(F),pe=D.forwardRef((e,t)=>(0,N.jsx)(I.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,N.jsx)(I.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,N.jsx)(me,{...e,ref:t})})}));pe.displayName=F;var me=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,g=D.useRef(null),ee=r(t,g),y=_(o),[b,te]=h({prop:s,defaultProp:c??null,onChange:l,caller:F}),[ne,x]=D.useState(!1),S=v(d),C=se(n),w=D.useRef(!1),[T,E]=D.useState(0);return D.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(P,S),()=>e.removeEventListener(P,S)},[S]),(0,N.jsx)(de,{scope:n,orientation:i,dir:y,loop:a,currentTabStopId:b,onItemFocus:D.useCallback(e=>te(e),[te]),onItemShiftTab:D.useCallback(()=>x(!0),[]),onFocusableItemAdd:D.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:D.useCallback(()=>E(e=>e-1),[]),children:(0,N.jsx)(u.div,{tabIndex:ne||T===0?-1:0,"data-orientation":i,...p,ref:ee,style:{outline:`none`,...e.style},onMouseDown:m(e.onMouseDown,()=>{w.current=!0}),onFocus:m(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!ne){let t=new CustomEvent(P,oe);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);be([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),f)}}w.current=!1}),onBlur:m(e.onBlur,()=>x(!1))})})}),he=`RovingFocusGroupItem`,ge=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=b(),l=a||c,d=fe(he,n),p=d.currentTabStopId===l,h=se(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:ee}=d,v=M();return f(()=>{if(!(!v||!r))return g(),()=>_()},[v,r,g,_]),D.useEffect(()=>{if(!(v||!r))return g(),()=>_()},[v,r,g,_]),(0,N.jsx)(I.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,N.jsx)(u.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:m(e.onMouseDown,e=>{r?d.onItemFocus(l):e.preventDefault()}),onFocus:m(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:m(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ye(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?xe(n,r+1):n.slice(r+1)}setTimeout(()=>be(n))}}),children:typeof o==`function`?o({isCurrentTabStop:p,hasTabStop:ee!=null}):o})})});ge.displayName=he;var _e={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ve(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ye(e,t,n){let r=ve(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return _e[r]}function be(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Se=pe,Ce=ge,we=[`Enter`,` `],Te=[`ArrowDown`,`PageUp`,`Home`],Ee=[`ArrowUp`,`PageDown`,`End`],De=[...Te,...Ee],Oe={ltr:[...we,`ArrowRight`],rtl:[...we,`ArrowLeft`]},ke={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},L=`Menu`,[R,Ae,je]=g(L),[z,Me]=d(L,[je,w,ue]),B=w(),Ne=ue(),[Pe,V]=z(L),[Fe,H]=z(L),Ie=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=B(t),[c,l]=D.useState(null),u=D.useRef(!1),d=v(a),f=_(i);return D.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),D.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,N.jsx)(T,{...s,children:(0,N.jsx)(Pe,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,N.jsx)(Fe,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Ie.displayName=L;var Le=`MenuAnchor`,Re=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=B(n);return(0,N.jsx)(ie,{...i,...r,ref:t})});Re.displayName=Le;var ze=`MenuPortal`,[Be,Ve]=z(ze,{forceMount:void 0}),He=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=V(ze,t);return(0,N.jsx)(Be,{scope:t,forceMount:n,children:(0,N.jsx)(C,{present:n||a.open,children:(0,N.jsx)(y,{asChild:!0,container:i,children:r})})})};He.displayName=ze;var U=`MenuContent`,[Ue,W]=z(U),We=D.forwardRef((e,t)=>{let n=Ve(U,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=V(U,e.__scopeMenu),o=H(U,e.__scopeMenu);return(0,N.jsx)(R.Provider,{scope:e.__scopeMenu,children:(0,N.jsx)(C,{present:r||a.open,children:(0,N.jsx)(R.Slot,{scope:e.__scopeMenu,children:o.modal?(0,N.jsx)(Ge,{...i,ref:t}):(0,N.jsx)(Ke,{...i,ref:t})})})})}),Ge=D.forwardRef((e,t)=>{let n=V(U,e.__scopeMenu),i=D.useRef(null),a=r(t,i);return D.useEffect(()=>{let e=i.current;if(e)return S(e)},[]),(0,N.jsx)(G,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ke=D.forwardRef((e,t)=>{let n=V(U,e.__scopeMenu);return(0,N.jsx)(G,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qe=a(`MenuContent.ScrollLock`),G=D.forwardRef((e,t)=>{let{__scopeMenu:n,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,..._}=e,v=V(U,n),y=H(U,n),b=B(n),S=Ne(n),C=Ae(n),[w,T]=D.useState(null),E=D.useRef(null),ie=r(t,E,v.onContentChange),O=D.useRef(0),k=D.useRef(``),A=D.useRef(0),j=D.useRef(null),ae=D.useRef(`right`),M=D.useRef(0),P=g?te:D.Fragment,oe=g?{as:qe,allowPinchZoom:!0}:void 0,F=e=>{let t=k.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Et(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};D.useEffect(()=>()=>window.clearTimeout(O.current),[]),x();let I=D.useCallback(e=>ae.current===j.current?.side&&Ot(e,j.current?.area),[]);return(0,N.jsx)(Ue,{scope:n,searchRef:k,onItemEnter:D.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:D.useCallback(e=>{I(e)||(E.current?.focus(),T(null))},[I]),onTriggerLeave:D.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:A,onPointerGraceIntentChange:D.useCallback(e=>{j.current=e},[]),children:(0,N.jsx)(P,{...oe,children:(0,N.jsx)(ee,{asChild:!0,trapped:a,onMountAutoFocus:m(o,e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,N.jsx)(ne,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,children:(0,N.jsx)(Se,{asChild:!0,...S,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:m(l,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,N.jsx)(re,{role:`menu`,"aria-orientation":`vertical`,"data-state":St(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:ie,style:{outline:`none`,..._.style},onKeyDown:m(_.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&&F(e.key));let i=E.current;if(e.target!==i||!De.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);Ee.includes(e.key)&&a.reverse(),wt(a)}),onBlur:m(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:m(e.onPointerMove,Z(e=>{let t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>M.current?`right`:`left`;ae.current=t,M.current=e.clientX}}))})})})})})})});We.displayName=U;var Je=`MenuGroup`,K=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,N.jsx)(u.div,{role:`group`,...r,ref:t})});K.displayName=Je;var Ye=`MenuLabel`,Xe=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,N.jsx)(u.div,{...r,ref:t})});Xe.displayName=Ye;var q=`MenuItem`,Ze=`menu.itemSelect`,J=D.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:i,...a}=e,o=D.useRef(null),s=H(q,e.__scopeMenu),c=W(q,e.__scopeMenu),l=r(t,o),u=D.useRef(!1),d=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(Ze,{bubbles:!0,cancelable:!0});e.addEventListener(Ze,e=>i?.(e),{once:!0}),p(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,N.jsx)(Qe,{...a,ref:l,disabled:n,onClick:m(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:m(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:m(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||we.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});J.displayName=q;var Qe=D.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:i=!1,textValue:a,...o}=e,s=W(q,n),c=Ne(n),l=D.useRef(null),d=r(t,l),[f,p]=D.useState(!1),[h,g]=D.useState(``);return D.useEffect(()=>{let e=l.current;e&&g((e.textContent??``).trim())},[o.children]),(0,N.jsx)(R.ItemSlot,{scope:n,disabled:i,textValue:a??h,children:(0,N.jsx)(Ce,{asChild:!0,...c,focusable:!i,children:(0,N.jsx)(u.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:d,onPointerMove:m(e.onPointerMove,Z(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:m(e.onPointerLeave,Z(e=>s.onItemLeave(e))),onFocus:m(e.onFocus,()=>p(!0)),onBlur:m(e.onBlur,()=>p(!1))})})})}),$e=`MenuCheckboxItem`,et=D.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,N.jsx)(ct,{scope:e.__scopeMenu,checked:n,children:(0,N.jsx)(J,{role:`menuitemcheckbox`,"aria-checked":X(n)?`mixed`:n,...i,ref:t,"data-state":Ct(n),onSelect:m(i.onSelect,()=>r?.(X(n)?!0:!n),{checkForDefaultPrevented:!1})})})});et.displayName=$e;var tt=`MenuRadioGroup`,[nt,rt]=z(tt,{value:void 0,onValueChange:()=>{}}),it=D.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=v(r);return(0,N.jsx)(nt,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,N.jsx)(K,{...i,ref:t})})});it.displayName=tt;var at=`MenuRadioItem`,ot=D.forwardRef((e,t)=>{let{value:n,...r}=e,i=rt(at,e.__scopeMenu),a=n===i.value;return(0,N.jsx)(ct,{scope:e.__scopeMenu,checked:a,children:(0,N.jsx)(J,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Ct(a),onSelect:m(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ot.displayName=at;var st=`MenuItemIndicator`,[ct,lt]=z(st,{checked:!1}),ut=D.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=lt(st,n);return(0,N.jsx)(C,{present:r||X(a.checked)||a.checked===!0,children:(0,N.jsx)(u.span,{...i,ref:t,"data-state":Ct(a.checked)})})});ut.displayName=st;var dt=`MenuSeparator`,ft=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,N.jsx)(u.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});ft.displayName=dt;var pt=`MenuArrow`,mt=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=B(n);return(0,N.jsx)(E,{...i,...r,ref:t})});mt.displayName=pt;var ht=`MenuSub`,[gt,_t]=z(ht),vt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=V(ht,t),o=B(t),[s,c]=D.useState(null),[l,u]=D.useState(null),d=v(i);return D.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,N.jsx)(T,{...o,children:(0,N.jsx)(Pe,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,N.jsx)(gt,{scope:t,contentId:b(),triggerId:b(),trigger:s,onTriggerChange:c,children:n})})})};vt.displayName=ht;var Y=`MenuSubTrigger`,yt=D.forwardRef((e,t)=>{let n=V(Y,e.__scopeMenu),i=H(Y,e.__scopeMenu),a=_t(Y,e.__scopeMenu),o=W(Y,e.__scopeMenu),s=D.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=D.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);D.useEffect(()=>d,[d]),D.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=r(t,a.onTriggerChange);return(0,N.jsx)(Re,{asChild:!0,...u,children:(0,N.jsx)(Qe,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":St(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:m(e.onPointerMove,Z(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:m(e.onPointerLeave,Z(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:m(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||Oe[i.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});yt.displayName=Y;var bt=`MenuSubContent`,xt=D.forwardRef((e,t)=>{let n=Ve(U,e.__scopeMenu),{forceMount:i=n.forceMount,align:a=`start`,...o}=e,s=V(U,e.__scopeMenu),c=H(U,e.__scopeMenu),l=_t(bt,e.__scopeMenu),u=D.useRef(null),d=r(t,u);return(0,N.jsx)(R.Provider,{scope:e.__scopeMenu,children:(0,N.jsx)(C,{present:i||s.open,children:(0,N.jsx)(R.Slot,{scope:e.__scopeMenu,children:(0,N.jsx)(G,{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:m(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:m(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:m(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ke[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});xt.displayName=bt;function St(e){return e?`open`:`closed`}function X(e){return e===`indeterminate`}function Ct(e){return X(e)?`indeterminate`:e?`checked`:`unchecked`}function wt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Tt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Et(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=Tt(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 Dt(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 Ot(e,t){return t?Dt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var kt=Ie,At=Re,jt=He,Mt=We,Nt=K,Pt=Xe,Ft=J,It=et,Lt=it,Rt=ot,zt=ut,Bt=ft,Vt=mt,Ht=vt,Ut=yt,Wt=xt,Q=`DropdownMenu`,[Gt,Kt]=d(Q,[Me]),$=Me(),[qt,Jt]=Gt(Q),Yt=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=D.useRef(null),[u,d]=h({prop:i,defaultProp:a??!1,onChange:o,caller:Q});return(0,N.jsx)(qt,{scope:t,triggerId:b(),triggerRef:l,contentId:b(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,N.jsx)(kt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Yt.displayName=Q;var Xt=`DropdownMenuTrigger`,Zt=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:i=!1,...a}=e,o=Jt(Xt,n),s=$(n),c=r(t,o.triggerRef);return(0,N.jsx)(At,{asChild:!0,...s,children:(0,N.jsx)(u.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:m(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:m(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Zt.displayName=Xt;var Qt=`DropdownMenuPortal`,$t=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,N.jsx)(jt,{...r,...n})};$t.displayName=Qt;var en=`DropdownMenuContent`,tn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Jt(en,n),a=$(n),o=D.useRef(!1);return(0,N.jsx)(Mt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:m(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)`}})});tn.displayName=en;var nn=`DropdownMenuGroup`,rn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Nt,{...i,...r,ref:t})});rn.displayName=nn;var an=`DropdownMenuLabel`,on=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Pt,{...i,...r,ref:t})});on.displayName=an;var sn=`DropdownMenuItem`,cn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Ft,{...i,...r,ref:t})});cn.displayName=sn;var ln=`DropdownMenuCheckboxItem`,un=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(It,{...i,...r,ref:t})});un.displayName=ln;var dn=`DropdownMenuRadioGroup`,fn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Lt,{...i,...r,ref:t})});fn.displayName=dn;var pn=`DropdownMenuRadioItem`,mn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Rt,{...i,...r,ref:t})});mn.displayName=pn;var hn=`DropdownMenuItemIndicator`,gn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(zt,{...i,...r,ref:t})});gn.displayName=hn;var _n=`DropdownMenuSeparator`,vn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Bt,{...i,...r,ref:t})});vn.displayName=_n;var yn=`DropdownMenuArrow`,bn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Vt,{...i,...r,ref:t})});bn.displayName=yn;var xn=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$(t),[s,c]=h({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,N.jsx)(Ht,{...o,open:s,onOpenChange:c,children:n})},Sn=`DropdownMenuSubTrigger`,Cn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Ut,{...i,...r,ref:t})});Cn.displayName=Sn;var wn=`DropdownMenuSubContent`,Tn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,N.jsx)(Wt,{...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)`}})});Tn.displayName=wn;var En=Yt,Dn=Zt,On=$t,kn=tn,An=on,jn=cn,Mn=un,Nn=fn,Pn=mn,Fn=gn,In=vn,Ln=xn,Rn=Cn,zn=Tn;function Bn({...e}){return(0,N.jsx)(En,{"data-slot":`dropdown-menu`,...e})}function Vn({...e}){return(0,N.jsx)(On,{"data-slot":`dropdown-menu-portal`,...e})}function Hn({...e}){return(0,N.jsx)(Dn,{"data-slot":`dropdown-menu-trigger`,...e})}function Un({className:e,sideOffset:t=4,...n}){return(0,N.jsx)(On,{children:(0,N.jsx)(kn,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:o(`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 Wn({className:e,inset:t,variant:n=`default`,...r}){return(0,N.jsx)(jn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:o(`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 Gn({className:e,children:t,checked:n,...r}){return(0,N.jsxs)(Mn,{"data-slot":`dropdown-menu-checkbox-item`,className:o(`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),...i({checked:n}),...r,children:[(0,N.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,N.jsx)(Fn,{children:(0,N.jsx)(s,{className:`size-4`})})}),t]})}function Kn({...e}){return(0,N.jsx)(Nn,{"data-slot":`dropdown-menu-radio-group`,...e})}function qn({className:e,children:t,...n}){return(0,N.jsxs)(Pn,{"data-slot":`dropdown-menu-radio-item`,className:o(`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,N.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,N.jsx)(Fn,{children:(0,N.jsx)(c,{className:`size-2 fill-current`})})}),t]})}function Jn({className:e,inset:t,...n}){return(0,N.jsx)(An,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:o(`px-2 py-1.5 text-sm font-medium data-[inset]:ps-8`,e),...n})}function Yn({className:e,...t}){return(0,N.jsx)(In,{"data-slot":`dropdown-menu-separator`,className:o(`-mx-1 my-1 h-px bg-border`,e),...t})}function Xn({...e}){return(0,N.jsx)(Ln,{"data-slot":`dropdown-menu-sub`,...e})}function Zn({className:e,inset:t,children:n,...r}){return(0,N.jsxs)(Rn,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:o(`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,N.jsx)(l,{className:`ms-auto size-4`})]})}function Qn({className:e,...t}){return(0,N.jsx)(zn,{"data-slot":`dropdown-menu-sub-content`,className:o(`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{Jn as a,qn as c,Qn as d,Zn as f,Wn as i,Yn as l,Gn as n,Vn as o,Hn as p,Un as r,Kn as s,Bn as t,Xn as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i}from"./dist-BW234Kg5.js";import{a,n as o,o as s,r as c}from"./dist-C5mlVBmd.js";var l=e(t(),1);function u(e,t){return l.useReducer((e,n)=>t[e][n]??e,e)}var d=e=>{let{present:t,children:n}=e,r=f(t),i=typeof n==`function`?n({present:r.isPresent}):l.Children.only(n),a=m(r.ref,g(i));return typeof n==`function`||r.isPresent?l.cloneElement(i,{ref:a}):null};d.displayName=`Presence`;function f(e){let[t,n]=l.useState(),r=l.useRef(null),i=l.useRef(e),a=l.useRef(`none`),s=l.useRef(void 0),[c,d]=u(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return l.useEffect(()=>{c===`mounted`?(a.current=s.current??h(r.current),s.current=void 0):a.current=`none`},[c]),o(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=h(t);e?(s.current=o,d(`MOUNT`)):o===`none`||t?.display===`none`?d(`UNMOUNT`):d(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,d]),o(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=h(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(d(`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=h(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 d(`ANIMATION_END`)},[t,d]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:l.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=h(t)}else r.current=null;n(e)},[])}}function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function m(...e){let t=l.useRef(e);return t.current=e,l.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=p(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():p(n[e],null)}}},[])}function h(e){return e?.animationName||`none`}function g(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 _=l.useId||(()=>void 0),v=0;function y(e){let[t,n]=l.useState(_());return o(()=>{e||n(e=>e??String(v++))},[e]),e||(t?`radix-${t}`:``)}function b(e){let t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>((...e)=>t.current?.(...e)),[])}var x=r(),S=`DismissableLayer`,C=`dismissableLayer.update`,w=`dismissableLayer.pointerDownOutside`,ee=`dismissableLayer.focusOutside`,te,T=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),E=l.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...p}=e,m=l.useContext(T),[h,g]=l.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=l.useState({}),y=i(t,g),S=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),ee=w?S.indexOf(w):-1,E=h?S.indexOf(h):-1,ne=m.layersWithOutsidePointerEventsDisabled.size>0,D=E>=ee,O=l.useRef(!1),re=ie(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:_,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:l.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return D&&!t},[m.branches,D])}),A=ae(e=>{if(r&&O.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},_),j=h?E===S.length-1:!1,M=b(e=>{e.key===`Escape`&&(o?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return l.useEffect(()=>{if(j)return _.addEventListener(`keydown`,M,{capture:!0}),()=>_.removeEventListener(`keydown`,M,{capture:!0})},[_,j,M]),l.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(te=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),k(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=te))}},[h,_,n,m]),l.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),k())},[h,m]),l.useEffect(()=>{let e=()=>v({});return document.addEventListener(C,e),()=>document.removeEventListener(C,e)},[]),(0,x.jsx)(a.div,{...p,ref:y,style:{pointerEvents:ne?D?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,A.onFocusCapture),onBlurCapture:c(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,re.onPointerDownCapture)})});E.displayName=S;var ne=`DismissableLayerBranch`,D=l.forwardRef((e,t)=>{let n=l.useContext(T),r=l.useRef(null),o=i(t,r);return l.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,x.jsx)(a.div,{...e,ref:o})});D.displayName=ne;function O(){let e=l.useContext(T),[t,n]=l.useState(null);return l.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var re=()=>!0;function ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=re}=t,s=b(e),c=l.useRef(!1),u=l.useRef(!1),d=l.useRef(new Map),f=l.useRef(()=>{});return l.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function l(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&&!c.current){let l=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||A(w,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?l():(n.removeEventListener(`click`,f.current),f.current=l,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,l,!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,l,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function ae(e,t=globalThis?.document){let n=b(e),r=l.useRef(!1);return l.useEffect(()=>{let e=e=>{e.target&&!r.current&&A(ee,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 k(){let e=new CustomEvent(C);document.dispatchEvent(e)}function A(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?s(i,a):i.dispatchEvent(a)}var j=`focusScope.autoFocusOnMount`,M=`focusScope.autoFocusOnUnmount`,oe={bubbles:!1,cancelable:!0},se=`FocusScope`,ce=l.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[u,d]=l.useState(null),f=b(o),p=b(s),m=l.useRef(null),h=i(t,d),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let e=function(e){if(g.paused||!u)return;let t=e.target;u.contains(t)?m.current=t:N(m.current,{select:!0})},t=function(e){if(g.paused||!u)return;let t=e.relatedTarget;t!==null&&(u.contains(t)||N(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&N(u)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,u,g.paused]),l.useEffect(()=>{if(u){he.add(g);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(j,oe);u.addEventListener(j,f),u.dispatchEvent(t),t.defaultPrevented||(le(ve(de(u)),{select:!0}),document.activeElement===e&&N(u))}return()=>{u.removeEventListener(j,f),setTimeout(()=>{let t=new CustomEvent(M,oe);u.addEventListener(M,p),u.dispatchEvent(t),t.defaultPrevented||N(e??document.body,{select:!0}),u.removeEventListener(M,p),he.remove(g)},0)}}},[u,f,p,g]);let _=l.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ue(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&N(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&N(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,x.jsx)(a.div,{tabIndex:-1,...c,ref:h,onKeyDown:_})});ce.displayName=se;function le(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(N(r,{select:t}),document.activeElement!==n)return}function ue(e){let t=de(e);return[fe(t,e),fe(t.reverse(),e)]}function de(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 fe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):pe(r,{upTo:t})))return r}function pe(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 me(e){return e instanceof HTMLInputElement&&`select`in e}function N(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&me(e)&&t&&e.select()}}var he=ge();function ge(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=_e(e,t),e.unshift(t)},remove(t){e=_e(e,t),e[0]?.resume()}}}function _e(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ve(e){return e.filter(e=>e.tagName!==`A`)}var ye=e(n(),1),be=`Portal`,xe=l.forwardRef((e,t)=>{let{container:n,...r}=e,[i,s]=l.useState(!1);o(()=>s(!0),[]);let c=n||i&&globalThis?.document?.body;return c?ye.createPortal((0,x.jsx)(a.div,{...r,ref:t}),c):null});xe.displayName=be;var P=0,F=null;function Se(){l.useEffect(()=>{F||={start:Ce(),end:Ce()};let{start:e,end:t}=F;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),P++,()=>{P===1&&(F?.start.remove(),F?.end.remove(),F=null),P=Math.max(0,P-1)}},[])}function Ce(){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 I=function(){return I=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},I.apply(this,arguments)};function we(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 Te(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 L=`right-scroll-bar-position`,R=`width-before-scroll-bar`,Ee=`with-scroll-bars-hidden`,De=`--removed-body-scroll-bar-size`;function z(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Oe(e,t){var n=(0,l.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 ke=typeof window<`u`?l.useLayoutEffect:l.useEffect,Ae=new WeakMap;function je(e,t){var n=Oe(t||null,function(t){return e.forEach(function(e){return z(e,t)})});return ke(function(){var t=Ae.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||z(e,null)}),i.forEach(function(e){r.has(e)||z(e,a)})}Ae.set(n,e)},[e]),n}function Me(e){return e}function Ne(e,t){t===void 0&&(t=Me);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 Pe(e){e===void 0&&(e={});var t=Ne(null);return t.options=I({async:!0,ssr:!1},e),t}var Fe=function(e){var t=e.sideCar,n=we(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 l.createElement(r,I({},n))};Fe.isSideCarExport=!0;function Ie(e,t){return e.useMedium(t),Fe}var Le=Pe(),B=function(){},V=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:B,onWheelCapture:B,onTouchMoveCapture:B}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=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=we(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=je([n,t]),w=I(I({},x),i);return l.createElement(l.Fragment,null,d&&l.createElement(S,{sideCar:Le,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?l.cloneElement(l.Children.only(s),I(I({},w),{ref:C})):l.createElement(y,I({},w,{className:c,ref:C}),s))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},V.classNames={fullWidth:R,zeroRight:L};var Re,ze=function(){if(Re)return Re;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Be(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ze();return t&&e.setAttribute(`nonce`,t),e}function Ve(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function He(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ue=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Be())&&(Ve(t,n),He(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},We=function(){var e=Ue();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ge=function(){var e=We();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ke={left:0,top:0,right:0,gap:0},H=function(e){return parseInt(e||``,10)||0},qe=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[H(n),H(r),H(i)]},Je=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ke;var t=qe(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])}},Ye=Ge(),U=`data-scroll-locked`,Xe=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,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i}from"./dist-C_rn70hE.js";import{a,n as o,o as s,r as c}from"./dist-Tubgdd25.js";var l=e(t(),1);function u(e,t){return l.useReducer((e,n)=>t[e][n]??e,e)}var d=e=>{let{present:t,children:n}=e,r=f(t),i=typeof n==`function`?n({present:r.isPresent}):l.Children.only(n),a=m(r.ref,g(i));return typeof n==`function`||r.isPresent?l.cloneElement(i,{ref:a}):null};d.displayName=`Presence`;function f(e){let[t,n]=l.useState(),r=l.useRef(null),i=l.useRef(e),a=l.useRef(`none`),s=l.useRef(void 0),[c,d]=u(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return l.useEffect(()=>{c===`mounted`?(a.current=s.current??h(r.current),s.current=void 0):a.current=`none`},[c]),o(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=h(t);e?(s.current=o,d(`MOUNT`)):o===`none`||t?.display===`none`?d(`UNMOUNT`):d(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,d]),o(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=h(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(d(`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=h(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 d(`ANIMATION_END`)},[t,d]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:l.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=h(t)}else r.current=null;n(e)},[])}}function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function m(...e){let t=l.useRef(e);return t.current=e,l.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=p(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():p(n[e],null)}}},[])}function h(e){return e?.animationName||`none`}function g(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 _=l.useId||(()=>void 0),v=0;function y(e){let[t,n]=l.useState(_());return o(()=>{e||n(e=>e??String(v++))},[e]),e||(t?`radix-${t}`:``)}function b(e){let t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>((...e)=>t.current?.(...e)),[])}var x=r(),S=`DismissableLayer`,C=`dismissableLayer.update`,w=`dismissableLayer.pointerDownOutside`,ee=`dismissableLayer.focusOutside`,te,T=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),E=l.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...p}=e,m=l.useContext(T),[h,g]=l.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=l.useState({}),y=i(t,g),S=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),ee=w?S.indexOf(w):-1,E=h?S.indexOf(h):-1,ne=m.layersWithOutsidePointerEventsDisabled.size>0,D=E>=ee,O=l.useRef(!1),re=ie(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:_,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:l.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return D&&!t},[m.branches,D])}),A=ae(e=>{if(r&&O.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},_),j=h?E===S.length-1:!1,M=b(e=>{e.key===`Escape`&&(o?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return l.useEffect(()=>{if(j)return _.addEventListener(`keydown`,M,{capture:!0}),()=>_.removeEventListener(`keydown`,M,{capture:!0})},[_,j,M]),l.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(te=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),k(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=te))}},[h,_,n,m]),l.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),k())},[h,m]),l.useEffect(()=>{let e=()=>v({});return document.addEventListener(C,e),()=>document.removeEventListener(C,e)},[]),(0,x.jsx)(a.div,{...p,ref:y,style:{pointerEvents:ne?D?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,A.onFocusCapture),onBlurCapture:c(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,re.onPointerDownCapture)})});E.displayName=S;var ne=`DismissableLayerBranch`,D=l.forwardRef((e,t)=>{let n=l.useContext(T),r=l.useRef(null),o=i(t,r);return l.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,x.jsx)(a.div,{...e,ref:o})});D.displayName=ne;function O(){let e=l.useContext(T),[t,n]=l.useState(null);return l.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var re=()=>!0;function ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=re}=t,s=b(e),c=l.useRef(!1),u=l.useRef(!1),d=l.useRef(new Map),f=l.useRef(()=>{});return l.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function l(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&&!c.current){let l=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||A(w,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?l():(n.removeEventListener(`click`,f.current),f.current=l,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,l,!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,l,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function ae(e,t=globalThis?.document){let n=b(e),r=l.useRef(!1);return l.useEffect(()=>{let e=e=>{e.target&&!r.current&&A(ee,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 k(){let e=new CustomEvent(C);document.dispatchEvent(e)}function A(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?s(i,a):i.dispatchEvent(a)}var j=`focusScope.autoFocusOnMount`,M=`focusScope.autoFocusOnUnmount`,oe={bubbles:!1,cancelable:!0},se=`FocusScope`,ce=l.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[u,d]=l.useState(null),f=b(o),p=b(s),m=l.useRef(null),h=i(t,d),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let e=function(e){if(g.paused||!u)return;let t=e.target;u.contains(t)?m.current=t:N(m.current,{select:!0})},t=function(e){if(g.paused||!u)return;let t=e.relatedTarget;t!==null&&(u.contains(t)||N(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&N(u)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,u,g.paused]),l.useEffect(()=>{if(u){he.add(g);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(j,oe);u.addEventListener(j,f),u.dispatchEvent(t),t.defaultPrevented||(le(ve(de(u)),{select:!0}),document.activeElement===e&&N(u))}return()=>{u.removeEventListener(j,f),setTimeout(()=>{let t=new CustomEvent(M,oe);u.addEventListener(M,p),u.dispatchEvent(t),t.defaultPrevented||N(e??document.body,{select:!0}),u.removeEventListener(M,p),he.remove(g)},0)}}},[u,f,p,g]);let _=l.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ue(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&N(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&N(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,x.jsx)(a.div,{tabIndex:-1,...c,ref:h,onKeyDown:_})});ce.displayName=se;function le(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(N(r,{select:t}),document.activeElement!==n)return}function ue(e){let t=de(e);return[fe(t,e),fe(t.reverse(),e)]}function de(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 fe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):pe(r,{upTo:t})))return r}function pe(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 me(e){return e instanceof HTMLInputElement&&`select`in e}function N(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&me(e)&&t&&e.select()}}var he=ge();function ge(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=_e(e,t),e.unshift(t)},remove(t){e=_e(e,t),e[0]?.resume()}}}function _e(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ve(e){return e.filter(e=>e.tagName!==`A`)}var ye=e(n(),1),be=`Portal`,xe=l.forwardRef((e,t)=>{let{container:n,...r}=e,[i,s]=l.useState(!1);o(()=>s(!0),[]);let c=n||i&&globalThis?.document?.body;return c?ye.createPortal((0,x.jsx)(a.div,{...r,ref:t}),c):null});xe.displayName=be;var P=0,F=null;function Se(){l.useEffect(()=>{F||={start:Ce(),end:Ce()};let{start:e,end:t}=F;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),P++,()=>{P===1&&(F?.start.remove(),F?.end.remove(),F=null),P=Math.max(0,P-1)}},[])}function Ce(){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 I=function(){return I=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},I.apply(this,arguments)};function we(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 Te(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 L=`right-scroll-bar-position`,R=`width-before-scroll-bar`,Ee=`with-scroll-bars-hidden`,De=`--removed-body-scroll-bar-size`;function z(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Oe(e,t){var n=(0,l.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 ke=typeof window<`u`?l.useLayoutEffect:l.useEffect,Ae=new WeakMap;function je(e,t){var n=Oe(t||null,function(t){return e.forEach(function(e){return z(e,t)})});return ke(function(){var t=Ae.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||z(e,null)}),i.forEach(function(e){r.has(e)||z(e,a)})}Ae.set(n,e)},[e]),n}function Me(e){return e}function Ne(e,t){t===void 0&&(t=Me);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 Pe(e){e===void 0&&(e={});var t=Ne(null);return t.options=I({async:!0,ssr:!1},e),t}var Fe=function(e){var t=e.sideCar,n=we(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 l.createElement(r,I({},n))};Fe.isSideCarExport=!0;function Ie(e,t){return e.useMedium(t),Fe}var Le=Pe(),B=function(){},V=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:B,onWheelCapture:B,onTouchMoveCapture:B}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=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=we(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=je([n,t]),w=I(I({},x),i);return l.createElement(l.Fragment,null,d&&l.createElement(S,{sideCar:Le,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?l.cloneElement(l.Children.only(s),I(I({},w),{ref:C})):l.createElement(y,I({},w,{className:c,ref:C}),s))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},V.classNames={fullWidth:R,zeroRight:L};var Re,ze=function(){if(Re)return Re;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Be(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ze();return t&&e.setAttribute(`nonce`,t),e}function Ve(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function He(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ue=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Be())&&(Ve(t,n),He(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},We=function(){var e=Ue();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ge=function(){var e=We();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ke={left:0,top:0,right:0,gap:0},H=function(e){return parseInt(e||``,10)||0},qe=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[H(n),H(r),H(i)]},Je=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ke;var t=qe(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])}},Ye=Ge(),U=`data-scroll-locked`,Xe=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
|
.${Ee} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{et as i}from"./queries-ByqTmyCs.js";import{Fn as a,Ht as o}from"./toaster-Lf_4oY96.js";import{f as s,p as c}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{ot as l,w as u}from"./design-icons-CzEoMH9c.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{a as f}from"./diff-controls-QeCV3Sy1.js";import{t as p}from"./centered-state-BgSV4e79.js";import{a as m,i as h,r as g}from"./highlighter-Cfo7mLVB.js";import{n as _,t as v}from"./markdown-Djjm7pRl.js";import{r as y}from"./html-report-BX3msvci.js";import{t as b}from"./html-report-frame-Ck76gKfA.js";var x=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`}]]),S=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`}]]),C=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`}]]),w=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function T(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:w.has(t.slice(n+1).toLowerCase())}function E(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return T(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}var D=e(t(),1);function O(e){return e.tooLarge?`too-large`:E(e.path)?`image`:e.binary?`binary`:`text`}function k(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var A=n();function j({runId:e,path:t,className:n}){let r=i(e,t??void 0);if(t===null)return(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(u,{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,A.jsx)(R,{className:n,children:(0,A.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 a&&r.error.status===409;return(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:e?(0,A.jsx)(C,{}):(0,A.jsx)(l,{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,A.jsx)(P,{runId:e,entry:r.data,className:n}):(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(S,{}),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 M(e,t,n){let r=t?.replace(/\/+$/,``);if(r&&e.startsWith(`${r}/`))return e.slice(r.length+1);let i=/^.*\/\.ai\/(?:cezar|squawk)\/worktrees\/[^/]+\/(.+)$/.exec(e);if(i?.[1])return i[1];if(e.startsWith(`/`)&&n&&!n.startsWith(`/`)){let t=n.replace(/^\.?\//,``);if(t&&(e===`/${t}`||e.endsWith(`/${t}`)))return t}return e}function N(e,t,n){let r=t&&/\.(?:md|markdown)$/i.test(e.path),i=t&&y(e.path),a=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(e.path),o=t&&a&&e.size<=10*1024*1024?`image`:O(e);return{html:i,kind:o,toggle:(r||i)&&o===`text`,showImage:o===`image`&&(!t||a),rendered:n?null:r?`markdown`:i?`html`:null}}function P({runId:e,entry:t,displayPath:n,className:i,imageUrl:a,downloadUrl:o,snapshot:s,readerHref:c,documentPreview:l=!1}){let[u,d]=(0,D.useState)(!1),[p,m]=(0,D.useState)(!0),h=n??M(t.path),g=N(t,l,u),_=!!(s||o||g.toggle),v=!g.showImage&&g.kind===`text`&&g.rendered===null;return(0,A.jsxs)(R,{className:i,children:[(0,A.jsxs)(`header`,{"data-slot":`file-preview-head`,className:r(`flex min-h-11 items-center gap-2 border-b border-border bg-muted/40 ps-4 text-xs`,v?`pe-2 py-1`:`pe-4 py-2.5`),children:[(0,A.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium text-foreground`,title:h,children:h}),(0,A.jsx)(`span`,{"data-slot":`file-preview-size`,className:`ml-auto shrink-0 font-mono text-xs tabular-nums text-muted-foreground`,children:k(t.size)}),v?(0,A.jsx)(f,{wrap:p,onWrapChange:m,className:`size-8 rounded-md max-md:size-11 pointer-coarse:size-11`}):null]}),_?(0,A.jsx)(I,{snapshot:s,downloadUrl:o,source:g.toggle?u:null,onSource:()=>d(e=>!e),readerHref:g.html&&g.kind===`text`?c:void 0}):null,(0,A.jsx)(F,{runId:e,entry:t,kind:g.kind,showImage:g.showImage,rendered:g.rendered,imageUrl:a,wrap:p})]})}function F({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a,wrap:s}){return r?(0,A.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,A.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??o(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,A.jsx)(p,{icon:(0,A.jsx)(x,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${k(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,A.jsx)(p,{icon:(0,A.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${k(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(v,{document:!0,children:t.content??``})}):i===`html`?(0,A.jsx)(b,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,A.jsx)(V,{path:t.path,text:t.content??``,wrap:s})}function I({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,A.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,A.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,A.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,A.jsx)(L,{href:i}):null]})}function L({href:e}){let t=c(),n=s();return(0,A.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:r=>_(r,t,e,n),children:`Open reader`})}function R({className:e,children:t}){return(0,A.jsx)(`section`,{"data-slot":`file-preview`,className:r(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var z=1500;function B(e,t){let n=(0,D.useMemo)(()=>t.split(`
|
|
2
|
+
`).map(e=>[{content:e}]),[t]),r=(0,D.useMemo)(()=>m(e),[e]),i=n.length>z,[a,o]=(0,D.useState)(null);return(0,D.useEffect)(()=>{if(r===null||i)return;let n=!1;return g(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:h(t,r)?.tokens??n}function V({path:e,text:t,wrap:n=!1}){let i=B(e,t);return(0,A.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":m(e)??`plaintext`,className:`overflow-x-auto overscroll-x-contain py-2 font-mono text-xs leading-[1.7] [scrollbar-width:thin]`,children:(0,A.jsx)(`div`,{className:n?`min-w-0`:`w-max min-w-full`,children:i.map((e,t)=>(0,A.jsxs)(`div`,{className:`flex`,children:[(0,A.jsx)(`span`,{className:`sticky left-0 w-14 shrink-0 select-none bg-card pr-3 pl-4 text-right tabular-nums text-muted-foreground`,children:t+1}),(0,A.jsx)(`span`,{className:r(`min-w-0 flex-1 pr-6`,n?`whitespace-pre-wrap wrap-anywhere`:`whitespace-pre`),children:e.map((e,t)=>(0,A.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})})}export{k as a,S as c,M as i,x as l,P as n,E as o,j as r,C as s,V as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-C_rn70hE.js";import{_t as n}from"./queries-ByqTmyCs.js";import{Fn as r}from"./toaster-Lf_4oY96.js";import{t as i}from"./createLucideIcon-BHp8sXmF.js";import{t as a}from"./chevron-right-BENZ-1ZN.js";import{t as o}from"./folder-o-AvL3y3.js";var s=i(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),c=e(),l=`x-apple.systempreferences:com.apple.preference.security?Privacy_FilesAndFolders`,u=`inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-foreground hover:bg-muted`;function d(e){let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<0?null:n===0?t.slice(0,1):t.slice(0,n)}function f({path:e,selected:r,onSelect:i,onEnter:l,decorate:u,emptyHint:d,showHidden:f=!1}){let m=n(e,f),h=m.data?.parent??null;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`p`,{"data-slot":`fs-breadcrumb`,className:`truncate font-mono text-xs text-soft-foreground`,title:m.data?.path??void 0,children:m.data?.path??(m.isError?``:`Loading…`)}),m.isError?(0,c.jsx)(p,{error:m.error,path:e,onEnter:l,onRetry:()=>void m.refetch()}):(0,c.jsxs)(`ul`,{"data-slot":`fs-listing`,className:`max-h-64 divide-y divide-border/60 overflow-y-auto overscroll-contain rounded-md border border-border`,children:[h===null?null:(0,c.jsx)(`li`,{className:`flex`,children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-up`,onClick:()=>l(h),className:`flex flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,children:[(0,c.jsx)(s,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),`Up one level`]})}),(m.data?.dirs??[]).map(e=>(0,c.jsxs)(`li`,{className:`flex items-stretch`,children:[(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-dir`,"aria-pressed":r?.path===e.path,onClick:()=>i(e),onDoubleClick:()=>l(e.path),className:t(`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,r?.path===e.path&&`bg-muted`),children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`truncate`,children:e.name}),u?.(e)]}),(0,c.jsx)(`button`,{type:`button`,"data-slot":`fs-enter`,"aria-label":`Open ${e.name}`,onClick:()=>l(e.path),className:`flex shrink-0 items-center px-2.5 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,c.jsx)(a,{className:`size-3.5`,"aria-hidden":`true`})})]},e.path)),m.data&&m.data.dirs.length===0?(0,c.jsx)(`li`,{className:`px-3 py-2 text-[13px] text-muted-foreground`,children:d}):null]}),m.data?.truncated?(0,c.jsx)(`p`,{"data-slot":`fs-truncated`,className:`text-xs text-muted-foreground`,children:`Too many folders to list — only the first ones are shown.`}):null]})}function p({error:e,path:t,onEnter:n,onRetry:i}){let a=e instanceof r&&e.status===403,o=t===null?null:d(t);return(0,c.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,c.jsx)(`p`,{"data-slot":`fs-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:e instanceof Error?e.message:`could not list that folder`}),a?(0,c.jsx)(`p`,{"data-slot":`fs-privacy-hint`,className:`text-[12.5px] text-soft-foreground`,children:`Allow it under Privacy & Security ▸ Files & Folders, then try again.`}):null,(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[12.5px]`,children:[o===null?null:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-error-back`,onClick:()=>n(o),className:u,children:[(0,c.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),`Back`]}),a?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`a`,{"data-slot":`fs-privacy-settings`,href:l,target:`_blank`,rel:`noreferrer`,className:u,children:`Open Privacy Settings`}),(0,c.jsx)(`button`,{type:`button`,"data-slot":`fs-retry`,onClick:i,className:u,children:`Try again`})]}):null]})]})}function m(e,t,r=!1){let i=n(e,r);return t?.path??i.data?.path??null}export{m as n,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r,s as i}from"./dist-C_rn70hE.js";import{F as a,T as o,j as s,st as c,u as l}from"./design-icons-CzEoMH9c.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";import{t as d}from"./external-link-BE6y205O.js";import{a as f,i as p,n as m,r as h,t as g}from"./diff-controls-QeCV3Sy1.js";import{t as _}from"./square-terminal-B6RYYieR.js";import{t as v}from"./button-C8jUIs8Q.js";import{i as y,p as b,r as x,t as S}from"./dropdown-menu-BaqO-x7U.js";import{t as C}from"./diff-stat-Dy4uLuyP.js";var w=u(`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`}]]),T=u(`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`}]]),E=e(t(),1),D=n();function O({root:e,selected:t,onSelect:n}){return(0,D.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,D.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,D.jsx)(A,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,D.jsx)(M,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function k({adds:e,dels:t}){return(0,D.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs font-medium tabular-nums`,children:[e>0?(0,D.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,D.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,t]}):null]})}function A({dir:e,depth:t,selected:n,onSelect:i}){let[a,s]=(0,E.useState)(!0);return(0,D.jsxs)(`li`,{children:[(0,D.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>s(e=>!e),className:`flex min-h-11 md:min-h-8 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,D.jsx)(l,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,D.jsx)(o,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,D.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,D.jsx)(k,{adds:e.adds,dels:e.dels})]}),a?(0,D.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,D.jsx)(A,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,D.jsx)(M,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var j={added:`text-semantic-green`,deleted:`text-semantic-red`};function M({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,D.jsx)(`li`,{children:(0,D.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 md:min-h-8 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,D.jsx)(T,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,j[e.status])}),(0,D.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,D.jsx)(k,{adds:e.adds,dels:e.dels})]})})}function N(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function P(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(P)}}var F=(e,t)=>e.name.localeCompare(t.name);function I(e){let t=N(``,``),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=N(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(F),e.files.sort(F)};return i(t),{...t,dirs:t.dirs.map(P)}}function L({bar:e,healthReady:t,branch:n,stat:i,mode:a,wrap:o,preview:s=!1,onModeChange:c,onWrapChange:l,onPreviewChange:u,onAction:d}){let _=s&&u!==void 0;return(0,D.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-4 md:px-9 [&_button]:min-h-11`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[n?(0,D.jsx)(g,{branch:n}):null,i?(0,D.jsx)(B,{stat:i}):null]}),(0,D.jsxs)(`span`,{className:r(`ml-auto flex items-center gap-1.5`,!u&&`md:hidden`),children:[(0,D.jsx)(`span`,{className:`flex md:hidden`,children:(0,D.jsx)(f,{wrap:o,onWrapChange:l,disabled:_})}),_?(0,D.jsx)(h,{}):null,u?(0,D.jsx)(p,{preview:s,onPreviewChange:u}):null]}),(0,D.jsxs)(`span`,{className:r(`flex items-center gap-2 max-md:w-full`,!u&&`md:ml-auto`),children:[(0,D.jsx)(`span`,{className:`hidden items-center gap-1.5 md:flex`,children:(0,D.jsx)(m,{mode:a,wrap:o,onModeChange:c,onWrapChange:l,disabled:_})}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`hidden h-5 w-px bg-border md:block`}),(0,D.jsxs)(`span`,{"data-slot":`git-toolbar-actions`,className:`flex items-center gap-1.5 max-md:flex-1 max-md:[&>*]:flex-1`,children:[e.secondary.map(e=>(0,D.jsx)(z,{action:e,variant:`outline`,onAction:d},e.id)),(0,D.jsx)(z,{action:e.primary,variant:`primary`,onAction:d})]}),e.menu.length>0?(0,D.jsxs)(S,{children:[(0,D.jsx)(b,{asChild:!0,children:(0,D.jsx)(v,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,className:`max-md:min-w-11 max-md:border max-md:border-border max-md:bg-card`,children:(0,D.jsx)(w,{"aria-hidden":`true`})})}),(0,D.jsx)(x,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,D.jsxs)(y,{disabled:!e.enabled,title:e.reason,onSelect:()=>d(e.id),children:[R[e.id],e.label]},e.id))})]}):null]})]})}var R={commit:(0,D.jsx)(s,{size:16,"aria-hidden":`true`}),push:(0,D.jsx)(c,{size:16,"aria-hidden":`true`}),"create-pr":(0,D.jsx)(a,{size:16,"aria-hidden":`true`}),"view-pr":(0,D.jsx)(d,{"aria-hidden":`true`}),"open-terminal":(0,D.jsx)(_,{"aria-hidden":`true`})};function z({action:e,variant:t,onAction:n}){return e.id===`view-pr`?i(e.href)?(0,D.jsx)(v,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,D.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[R[e.id],e.label]})}):(0,D.jsxs)(v,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[R[e.id],e.label]}):(0,D.jsxs)(v,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[R[e.id],e.label]})}function B({stat:e}){return(0,D.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,D.jsx)(C,{stat:{adds:V(e.adds),dels:V(e.dels),files:e.files}})})}function V(e){let[t,n]=(0,E.useState)(e),r=(0,E.useRef)(e);return(0,E.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{O as i,L as n,I as r,B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r,p as i}from"./dist-C_rn70hE.js";import{M as a,Wt as o,cn as s,dn as c,i as l,k as u,l as d,o as f,r as p,s as m}from"./queries-ByqTmyCs.js";import{An as h,G as g,I as _,K as v,Si as y,U as b,hi as x,n as S,q as C}from"./toaster-Lf_4oY96.js";import{h as ee}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{F as w,I as T,X as E,Y as D,c as O,ct as k,l as A,ot as j,p as M,r as te}from"./design-icons-CzEoMH9c.js";import{t as ne}from"./chevron-down-CHGyCDBH.js";import{t as N}from"./chevron-right-BENZ-1ZN.js";import{t as P}from"./loader-circle-CPBhhDbB.js";import{t as re}from"./play-CmVAj_fu.js";import{t as F}from"./button-C8jUIs8Q.js";import{a as I,i as L,n as ie,r as R,t as ae}from"./select-CvnOk0OI.js";import{i as z,r as B,t as V}from"./popover-CVo54-aS.js";import{r as oe,t as H}from"./project-router-CEnizJ8F.js";import"./attention-CnhIF76m.js";import{f as se,v as ce}from"./task-groups-BRrlyl5P.js";import{t as le}from"./status-dot-BXf-Ubd0.js";import{a as ue,o as de,r as fe,s as pe,t as me}from"./command-DuxcX6Hr.js";import{d as he,s as U,u as W}from"./page-shell-CpdYMj52.js";import{t as G}from"./centered-state-BgSV4e79.js";import{t as ge}from"./use-search-params-writer-ClMScnNe.js";import{Ct as _e,Dt as ve,Et as ye,Nn as be,Ot as xe,Qt as Se,Rn as Ce,St as we,Tt as Te,_t as Ee,bt as De,gt as Oe,ht as ke,kn as Ae,r as je,s as Me,st as Ne,vt as Pe,wt as Fe,xn as K,xt as Ie,yt as Le}from"./index-B0_haEFL.js";import{a as Re,d as ze,f as Be,i as Ve,l as He,n as Ue,o as We,r as Ge,s as Ke,t as qe,u as q}from"./use-hand-to-agent-state-C3NlsVVQ.js";import{t as Je}from"./tab-link-3A_SF95U.js";var J=e(t(),1),Ye=`cez-github-list-width`;function Y(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function Xe(){try{let e=localStorage.getItem(Ye);return e===null?360:Y(e)}catch{return 360}}function Ze(e){try{localStorage.setItem(Ye,String(Y(e)))}catch{}}var X=n();function Qe({number:e,repo:t}){let n=i();return(0,X.jsx)($e,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function $e({number:e,repo:t,scope:n}){let i=(0,J.useId)(),o=(0,J.useId)(),[c,l]=(0,J.useState)(!1),u=c?ne:N,d=s(n,!0,n==="default"),f=a(`#${e}`,!0),p=(0,J.useMemo)(()=>Te(ce(d.data??[],f.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[d.data,f.data,e,t,n]);return(0,X.jsxs)(`section`,{"aria-labelledby":i,className:r(`mt-4 min-w-0 rounded-lg border border-border`,c?`p-3`:`p-0.5`),children:[(0,X.jsx)(`h3`,{id:i,className:`text-xs font-semibold text-muted-foreground`,children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":c,"aria-controls":o,onClick:()=>l(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(u,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,X.jsxs)(`span`,{children:[`Linked tasks`,d.data?` (${p.length}${f.hasNextPage||f.isError?`+`:``})`:``]})]})}),(0,X.jsx)(`div`,{id:o,children:c?(0,X.jsxs)(X.Fragment,{children:[d.isPending?(0,X.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,d.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,X.jsx)(F,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry linked tasks`})]}):null,d.data&&p.length===0&&!d.isError?(0,X.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,p.length>0?(0,X.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:p.map(e=>{let t=Ae(e,h(e));return(0,X.jsx)(`li`,{children:(0,X.jsxs)(H,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:se(e)}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(le,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,X.jsx)(je,{"data-slot":`linked-task-archived`,dot:K.tone,shape:K.shape,className:`px-2 py-px`,children:K.label}):null,(0,X.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,f.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,X.jsx)(F,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void f.refetch(),disabled:f.isFetching,children:`Retry older linked tasks`})]}):f.hasNextPage?(0,X.jsx)(F,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void f.fetchNextPage(),disabled:f.isFetchingNextPage,children:f.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var et=`w-44 max-w-full`,Z=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-ring disabled:opacity-60`,Q=`__all__`;function tt(e,t){let n=new Map;for(let t of e)for(let e of t.assignees??[])n.set(e.toLowerCase(),e);for(let e of t)n.set(e.toLowerCase(),e);return[...n.values()].sort((e,t)=>e.localeCompare(t))}function nt(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function rt(e){let t=` Previous memberships are shown; issues with unknown membership remain visible.`;return e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${t}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${t}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`)}function it(e){return[e.viewerLogin?``:`GitHub login unavailable.`,rt(e)].filter(Boolean).join(` `)}function at({options:e,assignees:t,onAssigneesChange:n}){return(0,X.jsxs)(V,{children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:`${Z} inline-flex items-center gap-1.5`,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,X.jsx)(A,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(B,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,X.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,X.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),e.map(e=>{let r=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,X.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,X.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function ot({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,X.jsxs)(ae,{value:t||Q,onValueChange:e=>n(e===Q?``:e),children:[(0,X.jsx)(L,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${Z} ${et} justify-between`,children:(0,X.jsx)(I,{placeholder:`All boards`})}),(0,X.jsxs)(ie,{align:`start`,children:[(0,X.jsx)(R,{value:Q,children:`All boards`}),e.projects.map(e=>(0,X.jsx)(R,{value:e.id,"data-board":e.id,children:e.title},e.id))]})]});if(e.projects||e.projectsState){let t=e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`;return(0,X.jsxs)(ae,{disabled:!0,value:Q,children:[(0,X.jsx)(L,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${Z} ${et} justify-between`,children:(0,X.jsx)(I,{placeholder:t,children:t})}),(0,X.jsx)(ie,{align:`start`,children:(0,X.jsx)(R,{value:Q,children:t})})]})}return null}function st({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,X.jsxs)(V,{open:i,onOpenChange:a,children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsx)(`button`,{ref:o,type:`button`,className:`${Z} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,X.jsx)(D,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,X.jsx)(j,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,X.jsx)(B,{ref:s,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{r||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:t||n.current})]})]})}function ct({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,J.useState)(!1),s=(0,J.useRef)(null),c=(0,J.useRef)(null),l=(0,J.useRef)(null),u=(0,J.useRef)(null),d=tt(e.issues,t),f=nt(e.viewerLogin,t),p=it(e),m=p!==``,h=(0,J.useRef)(p);m&&(h.current=p);let g=(0,J.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,J.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{g.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&_()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,J.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,X.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,X.jsx)(at,{options:d,assignees:t,onAssigneesChange:r}),(0,X.jsxs)(`button`,{ref:u,type:`button`,"data-slot":`gh-assigned-me`,className:`${Z} inline-flex items-center gap-1.5 rounded-full aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:[(0,X.jsx)(k,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,X.jsx)(ot,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,X.jsx)(st,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function lt({onRefresh:e,refreshing:t}){let n=ke(i());return(0,X.jsx)(W,{route:`github`,density:`full`,headerSpacing:`compact`,header:{title:`GitHub`,secondaryActions:(0,X.jsx)(U,{type:`button`,variant:`ghost`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,children:(0,X.jsx)(D,{size:17,"aria-hidden":`true`,className:r(`size-[17px]`,t&&`motion-safe:animate-spin`)})})},children:(0,X.jsx)(`div`,{"data-slot":`github-filter-screen`,children:(0,X.jsx)(Oe,{model:n,variant:`screen`})})})}function ut({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a,actions:o}){return{headerSlot:`gh-masthead`,title:n?e===`issues`?`Issues`:`Pull requests`:`GitHub`,scope:n?Ee[t]:void 0,scopeSlot:`gh-title-qualifier`,subtitle:a.repo?(0,X.jsxs)(`span`,{className:`block min-w-0 truncate`,children:[(0,X.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,X.jsxs)(`span`,{"data-slot":`gh-synced`,title:a.syncedAt?new Date(a.syncedAt).toLocaleString():void 0,children:[` `,`· `,a.syncedAt?(0,X.jsx)(be,{iso:a.syncedAt,prefix:`Synced `}):`Not synced yet`]})]}):void 0,secondaryActions:(0,X.jsx)(dt,{...o}),headerExtra:r!==null&&i===void 0?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`mt-1 flex min-w-0 items-center gap-3 md:hidden`,children:[(0,X.jsxs)(H,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,X.jsx)(te,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,X.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-muted-foreground`,children:[...Le,...De].find(e=>e.id===t)?.label})]}):void 0}}function dt({automationsAvailable:e,refreshing:t,onRefresh:n}){return(0,X.jsxs)(`div`,{"data-slot":`gh-page-actions`,className:`flex shrink-0 flex-wrap items-center gap-2`,children:[e?(0,X.jsx)(U,{variant:`outline`,asChild:!0,children:(0,X.jsx)(H,{to:`/automations/new`,children:`Set up automations`})}):null,(0,X.jsxs)(U,{type:`button`,variant:`outline`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,children:[(0,X.jsx)(D,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function ft({view:e,number:t}){return(0,X.jsx)(G,{icon:e===`issues`?(0,X.jsx)(M,{size:16}):(0,X.jsx)(w,{size:16}),tone:`neutral`,heading:`h2`,title:t===null?`Nothing selected`:`Not found`,subtitle:t===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${t} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${t} above to look it up on GitHub, closed and merged included.`})}function pt({item:e,view:t,filter:n,colors:i,active:a,queued:s,checks:c,comments:l}){let u=e.kind===`issue`?M:w,d=x(),f=()=>{d.prefetchQuery({queryKey:o.githubComments(e.kind,e.number),queryFn:({signal:t})=>v(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,X.jsxs)(H,{to:we(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Ge(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:f,onFocus:f,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":a?`page`:void 0,title:`Drag into the composer to prefill a task`,className:r(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,a&&`bg-accent-strong/10 text-accent-text`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,X.jsx)(u,{"aria-hidden":`true`,"data-slot":`gh-row-icon`,className:r(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,X.jsx)(`span`,{"data-slot":`gh-row-title`,className:r(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,a&&`font-semibold`),children:e.title})]}),(0,X.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 pl-[22px] text-xs text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[`#`,e.number]}),(0,X.jsx)($,{}),(0,X.jsx)(`span`,{"data-slot":`gh-row-author`,className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,X.jsx)($,{}),(0,X.jsx)(be,{iso:e.createdAt,className:`shrink-0`}),l?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(Re,{count:l})]}):null,c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(Ve,{checks:c})]}):null,s?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`shrink-0 font-sans font-medium text-accent-text`,children:`↗ run queued`})]}):null]}),e.labels.length>0?(0,X.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,X.jsx)(Ke,{label:e,color:i[e],plain:!0},e))}):null]})}function $(){return(0,X.jsx)(`span`,{"data-slot":`gh-row-dot`,"aria-hidden":`true`,className:`shrink-0`,children:`·`})}function mt(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function ht(e){let[t,n]=(0,J.useState)(null);return(0,J.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(mt(e));t();let r=typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 768px)`):null;r?.addEventListener(`change`,t);let i=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return i?.observe(e),()=>{r?.removeEventListener(`change`,t),i?.disconnect()}},[e]),t}function gt(e,t){let[n,r]=(0,J.useState)(0);return(0,J.useLayoutEffect)(()=>{let n=()=>{!e||!t||r(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return n(),window.addEventListener(`resize`,n),()=>window.removeEventListener(`resize`,n)},[e,t]),n}function _t(e,t,n){let[r,i]=(0,J.useState)(null),a=(0,J.useRef)(n);return(0,J.useEffect)(()=>{a.current=n}),(0,J.useEffect)(()=>{if(!e||!r||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&a.current()},{root:t.getAttribute(`data-slot`)===`main`?null:t,rootMargin:`0px 0px 600px 0px`});return n.observe(r),()=>n.disconnect()},[e,r,t]),i}function vt(e,t,n,r,i){let[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null),l=ht(a),u=(0,J.useRef)(null);u.current=l;let d=gt(s,l),f=e===`issues`?n?.issues.length??0:n?.prs.length??0,p=t.hasNextPage&&r===null&&f>0;return{listEl:a,setListEl:o,setRowsEl:c,scrollOwner:l,scrollOwnerRef:u,startMargin:d,pagingAvailable:p,manualPaging:p&&i,loadMoreRef:_t(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function yt({item:e,queuedRunId:t}){return t?(0,X.jsx)(F,{asChild:!0,variant:`outline`,size:`sm`,className:`max-md:h-11 no-hover:h-11`,children:(0,X.jsxs)(H,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,X.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,X.jsxs)(F,{type:`button`,variant:`primary`,size:`sm`,"data-action":`gh-header-handoff`,title:`Write the prompt and pick the workflow and runner for this ${e.kind===`pr`?`PR`:`issue`}`,className:`max-md:h-11 no-hover:h-11`,onClick:bt,children:[(0,X.jsx)(re,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}function bt(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}var xt=100;function St(e,t,n,r,i){if(!e?.available||t!==`prs`)return[];let a=new Set;n!==null&&Number.isInteger(n)&&a.add(n);for(let t of[...r,...i,...e.prs]){if(a.size>=xt)break;a.add(t.number)}return[...a]}function Ct(e,t,n,r,i,a){let o=St(n,e,r,i,a),s=p(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,u=l(e===`issues`?`issue`:`pr`,(0,J.useMemo)(()=>(t.data?.pages??[]).map(t=>(e===`issues`?t.issues:t.prs).map(e=>e.number)),[t.data,e]),n?.available===!0&&n.commentsDeferred===!0),d=(0,J.useMemo)(()=>new Set(n?.commentsDeferred?(e===`issues`?n.issues:n.prs).map(e=>e.number):[]),[n,e]);return{checkPrNumbers:o,checksMap:c,commentsOf:e=>u[e.number]??(d.has(e.number)?void 0:e.comments)}}function wt(e){let[t,n]=ge(),r=t.get(`filter`),i=ye(e,r);return{rawFilterParam:r,filter:i,activeFilter:i??`all`,setFilterParam:e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n})}}function Tt(e,t,{filter:n,activeFilter:r,setFilterParam:i}){let[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)([]),[l,u]=(0,J.useState)([]),{setProjectFilter:d,activeProject:f}=Et(t),p=e===`issues`&&r===`assigned`,m=p?t?.viewerLogin?[t.viewerLogin]:[]:l;return{query:a,setQuery:o,labelFilter:s,setLabelFilter:c,setProjectFilter:d,activeProject:f,isAssignedFilter:p,effectiveAssignees:m,changeAssignees:e=>{u(e),p&&i(`all`)},clearFilters:()=>{o(``),c([]),u([]),d(``),n!==null&&n!==`all`&&i(`all`)},filtering:a.trim()!==``||s.length>0||e===`issues`&&(m.length>0||f!==``)||n!==null&&n!==`all`,narrowing:a.trim()!==``||s.length>0||e===`issues`&&(!p&&l.length>0||f!==``)}}function Et(e){let[t,n]=(0,J.useState)(``),r=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,i=r||e?.projects?.some(e=>e.id===t)?t:``;return(0,J.useEffect)(()=>{e&&!r&&t&&!i&&n(``)},[e,t,i,r]),{setProjectFilter:n,activeProject:i}}function Dt(e,t,{filter:n,activeFilter:r},a){let o=i(),c=e===`issues`&&(r===`no-task`||r===`has-task`),l=s(o,c,o==="default"),u=(0,J.useMemo)(()=>l.data?Fe(l.data,t?.repo,o):null,[l.data,t?.repo,o]),f=_e(e,n)?xe(n):null,p=d(`pr`,f??``,f!==null&&t?.available===!0),m=f!==null&&p.data?.available?p.data.items:null,h=(0,J.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),g=(0,J.useMemo)(()=>m?ve(m,h):null,[m,h]),_=Ot({view:e,gh:t,activeFilter:r,isAssignedFilter:a,taskFilter:c,taskNumbers:u,runsQuery:l,backedQuery:f,filterHits:m,filterSearch:p});return{backedQuery:f,filterSearch:p,fullList:h,filterRows:g,filterGate:_,openItems:(0,J.useMemo)(()=>_?[]:g??h,[_,g,h]),narrow:(0,J.useMemo)(()=>e===`issues`?r===`no-task`&&u?{excludeNumbers:u}:r===`has-task`&&u?{includeNumbers:u}:{}:r===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:m?{includeNumbers:new Set(m.map(e=>e.number))}:{},[e,r,u,t?.viewerLogin,m])}}function Ot({view:e,gh:t,activeFilter:n,isAssignedFilter:r,taskFilter:i,taskNumbers:a,runsQuery:o,backedQuery:s,filterHits:c,filterSearch:l}){return t?.available?(r||e===`prs`&&n===`mine`)&&!t.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:i&&!a?o.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:s!==null&&!c?l.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${l.data.reason??`unknown reason`}.`}:l.isError?{kind:`blocked`,message:`GitHub could not be searched: ${l.error instanceof Error?l.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null}function kt(e,t){return t?C(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function At(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let s=o.github()[0],c=t===void 0?null:Number.parseInt(t,10),l=!r&&n.data?.available?n.data.items.find(e=>e.number===c):void 0,u=i&&c!==null&&!a.some(e=>e.number===c)?i.find(e=>e.number===c):void 0,d=l??u,[f,p]=(0,J.useState)(null);return(0,J.useEffect)(()=>{d&&p({scope:s,view:e,item:d})},[s,e,d]),{selectedNumber:c,remoteDetail:d??(f?.scope===s&&f.view===e&&f.item.number===c?f.item:null)}}function jt(e,t,n,{fullList:r,filterRows:i},a){let s=x(),c=(0,J.useRef)(null),l=e===`issues`?`issue`:`pr`,u=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,d=f(l,n??0,u),p=u&&d.data?.available&&d.data.item?.kind===l?d.data.item:null;c.current=u&&n!==null?{kind:l,number:n,key:o.githubItem(l,n)}:null;let[m,h]=(0,J.useState)(!1);return{exactWanted:u,exactItem:d,exactDetail:p,exactTargetRef:c,retryingExact:m,retryExact:()=>{h(!0),kt(s,c.current).then(e=>{h(!1),e||S(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function Mt(e,t,n){let r=x(),i=(0,J.useRef)(null);return{refresh:c({mutationFn:e=>(kt(r,e),b({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:o.githubPages(50),exact:!0}),r.setQueryData(o.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:o.githubChecks(t)});let s=e===`issues`?`issue`:`pr`,c=(e===`issues`?a.issues:a.prs).map(e=>e.number),l=o.githubCommentCounts(s,c);r.removeQueries({queryKey:o.githubCommentCounts(s,[]).slice(0,4),predicate:e=>e.queryHash!==y(l)}),a.available&&a.commentsDeferred&&c.length>0&&g(s,c,{refresh:!0}).then(e=>r.setQueryData(l,e)).catch(()=>{}),r.invalidateQueries({queryKey:o.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:o.githubSearch(`pr`,Ie)}),r.invalidateQueries({queryKey:o.githubSearch(`pr`,Pe)});let u=i.current,d=o.githubComments(`issue`,0).slice(0,3);if(!u){r.removeQueries({queryKey:d});return}let f=o.githubComments(u.kind,u.number);v(u.kind,u.number,{refresh:!0}).then(e=>r.setQueryData(f,e)).catch(()=>{}),r.removeQueries({queryKey:d,predicate:e=>e.queryHash!==y(f)})},onError:e=>S(e.message,{tone:`danger`})}),openThreadRef:i}}var Nt=350;function Pt(e,t){let[n,r]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Ft(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=Pt(n,Nt),u=(0,J.useMemo)(()=>q(o,{query:l,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,l,r,e,i,a,s]),f=n.trim()===l.trim(),p=t?.available===!0&&!c&&f&&Be(l,u),m=d(e===`issues`?`issue`:`pr`,l,p),h=q(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),g=p&&m.data?.available?m.data:null,_=new Set(h.map(e=>e.number)),v=It(e,g,a,i);return{debouncedQuery:l,searchWanted:p,forgeSearch:m,items:h,searchPayload:g,metadataFailure:v,searchHits:g&&!v?q(g.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!_.has(e.number)):[],...Lt(n,f,p,m)}}function It(e,t,n,r){return e===`issues`&&t?n&&t.items.some(e=>e.projectIds===void 0)?t.projectsReason??`Project board data is incomplete. Refresh to try again.`:r.length&&t.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null}function Lt(e,t,n,r){return{searching:e.trim()!==``&&!t||n&&r.isPending,searchFailed:n&&(r.data?.available===!1||r.isError),searchFailureReason:r.data?.available===!1?r.data.reason??`unknown reason`:r.error instanceof Error?r.error.message:`the search request failed`}}function Rt({width:e,onWidthChange:t}){let n=(0,J.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(Y(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,X.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(Y(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function zt({view:e,changes:t=!1,index:n=!1}){let{n:r}=ee(),i=wt(e),{rawFilterParam:a,activeFilter:o}=i,s=Se(),{pages:c,data:l}=m(50),d=Ce(),f=Vt(),p=qe(),h=Bt({index:n,isDesktop:s,rawFilterParam:a,n:r,rememberedView:u().data?.githubView}),g=Ht(l?.available===!0&&!h.filterScreen),[_,v]=(0,J.useState)(!1),y=Tt(e,l,i),b=Dt(e,l,i,y.isAssignedFilter),x=Ft(e,l,y,b),S=At(e,r,x.forgeSearch,b),C=jt(e,l,S.selectedNumber,b,S.remoteDetail),w=Ct(e,c,l,S.selectedNumber,x.searchHits,b.openItems),{refresh:T,openThreadRef:E}=Mt(e,w.checkPrNumbers,x.debouncedQuery),D=vt(e,c,l,b.backedQuery,y.narrowing);if(h.restorePrs)return(0,X.jsx)(oe,{to:`/github/prs`,replace:!0});if(!l)return c.isError?(0,X.jsx)(W,{route:`github`,density:`empty`,children:(0,X.jsx)(G,{icon:(0,X.jsx)(j,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:c.error.message})}):(0,X.jsx)(Ne,{});E.current=null;let O=()=>T.mutate(C.exactTargetRef.current);if(h.filterScreen&&l.available)return(0,X.jsx)(lt,{onRefresh:O,refreshing:T.isPending});if(!l.available)return(0,X.jsx)(qt,{reason:l.reason,refreshing:T.isPending,onRetry:O});let{labelColors:k,labelOptions:A}=Ut(l,x.searchPayload,b.openItems,b.fullList),M=Wt({number:S.selectedNumber,items:x.items,searchHits:x.searchHits,fullList:b.fullList,filterRows:b.filterRows,remoteDetail:S.remoteDetail,exactDetail:C.exactDetail});E.current=M?{kind:M.kind,number:M.number}:null;let{linkFilter:te,listPath:ne}=Gt(e,a,o,s),N={view:e,filter:te,colors:k,selected:M,queued:p.queued,checksMap:w.checksMap,commentsOf:w.commentsOf},P=Kt(e,y,b.filterGate,x),re=he(x.items.length+x.searchHits.length);return(0,X.jsx)(W,{rootRef:g.routeRef,route:`github`,density:re,headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,bodyClassName:`gap-2.5`,header:ut({view:e,activeFilter:o,isDesktop:s,rawFilterParam:a,n:r,gh:l,actions:{automationsAvailable:d,refreshing:T.isPending,onRefresh:O}}),children:(0,X.jsxs)(`div`,{ref:g.workspaceRef,"data-slot":`gh-workspace`,"data-stacked":g.panesStacked,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 md:h-[calc(var(--gh-workspace-height,calc(100dvh-4rem))-1rem)] md:flex-none md:gap-5`,children:[(0,X.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-4`,children:[(0,X.jsx)(Jt,{view:e,isDesktop:s,gh:l,onSaveView:f}),(0,X.jsx)(Yt,{view:e,gh:l,filters:y,labelOptions:A,labelColors:k,searchPayload:x.searchPayload})]}),(0,X.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row md:items-stretch md:overflow-hidden`,children:[(0,X.jsx)(Qt,{view:e,n:r,rows:N,verdict:P,search:x,sidebar:b,list:c,paging:D,width:g.githubListWidth,onWidthChange:g.changeGithubListWidth,expanded:_,onExpandedChange:v}),(0,X.jsx)(an,{view:e,n:r,selected:M,selectedNumber:S.selectedNumber,exact:C,repo:l.repo,rows:N,listPath:ne,changes:t,handToAgent:p})]})]})})}function Bt({index:e,isDesktop:t,rawFilterParam:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&n===null&&r===void 0,restorePrs:e&&t&&n===null&&i===`prs`}}function Vt(){let e=x();return t=>{e.setQueryData(o.uiState,e=>({...e,githubView:t})),_({githubView:t}).then(t=>e.setQueryData(o.uiState,t)).catch(t=>{S(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:o.uiState})})}}function Ht(e){let[t,n]=(0,J.useState)(Xe),[r,i]=(0,J.useState)(!0),a=(0,J.useRef)(null),o=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(!e)return;let n=a.current,r=o.current,s=n?.closest(`[data-slot="main"]`);if(!n||!r||!s)return;let c=window.matchMedia(`(min-width: 768px)`),l=!1,u=()=>{if(l=c.matches&&r.clientWidth>=t+22+360,i(!l),!l||s.clientHeight<1){n.style.removeProperty(`--gh-workspace-height`);return}n.style.setProperty(`--gh-workspace-height`,`${Math.round(s.clientHeight)}px`)};u();let d=new ResizeObserver(u);d.observe(s),d.observe(r);let f=e=>{if(!l||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||r.getBoundingClientRect().top<=s.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let t=e.deltaMode===1?16:e.deltaMode===2?s.clientHeight:1;s.scrollTop+=e.deltaY*t};return r.addEventListener(`wheel`,f,{passive:!1}),c.addEventListener(`change`,u),()=>{r.removeEventListener(`wheel`,f),d.disconnect(),c.removeEventListener(`change`,u)}},[e,t]),{githubListWidth:t,changeGithubListWidth:e=>{let t=Y(e);n(t),Ze(t)},panesStacked:r,routeRef:a,workspaceRef:o}}function Ut(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:He([...n,...r,...t?.items??[]])}}function Wt({number:e,items:t,searchHits:n,fullList:r,filterRows:i,remoteDetail:a,exactDetail:o}){return e===null?t[0]??n[0]??null:r.find(t=>t.number===e)??i?.find(t=>t.number===e)??a??o??null}function Gt(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:we(e,i??(e===`issues`&&!r?`all`:null))}}function Kt(e,{query:t,filtering:n},r,{searching:i,searchFailed:a,searchFailureReason:o,metadataFailure:s,searchHits:c,searchPayload:l,items:u}){let d=e===`issues`?`issues`:`pull requests`;return r?(0,X.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":r.kind,children:[r.kind===`loading`?(0,X.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,X.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,X.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,X.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,X.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,X.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,X.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,X.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,`.`]})}function qt({reason:e,refreshing:t,onRetry:n}){return(0,X.jsx)(W,{route:`github`,density:`empty`,children:(0,X.jsx)(G,{icon:(0,X.jsx)(T,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,X.jsx)(F,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:n,children:`Try again`}),children:(0,X.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`The tab needs the `,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in Squawk works without it.`]})})})}function Jt({view:e,isDesktop:t,gh:n,onSaveView:r}){return(0,X.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,X.jsxs)(Je,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,X.jsxs)(Je,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function Yt({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,X.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,X.jsx)(E,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:n.query,onChange:e=>n.setQuery(e.target.value),className:`min-h-11 w-full rounded-lg border border-card-edge bg-card shadow-card py-1 pr-2.5 pl-8 text-[13px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,X.jsx)(cn,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,X.jsx)(ct,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,X.jsx)(`button`,{type:`button`,disabled:!n.filtering,"data-slot":`gh-clear-filters`,className:`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:border-border disabled:bg-transparent disabled:text-muted-foreground`,onClick:n.clearFilters,children:`Clear filters`})]})}function Xt(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Zt(e,t){return(0,X.jsx)(pt,{item:e,view:t.view,filter:t.filter,colors:t.colors,active:t.selected?.url===e.url,queued:t.queued.has(e.url),checks:Xt(e,t.checksMap),comments:t.commentsOf(e)})}function Qt({view:e,n:t,rows:n,verdict:r,search:i,sidebar:a,list:o,paging:s,width:c,onWidthChange:l,expanded:u,onExpandedChange:d}){let{items:f,searchHits:p}=i,m=e===`issues`&&t!==void 0&&!u;return(0,X.jsxs)(`section`,{ref:s.setListEl,"data-slot":`gh-list`,"data-mobile-preview":m||void 0,style:{"--github-list-width":`${c}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[f.length===0?r&&(0,X.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-muted-foreground`,children:r}):(0,X.jsx)($t,{items:f,rows:n,compactPreview:m,paging:s}),s.pagingAvailable?(0,X.jsx)(en,{view:e,list:o,paging:s}):null,(0,X.jsx)(tn,{backedQuery:a.backedQuery,filterSearch:a.filterSearch}),(0,X.jsx)(nn,{view:e,n:t,count:f.length,expanded:u,onExpandedChange:d}),f.length>0&&i.searchWanted&&r?(0,X.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-muted-foreground`,children:r}):null,p.length>0?(0,X.jsx)(rn,{hits:p,searchPayload:i.searchPayload,rows:n}):null,(0,X.jsx)(Rt,{width:c,onWidthChange:l})]})}function $t({items:e,rows:t,compactPreview:n,paging:r}){let{setRowsEl:i,scrollOwner:a,listEl:o,scrollOwnerRef:s,startMargin:c}=r,l=e.map((e,r)=>(0,X.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":r>0||void 0,"data-compact-hidden":n&&r>=2&&t.selected?.url!==e.url||void 0,children:Zt(e,t)},e.url));return(0,X.jsx)(`div`,{ref:i,"data-slot":`gh-rows`,"data-virtualized":a?`true`:void 0,role:`list`,children:a?(0,X.jsx)(Me,{scrollRef:s,startMargin:c,children:l},a===o?`list`:`main`):l})}function en({view:e,list:t,paging:n}){return(0,X.jsx)(`div`,{ref:n.loadMoreRef,"data-slot":`gh-load-more`,className:`flex min-h-6 items-center justify-center gap-1.5 px-4 pb-3 text-xs text-muted-foreground`,children:t.isFetchingNextPage?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,X.jsxs)(X.Fragment,{children:[`Could not load more.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-retry`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Retry`})]}):n.manualPaging?(0,X.jsxs)(X.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-manual`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Load more`})]}):null})}function tn({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-muted-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function nn({view:e,n:t,count:n,expanded:r,onExpandedChange:i}){return e===`issues`&&t!==void 0&&n>2?(0,X.jsx)(F,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":r,onClick:()=>i(e=>!e),children:r?`Show fewer issues`:`View all ${n} issues`}):null}function rn({hits:e,searchPayload:t,rows:n}){return(0,X.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,X.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,X.jsx)(`li`,{children:Zt(e,n)},e.url))})]})}function an({view:e,n:t,selected:n,selectedNumber:i,exact:a,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}){let{exactWanted:d,exactItem:f}=a;return(0,X.jsx)(`section`,{"data-slot":`gh-detail`,className:r(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-card-edge bg-card shadow-card md:overflow-y-auto`,t===void 0?`hidden md:flex`:`flex`),children:n?(0,X.jsx)(on,{item:n,n:t,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}):d&&f.isPending?(0,X.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,X.jsx)(G,{icon:(0,X.jsx)(P,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${i}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):d&&(f.isError||f.data?.available===!1)?(0,X.jsx)(sn,{number:i,exact:a}):(0,X.jsx)(ft,{view:e,number:i})})}function on({item:e,n:t,repo:n,rows:r,listPath:i,changes:a,handToAgent:o}){let{workflows:s,skillList:c,workflow:l,setWorkflow:u,selectedSkills:d,setSelectedSkills:f,engine:p,setEngine:m,queued:h,onQueued:g}=o;return(0,X.jsx)(We,{item:e,comments:r.commentsOf(e),afterHeading:e.kind===`issue`?(0,X.jsx)(Qe,{number:e.number,repo:n},t??`list`):void 0,backLink:{to:i},subNav:{filter:r.filter,changes:a},onRunAgent:bt,headerAction:(0,X.jsx)(yt,{item:e,queuedRunId:h.get(e.url)??null}),colors:r.colors,checks:Xt(e,r.checksMap),children:(0,X.jsx)(Ue,{item:e,workflows:s.data?.workflows??[],skills:c,workflow:l,onWorkflowChange:u,selectedSkills:d,onSkillsChange:f,engine:p,onEngineChange:m,queuedRunId:h.get(e.url)??null,onQueued:g},e.url)})}function sn({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,X.jsx)(G,{icon:(0,X.jsx)(j,{size:16}),tone:n.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${e}`,subtitle:n.data?.available===!1?n.data.reason:n.error instanceof Error?n.error.message:`The request failed.`,actions:(0,X.jsx)(F,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function cn({options:e,colors:t,selected:n,onChange:i}){let[a,o]=(0,J.useState)(!1),s=e=>i(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,X.jsxs)(V,{open:a,onOpenChange:o,children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:r(`inline-flex min-h-11 min-w-11 shrink-0 items-center gap-1.5 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,X.jsx)(A,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(B,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,X.jsxs)(me,{children:[(0,X.jsx)(ue,{placeholder:`Filter labels…`}),(0,X.jsxs)(pe,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,X.jsx)(fe,{children:`No labels.`}),n.length>0?(0,X.jsxs)(de,{value:`__clear__`,onSelect:()=>i([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,X.jsxs)(de,{value:e,onSelect:()=>s(e),className:`min-h-11`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:ze(t[e])}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,X.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{zt as GithubRoute};
|
package/web/dist/assets/{global-activity-route-u1XpCWGK.js → global-activity-route-D7HmA4W3.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{St as i,yt as a}from"./queries-ByqTmyCs.js";import{f as o,n as s}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{A as c,C as l,D as u,F as d,I as f,L as p,M as m,N as h,O as g,P as _,R as ee,S as v,T as y,_ as b,a as x,b as S,c as te,d as ne,f as re,g as ie,h as ae,i as oe,j as se,k as ce,l as le,m as ue,n as de,o as fe,p as pe,r as me,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"./activity-motion-BlDa0Oee.js";import{t as A}from"./button-C8jUIs8Q.js";import{i as j}from"./project-order-AcHI4Dcl.js";import{d as M,i as N,n as P,t as F}from"./page-shell-CpdYMj52.js";import{bn as I}from"./index-B0_haEFL.js";var L=e(t(),1),R=(e,t)=>({x0:Math.min(e.x,t.x),y0:Math.min(e.y,t.y),x1:Math.max(e.x,t.x),y1:Math.max(e.y,t.y)});function z(e,t,n=1){return t.some(t=>t.x+n<e.x1&&e.x0<t.x+t.w-n&&t.y+n<e.y1&&e.y0<t.y+t.h-n)}var he=(e,...t)=>e.filter(e=>!t.some(t=>ge(e,t))),ge=(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h,B=e=>Math.round(e*10)/10,V=e=>`${B(e.x)} ${B(e.y)}`;function _e(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&e.x===n.x&&e.y===n.y)continue;let r=t[t.length-2];r&&e&&(r.x===e.x&&e.x===n.x||r.y===e.y&&e.y===n.y)&&t.pop(),t.push(n)}return t}function ve(e,t=8){let n=_e(e),r=n[0];if(!r)return``;let i=`M${V(r)}`;for(let e=1;e<n.length;e++){let r=n[e],a=n[e-1],o=n[e+1];if(!o){i+=` L ${V(r)}`;continue}let s=Math.min(t,Math.hypot(r.x-a.x,r.y-a.y)/2,Math.hypot(o.x-r.x,o.y-r.y)/2),c=(e,t,n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y)||1;return{x:e.x+(t.x-e.x)/r*n,y:e.y+(t.y-e.y)/r*n}};i+=` L ${V(c(r,a,s))} Q ${V(r)}, ${V(c(r,o,s))}`}return i}function H(e,t,n){let r=[];for(let i of[...e].sort((e,n)=>t(e)-t(n))){let e=r[r.length-1];e&&Math.abs(t(i)-e.from)<=2?e.to=Math.max(e.to,n(i)):r.push({from:t(i),to:n(i)})}return r}function ye(e){return{rows:H(e,e=>e.y,e=>e.y+e.h).map(({from:e,to:t})=>({top:e,bottom:t})),cols:H(e,e=>e.x,e=>e.x+e.w).map(({from:e,to:t})=>({left:e,right:t}))}}var U=(e,t,n)=>Math.max(0,e.findIndex(e=>Math.abs(t(e)-n)<=2)),W=(e,t)=>((e.rows[t]?.bottom??0)+(e.rows[t+1]?.top??(e.rows[t]?.bottom??0)+16))/2;function be(e,t,n){let r=e.cols,i=e=>((r[e]?.right??0)+(r[e+1]?.left??0))/2;return t<n?i(t):t>n?i(t-1):t+1<r.length?i(t):t>0?i(t-1):(r[t]?.right??0)+8}function xe(e,t,n,r=0){let i=ye(n),a=U(i.rows,e=>e.top,e.y),o=U(i.rows,e=>e.top,t.y),s=o>a,c=e.x+e.w/2+r,l=t.x+t.w/2+r,u=(s?W(i,a):W(i,a-1))+r/2,d=(s?W(i,o-1):W(i,o))+r/2,f=be(i,U(i.cols,e=>e.left,e.x),U(i.cols,e=>e.left,t.x))+r/2,p={x:c,y:s?e.y+e.h+1:e.y-1},m={x:l,y:s?t.y-3:t.y+t.h+3};return{points:[p,{x:c,y:u},{x:f,y:u},{x:f,y:d},{x:l,y:d},m],label:{x:(c+f)/2,y:u}}}function Se(e){let t=new Map;for(let n of e){let e=[n.senderRunId,n.recipientRunId].sort().join(`
|
|
2
2
|
`);t.set(e,[...t.get(e)??[],n.requestId])}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,(r-(e.length-1)/2)*12));return n}function Ce(e,t,n,r=4){let i=[],a=new Map;for(let{id:o,at:s}of e){let e={...s};for(let a=0;a<=i.length;a++){let a=i.find(n=>Math.abs(e.x-n.x)<t.w+r&&Math.abs(e.y-n.y)<t.h+r);if(!a)break;n===`x`?e.x=a.x+t.w+r:e.y=a.y+t.h+r}i.push(e),a.set(o,e)}return a}var G=e=>Math.round(e*10)/10,K=e=>`${G(e.x)} ${G(e.y)}`;function we(e,t,n=[],r=0){let i=e.x+e.w/2+r,a=t.x+t.w/2+r;if(t.y>=e.y+e.h||t.y+t.h<=e.y){let o=t.y>e.y,s=o?e.y+e.h+1:e.y-1,c=o?t.y-3:t.y+t.h+3,l=(c-s)/2;if(z(R({x:i,y:s},{x:a,y:c}),he(n,e,t))){let i=xe(e,t,n,r);return{d:ve(i.points),label:i.label}}return{d:`M${K({x:i,y:s})} C ${K({x:i,y:s+l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:c})}`,label:{x:(i+a)/2,y:(s+c)/2}}}let o=e.y-1,s=t.y-1,c=Math.min(o,s),l=Math.max(8,Math.min(30,18+Math.abs(a-i)*.05)+r);return{d:`M${K({x:i,y:o})} C ${K({x:i,y:c-l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:s-3})}`,label:{x:(i+a)/2,y:c-l*.75}}}function Te(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}}function Ee(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function De(e){let t=[],n=[];for(let r of e)v(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function Oe(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function ke(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function Ae(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>m(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function je(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var q=n(),Me={w:104,h:20};function Ne(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,Te(r.getBoundingClientRect(),t))}return n}function Pe(e,t,n=[]){let r=Ne(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...re(e),kind:`wait`}))],o=Se(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...we(t,n,i,o.get(e.requestId))})}let c=Ce(s.map(e=>({id:e.id,at:e.label})),Me,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function Fe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var J=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-xs whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function Ie({arc:e,wait:t,now:n,motion:i}){return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:r(J,`border-dashed border-message-peer-accent`,t.id in i.waitsClosing&&`activity-line-out`),children:[(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,_(f(t.since,n))]})}function Le({arc:e,request:t,now:n,motion:i}){let a=te(i,e.id);return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:r(J,a?`border-success`:`border-message-peer-accent`,C(i,e.id)===`fade`&&`activity-line-out`),children:[a?(0,q.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,_(f(t.createdAt,n))]})}var Re=[],ze=new Set;function Be({arcs:e,waits:t=Re,active:n=ze,layoutKey:i,now:a,motion:o=b,paused:s=!1}){let c=L.useRef(null),l=T(c,L.useCallback(n=>Pe(n,e,t),[e,t]),Fe,`[data-activity-pill]`,i),u=L.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=ne(o.comets,u,s),f=new Map(e.map(e=>[e.requestId,e])),p=new Map(t.map(e=>[e.id,e])),m=L.useId().replace(/[^a-zA-Z0-9_-]/g,``),h=`activity-arrow-arc-${m}`,g=`activity-ring-arc-${m}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`marker`,{id:h,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,q.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,q.jsx)(x,{id:g})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,q.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${g})`,className:r(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,le(o,e.id))},e.id)}let t=C(o,e.id);return(0,q.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${h})`,className:r(`stroke-message-peer-accent`,fe(t,e.id in o.opening))},e.id)}),(0,q.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?p.get(e.id):void 0;if(t)return(0,q.jsx)(Ie,{arc:e,wait:t,now:a,motion:o},e.id);let n=f.get(e.id);return n?(0,q.jsx)(Le,{arc:e,request:n,now:a,motion:o},e.id):null})]})}var Y=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,Ve=[],He=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function Ue({task:e}){let t=e.workers.filter(e=>m(e.status));return t.length===0?null:(0,q.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[t.map(e=>(0,q.jsx)(c,{run:e,role:`worker`},e.runId)),(0,q.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function We({projectId:e,task:t,requests:n,waits:i=Ve,index:a,ctx:o,motion:l=b,linked:u=!1,onHover:g}){let _=h(t,o);return(0,q.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":_.action,"data-linked":u?`true`:void 0,...ae(t.runId,g),className:r(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,_.action?_.tone===`info`?`border-info/70`:`border-pending/70`:t.rung===`running`&&m(t.status)?`border-status-running/60`:`border-border`,u&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in l.entering&&`activity-card-enter`),children:[(0,q.jsx)(pe,{task:t,motion:l,glow:_.action!==void 0}),(0,q.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,q.jsx)(c,{run:t,role:`root`}),(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,q.jsx)(s,{to:Y(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,q.jsx)(ce,{rate:t.rate,className:`h-3 w-10`})]}),(0,q.jsxs)(`div`,{className:`mt-[3px] ml-[19px] flex items-center gap-2`,children:[(0,q.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`min-w-0 flex-1 truncate text-xs text-muted-foreground tabular-nums`,children:[(0,q.jsx)(se,{"data-slot":`activity-verb`,tone:_.tone,className:`font-semibold`,children:_.verb}),_.action&&_.since?(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsx)(`span`,{"data-slot":`activity-pill-age`,title:d(_.since),children:p(f(_.since,o.now))})]}):null,` · `,(0,q.jsx)(`span`,{"data-slot":`activity-main`,className:r(_.mono&&`font-mono text-xs`),children:_.main})]}),_.action?(0,q.jsx)(A,{asChild:!0,size:`sm`,variant:_.action===`answer`?`primary`:`outline`,className:`relative z-[1] h-7 px-2 text-[12px] max-md:min-h-11`,children:(0,q.jsx)(s,{"data-slot":`activity-pill-action`,to:Y(e,t.runId),children:_.action===`answer`?`Answer`:`Open task`})}):null]}),(0,q.jsx)(ue,{texts:k(t.runId,n,a,i)}),(0,q.jsx)(Ue,{task:t}),(0,q.jsx)(ie,{runId:t.runId,requests:n,waits:i,index:a,link:s,pathOf:t=>Y(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:He})]})}var X=e=>`/p/${encodeURIComponent(e)}/activity`,Ge=e=>`/p/${encodeURIComponent(e)}/`,Z=`rounded-xl border border-card-edge bg-card shadow-card px-4 pt-3.5 pb-4`,Q=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function $({project:e,headingId:t,detail:n,to:r,label:i}){return(0,q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,q.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,q.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,q.jsx)(s,{to:r,className:Q,children:i})]})}function Ke({project:e,notice:t}){let n=L.useId();return(0,q.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Z,children:(0,q.jsx)($,{project:e,headingId:n,detail:t,to:Ge(e.projectId),label:`Open project →`})})}function qe(e,t){return L.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return Oe({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function Je({project:e,now:t,motion:n=b,paused:i=!1}){let a=L.useId(),o=L.useMemo(()=>l(e),[e]),s=qe(e,n),c=L.useMemo(()=>O(e.tasks),[e.tasks]),u=L.useMemo(()=>ke(e.tasks,[...c,...E(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=oe(c),f={now:t,titleOf:e=>S(o,e)},p=`${e.tasks.map(e=>e.runId).join(`,`)}:${s.map(e=>e.requestId).join(`,`)}:${u.map(e=>e.id).join(`,`)}`,m=s.length>0||u.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":a,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)($,{project:e,headingId:a,detail:Ae(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:r(`relative mt-3`,m&&`md:mt-1 md:pt-10`),children:[(0,q.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:r(`grid grid-cols-[repeat(auto-fit,minmax(min(100%,300px),1fr))] items-start gap-3.5`,m&&`md:gap-y-11`),children:e.tasks.map(t=>(0,q.jsx)(We,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:o,ctx:f,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),m?(0,q.jsx)(Be,{arcs:s,waits:u,active:d.active,layoutKey:p,now:t,motion:n,paused:i}):null]})]})}function Ye(e){let t=v(e.project);return t===void 0?(0,q.jsx)(Je,{...e}):(0,q.jsx)(Ke,{project:e.project,notice:t})}function Xe({projects:e,belowPanels:t}){return e.length===0?null:(0,q.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[je(e.length,t),` `,e.map((e,t)=>(0,q.jsxs)(L.Fragment,{children:[t>0?`, `:null,(0,q.jsx)(s,{to:X(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Ze={kind:`workspace`};function Qe(){let e=i().data?.projects,{order:t}=I();return L.useMemo(()=>e?j(e,t).map(e=>e.id):void 0,[e,t])}function $e(){let e=i().data,t=a(),n=o().state?.activityProjectId,r=e?.bootProject??t.data?.bootProject??null,s=typeof n==`string`&&e?.projects.some(e=>e.id===n&&e.status!==`missing`)?n:r;return{id:s,name:e?.projects.find(e=>e.id===s)?.name,projects:e?.projects}}function et(){let e=ee(Ze),t=$e(),n=Qe(),[r,i]=L.useState(!1),a=w(e.data?.generatedAt,e.dataUpdatedAt),o=e.data?.projects,c=L.useMemo(()=>Ee(o??[],n),[o,n]),l=L.useMemo(()=>De(c),[c]),d=L.useMemo(()=>l.panels.filter(e=>v(e)===void 0),[l.panels]),f=L.useMemo(()=>l.panels.filter(e=>v(e)!==void 0),[l.panels]),p=L.useMemo(()=>c.map(e=>e.projectId),[c]),{motion:m,feed:h,paused:_,reduced:b}=de(e.data,`workspace`),x=d.reduce((e,t)=>e+t.tasks.length,0);return(0,q.jsxs)(N,{route:`activity-global`,density:o?M(x+f.length):`full`,headerSpacing:`compact`,rootProps:{"data-activity-paused":_?`true`:void 0},bodyClassName:`gap-3.5`,header:g({name:`All projects`,now:e.data?a:void 0,updatedAt:e.data?.generatedAt,stale:e.isError,scopeSwitch:(0,q.jsx)(y,{scope:`all`,projects:t.projects,projectId:t.id,projectName:t.name,grouped:r,onToggleGroup:()=>i(e=>!e)})}),sparseFooter:o&&l.panels.length>0?(0,q.jsx)(P,{summary:`${d.length} active ${d.length===1?`project`:`projects`} with live work.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,q.jsx)(s,{to:`/tasks`,children:`View all tasks`})})}):void 0,children:[o?(0,q.jsx)(u,{summary:D(o),tasksTo:`/tasks`,bumps:m.bumps}):null,e.isPending?(0,q.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!o?(0,q.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-3 rounded-xl border border-border bg-card p-5 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,q.jsx)(A,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),className:`max-md:min-h-11`,children:`Retry`})]}):null,o&&l.panels.length===0&&l.idle.length===0?(0,q.jsx)(F,{slot:`activity-empty`,title:`No projects to show.`,description:`Register a project in Workspace tools to monitor live agent work across repositories.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,q.jsx)(s,{to:`/tools`,children:`Open workspace tools`})})}):null,d.length>0||h.length>0?(0,q.jsx)(me,{projects:d,now:a,global:!0,grouped:r,projectOrder:p,motion:m,feed:h,still:b,paused:_}):null,f.length>0?(0,q.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3`,children:f.map(e=>(0,q.jsx)(Ye,{project:e,now:a,motion:m,paused:_||b},e.projectId))}):null,(0,q.jsx)(Xe,{projects:l.idle,belowPanels:l.panels.length>0})]})}export{et as GlobalActivityRoute};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-BY76lXLH.js","assets/css-BsVw1vtW.js","assets/javascript-BgS3c2Ky.js","assets/core-DzoyrHjB.js","assets/lib-DrPFkMXk.js","assets/rolldown-runtime-QTnfLwEv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as e}from"./dist-C_rn70hE.js";import{t}from"./preload-helper-Czpn1I53.js";import{t as n}from"./own-lookup-DS54wXvD.js";var r={core:null,langs:new Map},i={name:`cezar-syn`,type:`dark`,fg:`var(--syn-var)`,bg:`transparent`,settings:[{scope:[`keyword`,`storage`,`constant.language`,`variable.language`,`entity.other.attribute-name`,`support.type.property-name`],settings:{foreground:`var(--syn-key)`}},{scope:[`string`,`punctuation.definition.string`],settings:{foreground:`var(--syn-str)`}},{scope:[`entity.name.function`,`support.function`,`entity.name.tag`,`entity.name.type`,`entity.name.class`,`support.class`,`support.type`],settings:{foreground:`var(--syn-fn)`}},{scope:[`comment`,`punctuation.definition.comment`],settings:{foreground:`var(--syn-com)`}},{scope:[`constant.numeric`,`constant.character`,`constant.other`,`support.constant`,`keyword.other.unit`],settings:{foreground:`var(--syn-num)`}},{scope:[`punctuation`,`keyword.operator`,`meta.brace`,`punctuation.separator`,`punctuation.terminator`],settings:{foreground:`var(--syn-punc)`}},{scope:[`variable`,`entity.name.variable`],settings:{foreground:`var(--syn-var)`}}]},a={typescript:()=>t(()=>import(`./typescript-bsJCZSQ-.js`),[]),tsx:()=>t(()=>import(`./tsx-udAQXfEw.js`),[]),javascript:()=>t(()=>import(`./javascript-BgS3c2Ky.js`),[]),jsx:()=>t(()=>import(`./jsx-Bz0zcwM4.js`),[]),json:()=>t(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>t(()=>import(`./jsonc-CYpm1nAK.js`),[]),shellscript:()=>t(()=>import(`./shellscript-CLZ0U2zV.js`),[]),python:()=>t(()=>import(`./python-gzcpVVnB.js`),[]),markdown:()=>t(()=>import(`./markdown-BYOwaDjH.js`),[]),css:()=>t(()=>import(`./css-BsVw1vtW.js`),[]),html:()=>t(()=>import(`./html-BY76lXLH.js`),__vite__mapDeps([0,1,2])),diff:()=>t(()=>import(`./diff-woXpYk--.js`),[]),yaml:()=>t(()=>import(`./yaml-rwi0_p6S.js`),[]),toml:()=>t(()=>import(`./toml-CcmNWLt0.js`),[]),go:()=>t(()=>import(`./go-rLFTqkRN.js`),[]),rust:()=>t(()=>import(`./rust-Cfkwpbl8.js`),[]),sql:()=>t(()=>import(`./sql-BsFa4tDR.js`),[])},o={ts:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,bash:`shellscript`,sh:`shellscript`,shell:`shellscript`,zsh:`shellscript`,console:`shellscript`,py:`python`,md:`markdown`,yml:`yaml`,golang:`go`,rs:`rust`,vue:`html`,xml:`html`},s=new Set([``,`plaintext`,`text`,`txt`,`plain`]);function c(e){let t=e.trim().toLowerCase();return Object.hasOwn(a,t)?t:n(o,t)??null}function l(e){return s.has(e.trim().toLowerCase())}function u(){return[...Object.keys(a),...Object.keys(o),...s].filter(e=>e!==``)}function d(e){let t=e.slice(e.lastIndexOf(`/`)+1),r=t.lastIndexOf(`.`);if(r<=0)return null;let i=t.slice(r+1).toLowerCase();return c(n({mts:`typescript`,cts:`typescript`,htm:`html`},i)??i)}var f=null,p=new Set;function m(){return r.core??=Promise.all([t(()=>import(`./core-DzoyrHjB.js`),__vite__mapDeps([3,4,5])),t(()=>import(`./engine-javascript-FQvzRocB.js`),[])]).then(async([{createHighlighterCore:e},{createJavaScriptRegexEngine:t}])=>(f=await e({themes:[i],langs:[],engine:t({forgiving:!0})}),f)),r.core}function h(e){let t=c(e);if(t===null||p.has(t))return Promise.resolve();let n=r.langs.get(t);return n||(n=m().then(async e=>{await e.loadLanguage(await a[t]()),p.add(t)}).catch(()=>{r.langs.delete(t)}),r.langs.set(t,n)),n}function g(e){return{tokens:e.split(`
|
|
3
|
+
`).map(e=>[{content:e}]),fg:`var(--syn-var)`,bg:`transparent`}}function _(t,n,r={}){if(l(n))return g(t);let a=c(n);if(a===null)return g(t);if(!f||!p.has(a))return null;try{let n=f.codeToTokens(t,{lang:a,theme:i.name,...e({tokenizeTimeLimit:r.tokenizeTimeLimit})});return{tokens:n.tokens.map(t=>t.map(({content:t,color:n})=>({content:t,...e({color:n})}))),fg:n.fg??`var(--syn-var)`,bg:`transparent`}}catch{return g(t)}}async function v(e,t,n={}){return _(e,t,n)||(await h(t),_(e,t,n)??g(e))}export{d as a,_ as i,c as n,u as o,v as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{a as i,i as a,n as o,o as s,s as c,t as l}from"./html-report-BX3msvci.js";var u=e(t(),1),d=n(),f=[[`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 p(e){let t=f.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 h(e){let t=(0,u.useMemo)(()=>s(e),[e]).join(` `),[n,r]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!t)return;let e=!0;return c(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:m}function g({html:e,title:t,fragment:n,className:i}){let a=h(e);return a?(0,d.jsx)(_,{html:e,title:t,fragment:n,className:i,libraries:a}):(0,d.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:r(`flex min-h-0 flex-col`,i)})}function _({html:e,title:t,fragment:n,className:s,libraries:c}){let{srcdoc:f,blocked:m}=(0,u.useMemo)(()=>{let n=a(e,c);return{srcdoc:i(n.srcdoc,t),blocked:n.blocked}},[e,c,t]),h=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},g=p(m);return(0,d.jsxs)(`div`,{"data-slot":`html-report`,className:r(`flex min-h-0 flex-col`,s),children:[g?(0,d.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: `,g,`. Reports show only what they carry inside the file.`]}):null,(0,d.jsx)(`div`,{"data-slot":`html-report-viewport`,className:`flex min-h-0 flex-1 flex-col bg-muted/40 p-2 md:p-4`,children:(0,d.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:o,allow:l,srcDoc:f,referrerPolicy:`no-referrer`,onLoad:h,className:`block min-h-0 w-full flex-1 rounded-md border border-border bg-report-canvas shadow-sm`})})]})}export{g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./diff-stat-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./diff-stat-Dy4uLuyP.js";import{t as n}from"./zoomable-image-BUTgYpld.js";var r=e();function i({stat:e,hidden:n=!1}){return(0,r.jsxs)(`p`,{"data-slot":`diff-totals`,hidden:n,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,r.jsxs)(`span`,{children:[e.files,` `,e.files===1?`file`:`files`,` changed`]}),(0,r.jsx)(t,{stat:e})]})}function a(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function o({file:e,imageSrc:t,onOpenInApp:i}){return e.status===`deleted`?(0,r.jsx)(s,{children:`Image deleted — only the new side can be previewed.`}):t?(0,r.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,r.jsx)(n,{src:t(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,r.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,r.jsx)(s,{children:`Binary file — no text diff.`})}function s({children:e}){return(0,r.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:e})}export{a as n,i as r,o as t};
|