mastra 1.40.2-alpha.2 → 1.40.2-alpha.4
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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/factory/assets/AlertDialog.es-Z2cFKrup.js +1 -0
- package/dist/factory/assets/BoardConfigPage-CNnVTJJ0.js +1 -0
- package/dist/factory/assets/BoardIcons-DXB--WrY.js +1 -0
- package/dist/factory/assets/BoardIntakePage-1Qjo4ul-.js +1 -0
- package/dist/factory/assets/BoardRulesPage-CIAfbl-f.js +1 -0
- package/dist/factory/assets/Breadcrumb.es-D9PSmzYq.js +1 -0
- package/dist/factory/assets/{Card-BbxDmj8W-9N7pulL8.js → Card-BbxDmj8W-BRp0MNo6.js} +1 -1
- package/dist/factory/assets/CodeBlock.es-BeD4YikJ.js +6 -0
- package/dist/factory/assets/CodeEditor-CfxlNg4f-D29InJfs.js +1 -0
- package/dist/factory/assets/{Command.es-DYj7l4_8.js → Command.es-Dzh7LzCA.js} +2 -2
- package/dist/factory/assets/CompositeItem-CD2x3KaL.js +1 -0
- package/dist/factory/assets/CompositeRoot-C9XORM0H.js +1 -0
- package/dist/factory/assets/ConditionRows-CJG9M2Dv.js +1 -0
- package/dist/factory/assets/CreateFactoryPage-lJR2YkRF.js +1 -0
- package/dist/factory/assets/{DescriptionMarkdown-BH7uH0Yx.js → DescriptionMarkdown-CoP2xvHU.js} +1 -1
- package/dist/factory/assets/FactorySkillPage-jc5BL6ZL.js +3 -0
- package/dist/factory/assets/FactorySkillsPage-CXHW7kNe.js +1 -0
- package/dist/factory/assets/Field.es-BmqB8MIv.js +1 -0
- package/dist/factory/assets/{GithubIcon.es-BPBhMx2H.js → GithubIcon.es-B1lB1Q-8.js} +5 -5
- package/dist/factory/assets/HrefLink-Q5kgIdVD.js +1 -0
- package/dist/factory/assets/IconArrowRotateClockwise.es-C13-sgU6.js +1 -0
- package/dist/factory/assets/{IconFormCircle.es-DRfpxito.js → IconFormCircle.es-DT5Y3tym.js} +1 -1
- package/dist/factory/assets/IconPencil.es-D_eBYY1c.js +1 -0
- package/dist/factory/assets/IconScript.es-b9CvRY9n.js +1 -0
- package/dist/factory/assets/IconSettingsSliderHor.es-CSwP_iSG.js +1 -0
- package/dist/factory/assets/IconUserDuo.es-0xR_m2_v.js +1 -0
- package/dist/factory/assets/{Input-DTmflfQ4.js → Input-CNUJ--WV.js} +1 -1
- package/dist/factory/assets/InputNumber.es-BoS5sRR-.js +1 -0
- package/dist/factory/assets/KnowledgePage-J33Xcyhj.js +13 -0
- package/dist/factory/assets/LoadErrorState-DVbqZ6DX.js +1 -0
- package/dist/factory/assets/{MarkdownRenderer-Y8TNNi2F-Dq4iwrPa.js → MarkdownRenderer-CfkpBq7t-B3F-Cy2O.js} +3 -3
- package/dist/factory/assets/MastraGatewayBilling-ButNucYj.js +1 -0
- package/dist/factory/assets/NewBoardPage-a5zbVJZr.js +2 -0
- package/dist/factory/assets/NewPage-CAC_4Xst.js +1 -0
- package/dist/factory/assets/OnboardingPage-COpr2FmK.js +1 -0
- package/dist/factory/assets/{ProviderBrandIcon-C7mph6N5.js → ProviderBrandIcon-B-aKKQdi.js} +1 -1
- package/dist/factory/assets/RadioGroup-CM2PCyNZ.js +1 -0
- package/dist/factory/assets/{RadioGroup.es-CyxlfqIJ.js → RadioGroup.es-Ws4_oCJe.js} +1 -1
- package/dist/factory/assets/RootGuards-dZlWJMm5.js +1 -0
- package/dist/factory/assets/RulesPage-D6xs4PcH.js +1 -0
- package/dist/factory/assets/SearchInput.es-CzE_Qk4w.js +1 -0
- package/dist/factory/assets/SessionLayout-D9E5aqnm.js +4 -0
- package/dist/factory/assets/SessionPage-DStU9z1q.js +1 -0
- package/dist/factory/assets/SessionSharingPopover-B-YZDS4X.js +1 -0
- package/dist/factory/assets/SettingsPage-hHef3e63.js +3 -0
- package/dist/factory/assets/SettingsSubsection-DznON6FW.js +1 -0
- package/dist/factory/assets/Sidebar.es-9pwBnu_Z.js +1 -0
- package/dist/factory/assets/SignInPage-NxXJAPal.js +1 -0
- package/dist/factory/assets/SkeletonRows-6RPIfKEw.js +1 -0
- package/dist/factory/assets/SkillBadges-DbbPhC5O.js +1 -0
- package/dist/factory/assets/SlackConnectionPage-Cnp4CA2n.js +1 -0
- package/dist/factory/assets/{StackedDiffs-BFXdSF8w.js → StackedDiffs-BCYXM5ZL.js} +1 -1
- package/dist/factory/assets/TabsRoot-C1o0G1CK.js +1 -0
- package/dist/factory/assets/{ThinkingLevel.es-Dk-VbgE7.js → ThinkingLevel.es-D6B6ha12.js} +1 -1
- package/dist/factory/assets/{Tree-B90XgTY4-cZ-SkEZr.js → Tree-B90XgTY4-D-CiuNjX.js} +1 -1
- package/dist/factory/assets/{buttons-group-DA_wORqQ-BsTwZ3ww.js → buttons-group-DA_wORqQ-DfA-q_d9.js} +1 -1
- package/dist/factory/assets/combobox-parts-s-DJvMW4-CR5ZbuEq.js +1 -0
- package/dist/factory/assets/copy-button-Brk8iwgE-DHsIfP0z.js +1 -0
- package/dist/factory/assets/{esm-DH1__fiI.js → esm-Dp9Y59hS.js} +1 -1
- package/dist/factory/assets/index-4Y__z3vn.css +1 -0
- package/dist/factory/assets/index-D4fnG4KO.js +125 -0
- package/dist/factory/assets/{input-DqReKX0A-BMaPtvZH.js → input-DqReKX0A-B4MUvQwj.js} +3 -3
- package/dist/factory/assets/{input-group-CXvse9n7-C3ds8HOQ.js → input-group-C2kg3je7-38FwKlyX.js} +1 -1
- package/dist/factory/assets/{onboardingFlow-DHRTMH3J.js → onboardingFlow-D-slZE6d.js} +1 -1
- package/dist/factory/assets/relative-time.es-DgA3Kbhv.js +1 -0
- package/dist/factory/assets/{ruleLanes-DEg70O95.js → ruleLanes-D9QkgLJm.js} +1 -1
- package/dist/factory/assets/select-Bdt18YBg-DJqvU5Dv.js +1 -0
- package/dist/factory/assets/settings-DTWGb7K_-PW2CFx0g.js +1 -0
- package/dist/factory/assets/{spinner-B9ykw74u-BLKI_KJ9.js → spinner-B9ykw74u-oAX9C1zS.js} +1 -1
- package/dist/factory/assets/{useBoardCatalog-vK4woIAH.js → useBoardCatalog-DZf1osB2.js} +1 -1
- package/dist/factory/assets/useBoardEditor-Dm78Yoiu.js +1 -0
- package/dist/factory/assets/useChatSessionContext-BHyuVY1T.js +1 -0
- package/dist/factory/assets/useDraftModelGuards-C_NJl4y3.js +29 -0
- package/dist/factory/assets/useDraftModelGuards-Cky35Lcg.css +1 -0
- package/dist/factory/assets/useFactoryDecisions-C9GWqAN_.js +1 -0
- package/dist/factory/assets/{useGlobalSearchControls-CicrSU7j.js → useGlobalSearchControls-BbAiVtBx.js} +1 -1
- package/dist/factory/assets/{useInfiniteQuery-BayiW-x6.js → useInfiniteQuery-hSoUGHIM.js} +1 -1
- package/dist/factory/assets/useIntakeRoutes-BNBPe6sx.js +1 -0
- package/dist/factory/assets/useLinearData-XOkwHgla.js +1 -0
- package/dist/factory/assets/{usePlatformConnections-CYfXtAjx.js → usePlatformConnections-R32iBFFQ.js} +1 -1
- package/dist/factory/assets/useRouteSessionId-DhLFIOOv.js +1 -0
- package/dist/factory/assets/{useRowDrag-Bmj1hhAE.js → useRowDrag-DQBjWerU.js} +1 -1
- package/dist/factory/assets/{useSessionCard-Cva55kO-.js → useSessionCard-CiybjeGQ.js} +1 -1
- package/dist/factory/assets/{useSessionRepository-D8yeB29J.js → useSessionRepository-BEhYLqfE.js} +1 -1
- package/dist/factory/assets/useSessionRows-aTHnrKGG.js +1 -0
- package/dist/factory/assets/{useThreadWorkspacePath-BAc6-H_t.js → useThreadWorkspacePath-B11HTzns.js} +1 -1
- package/dist/factory/assets/workspaces-ybaLGjJ3.js +2 -0
- package/dist/factory/index.html +45 -44
- package/dist/index.js +1 -1
- package/dist/studio/assets/{index-B4zG_u8m.js → index-D79YwdXE.js} +2 -2
- package/dist/studio/assets/{main-CEtWndOQ.js → main-I58UwnyS.js} +391 -328
- package/dist/studio/assets/style-Du5ShnBp.css +3 -0
- package/dist/studio/index.html +2 -2
- package/package.json +4 -4
- package/dist/factory/assets/AlertDialog.es-DDAl3sXA.js +0 -1
- package/dist/factory/assets/BoardConfigPage-Dan9VyhL.js +0 -1
- package/dist/factory/assets/BoardIcons-Cml_taka.js +0 -1
- package/dist/factory/assets/BoardIntakePage-BYZy_ru_.js +0 -1
- package/dist/factory/assets/BoardRulesPage-CxNhQl3d.js +0 -1
- package/dist/factory/assets/Breadcrumb.es-BpvMnN1l.js +0 -1
- package/dist/factory/assets/CodeBlock.es-lPYMhQRD.js +0 -6
- package/dist/factory/assets/CodeEditor-DmElSGLM-BqTClSRY.js +0 -1
- package/dist/factory/assets/CompositeRoot-DSl5I499.js +0 -1
- package/dist/factory/assets/ConditionRows-DJVG4EHd.js +0 -1
- package/dist/factory/assets/CreateFactoryPage-CoxfdoDW.js +0 -1
- package/dist/factory/assets/FactorySkillPage-ix3Ct4E0.js +0 -3
- package/dist/factory/assets/FactorySkillsPage-SPaAjjue.js +0 -1
- package/dist/factory/assets/Field.es-BPlWASZ-.js +0 -1
- package/dist/factory/assets/HrefLink-C-5Xp-pL.js +0 -1
- package/dist/factory/assets/IconArrowRotateClockwise.es-DnnDHxyi.js +0 -1
- package/dist/factory/assets/IconLock.es-9mYeLe9c.js +0 -1
- package/dist/factory/assets/IconMerged.es-BudaK6HC.js +0 -1
- package/dist/factory/assets/IconPencil.es-C5rZ8A6j.js +0 -1
- package/dist/factory/assets/IconScript.es-BQPM-6BN.js +0 -1
- package/dist/factory/assets/IconUserDuo.es-X0H45vYw.js +0 -1
- package/dist/factory/assets/InputNumber.es-Dvj2CMW7.js +0 -1
- package/dist/factory/assets/KnowledgePage-nfIFPgp6.js +0 -13
- package/dist/factory/assets/LoadErrorState-CtPpeSh8.js +0 -1
- package/dist/factory/assets/Logo-DGvSvSWS.css +0 -1
- package/dist/factory/assets/Logo.es-Cc55x-sI.js +0 -1
- package/dist/factory/assets/MastraGatewayBilling-Bpx-h8Vt.js +0 -1
- package/dist/factory/assets/NewBoardPage-VIlgPMpB.js +0 -2
- package/dist/factory/assets/NewPage-BnMyEhkh.js +0 -1
- package/dist/factory/assets/OnboardingPage-CHfAWT72.js +0 -1
- package/dist/factory/assets/RadioGroup-CDj-r4Ik.js +0 -1
- package/dist/factory/assets/RootGuards-DQCyOUvo.js +0 -1
- package/dist/factory/assets/RulesPage-Bm395CUB.js +0 -1
- package/dist/factory/assets/SearchInput.es-ClJxNeIv.js +0 -1
- package/dist/factory/assets/SessionLayout-BShjmacL.js +0 -4
- package/dist/factory/assets/SessionPage-B9E-jG8M.js +0 -1
- package/dist/factory/assets/SessionSharingPopover-Bpr3D3Hc.js +0 -1
- package/dist/factory/assets/SettingsPage-BKDcpSlF.js +0 -3
- package/dist/factory/assets/SettingsSubsection-BGJrlda9.js +0 -1
- package/dist/factory/assets/Sidebar.es-DSPzNNju.js +0 -1
- package/dist/factory/assets/SignInPage-DUISUrUI.js +0 -1
- package/dist/factory/assets/SkeletonRows-C85xPCWB.js +0 -1
- package/dist/factory/assets/SkillBadges-BN_VjOtf.js +0 -1
- package/dist/factory/assets/SlackConnectionPage-ChNhPiV-.js +0 -1
- package/dist/factory/assets/combobox-parts-Bmj5kzrt-DzYjyBt5.js +0 -1
- package/dist/factory/assets/copy-button-5PzdvEQI-xyTDh-Ck.js +0 -1
- package/dist/factory/assets/icons-C18D46Pv.js +0 -1
- package/dist/factory/assets/index-Bi7K7czv.css +0 -1
- package/dist/factory/assets/index-CD4tM4nf.js +0 -125
- package/dist/factory/assets/lib-DkXXjRNC.js +0 -1
- package/dist/factory/assets/page-header-Maytcmgh--oRyXaDt.js +0 -1
- package/dist/factory/assets/page-header-Maytcmgh-B6awZy-2.css +0 -1
- package/dist/factory/assets/settings-DAvFqX1V-D4umTesm.js +0 -1
- package/dist/factory/assets/settingsColumn-CrKuH8q1.js +0 -1
- package/dist/factory/assets/useBoardEditor-DiWa4Lcl.js +0 -1
- package/dist/factory/assets/useChatSessionContext-DVtYX3bf.js +0 -1
- package/dist/factory/assets/useDraftModelGuards-Bna6hyHj.css +0 -1
- package/dist/factory/assets/useDraftModelGuards-BwRi1qov.js +0 -29
- package/dist/factory/assets/useFactoryDecisions-DJSz_rYq.js +0 -1
- package/dist/factory/assets/useIntakeRoutes-CdL4o1Vv.js +0 -1
- package/dist/factory/assets/useLinearData-C1EljeRN.js +0 -1
- package/dist/factory/assets/useRouteSessionId-BHCXPCt_.js +0 -1
- package/dist/factory/assets/useSessionRows-BXScIz1L.js +0 -1
- package/dist/factory/assets/workspaces-CF_kIkTd.js +0 -2
- package/dist/studio/assets/style-CW1SmVpP.css +0 -3
- /package/dist/factory/assets/{MarkdownRenderer-Y8TNNi2F-C04mQel5.css → MarkdownRenderer-CfkpBq7t-C04mQel5.css} +0 -0
- /package/dist/factory/assets/{combobox-parts-Bmj5kzrt-CYlMQsMB.css → combobox-parts-s-DJvMW4-CYlMQsMB.css} +0 -0
package/dist/docs/SKILL.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{At as e,Dt as t,Et as n,Mt as r,Nt as i,Ot as a,Pt as o,St as s,Tt as c,jt as l,kt as u,ni as d,wt as f}from"./GithubIcon.es-B1lB1Q-8.js";import{O as p,T as m}from"./IconChevronRightMedium.es-BjSIsine.js";var h=p();function g(e){return(0,h.jsx)(s,{...e,modal:!0,disablePointerDismissal:!0})}function _({size:e=`sm`,...n}){return(0,h.jsx)(t,{"data-slot":`alert-dialog-content`,size:e,showCloseButton:!1,...n,role:`alertdialog`})}function v({children:e,...t}){return(0,h.jsx)(n,{render:(0,h.jsx)(d,{variant:`primary`,size:`md`,className:m(i,o.md),children:e}),...t})}g.Trigger=r,g.Content=_,g.Header=e,g.Footer=u,g.Body=f,g.Title=l,g.Description=a,g.Action=v,g.Cancel=c;export{g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./Breadcrumb.es-D9PSmzYq.js";import{t as r}from"./EmptyState-DJaZF543-Cw3WDQUb.js";import{$n as i,Cr as a,Fr as o,Gn as s,Nr as c,O as l,Pr as u,Qn as d,Tr as f,Wn as p,Xn as m,Zn as h,_r as g,ar as _,br as v,dr as y,er as b,fr as x,gr as S,in as C,ir as w,k as T,mr as E,nn as ee,nr as D,pn as te,pr as O,rn as k,rr as A,sr as j,tn as M,tr as N,ur as P,wr as ne,xr as re}from"./index-D4fnG4KO.js";import{a as ie}from"./Sidebar.es-9pwBnu_Z.js";import{d as F,f as I,i as ae,t as L,u as R}from"./settings-DTWGb7K_-PW2CFx0g.js";import{O as oe,T as z,k as se,n as B,s as V,t as ce}from"./IconChevronRightMedium.es-BjSIsine.js";import{$n as H,Fi as le,Li as ue,Pi as de,Qr as fe,cr as pe,dr as me,n as U,ni as W,r as he,zt as ge}from"./GithubIcon.es-B1lB1Q-8.js";import{c as _e,o as ve,r as ye,s as be,t as xe}from"./useBoardEditor-Dm78Yoiu.js";import{i as Se,t as Ce}from"./SkillBadges-DbbPhC5O.js";import{a as G,c as we,f as Te,l as Ee,s as De}from"./boardConfigPaths-Btimpi_r.js";import{t as K}from"./AlertDialog.es-Z2cFKrup.js";import{t as q}from"./SettingsSubsection-DznON6FW.js";import{r as Oe}from"./CompositeItem-CD2x3KaL.js";import{n as ke}from"./useBoardCatalog-DZf1osB2.js";import{h as Ae,o as je}from"./useIntakeRoutes-BNBPe6sx.js";import{a as Me,d as Ne,t as Pe}from"./BoardIcons-DXB--WrY.js";import{i as Fe,n as Ie,r as Le,t as Re}from"./IconPencil.es-D_eBYY1c.js";import{r as ze}from"./overlays-B3sO28Cg.js";import{t as Be}from"./DescriptionMarkdown-CoP2xvHU.js";import{h as Ve,w as He,y as Ue}from"./ruleLanes-D9QkgLJm.js";import{k as We}from"./TabsRoot-C1o0G1CK.js";import{t as Ge}from"./CodeEditor-CfxlNg4f-D29InJfs.js";import{a as Ke,n as qe,r as Je,t as Ye}from"./Field.es-BmqB8MIv.js";import{t as Xe}from"./input-DqReKX0A-B4MUvQwj.js";import{a as Ze,n as Qe}from"./input-group-C2kg3je7-38FwKlyX.js";import{a as $e,i as et,n as tt,r as nt,t as rt}from"./InputNumber.es-BoS5sRR-.js";import{i as it,n as at,r as ot,t as st}from"./select-Bdt18YBg-DJqvU5Dv.js";import{E as ct}from"./combobox-parts-s-DJvMW4-CR5ZbuEq.js";import{n as lt,t as ut}from"./ConditionRows-CJG9M2Dv.js";import{n as dt}from"./IconUserDuo.es-0xR_m2_v.js";import{_t as ft}from"./useSessionRows-aTHnrKGG.js";import{t as pt}from"./IconPlusMedium.es-QmObHPf-.js";import{t as mt}from"./TrashIcon.es-CLx-KWTg.js";import{n as ht,t as gt}from"./boardCatalog-y-s19dQU.js";import{t as _t}from"./IconArrowRotateCounterClockwise.es-DwgpnNS1.js";import{t as vt}from"./InlineText-vWKzGKx_.js";import{t as yt}from"./LoadErrorState-DVbqZ6DX.js";var J=e(se(),1),bt=`mx-auto w-full max-w-2xl`,xt=`[container-type:inline-size] h-full min-h-0 overflow-auto overscroll-x-contain [scrollbar-gutter:stable]`,St=`sticky left-0 w-[100cqw] px-4`,Y=oe();function X({pinned:e,sticky:t,className:n,children:r}){let i=t&&`sticky bottom-4 z-10`;return e?(0,Y.jsx)(`div`,{className:z(St,i),children:(0,Y.jsx)(`div`,{className:z(bt,n),children:r})}):(0,Y.jsx)(`div`,{className:z(bt,i,n),children:r})}function Ct({factoryId:e,boardId:t,phase:n,skills:r}){let i=n.runner;if(!i)return null;let a=i.skill,o=a?r?.find(e=>e.name===a):void 0,s=a!==void 0&&r!==void 0&&o===void 0,c=s||o?.error!==void 0,u=a&&!s?we(e,t,a):G(e,t,n.key),f=a?l:ze;return(0,Y.jsxs)(Ie,{children:[(0,Y.jsxs)(Fe,{delay:0,closeDelay:100,render:(0,Y.jsx)(H,{to:u}),className:z(V,`border-border bg-fill-subtle hover:bg-fill flex w-fit max-w-full min-w-0 items-center gap-1.5 rounded-md border px-1.5 py-0.5 transition-colors`,c&&`border-destructive-foreground text-destructive-foreground`),children:[(0,Y.jsx)(f,{"aria-hidden":!0,className:`size-icon-sm shrink-0 opacity-70`}),(0,Y.jsx)(`span`,{className:`truncate`,children:a??`Agent`}),c&&(0,Y.jsx)(`span`,{className:`sr-only`,children:s?`, skill not found`:`, skill failed to load`})]}),(0,Y.jsxs)(Le,{side:`right`,align:`start`,sideOffset:8,collisionPadding:8,showArrow:!1,className:`flex w-96 max-w-[calc(100vw-2rem)] flex-col gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(f,{"aria-hidden":!0,className:`text-muted-foreground size-icon-md shrink-0`}),(0,Y.jsx)(B,{as:`span`,variant:`label`,tone:`ink`,className:`truncate`,children:a??`${n.name} agent`}),o&&(0,Y.jsx)(Ce,{skill:o})]}),s?(0,Y.jsxs)(B,{as:`p`,variant:`caption`,role:`alert`,className:`text-destructive-foreground`,children:[`This factory has no `,a,` skill, so cards entering `,n.name,` fail to start.`]}):o?.error?(0,Y.jsxs)(B,{as:`p`,variant:`caption`,role:`alert`,className:`text-destructive-foreground`,children:[`Agents can't load this skill: `,o.error]}):o?.description&&(0,Y.jsx)(B,{as:`p`,variant:`caption`,tone:`muted`,children:o.description}),a&&!r&&(0,Y.jsx)(d,{children:`Loading the skill…`}),o?.content.trim()&&(0,Y.jsx)(wt,{title:`Skill instructions`,children:(0,Y.jsx)(Be,{titleLevel:`h3`,children:o.content})}),i.instructions?.trim()&&(0,Y.jsx)(wt,{title:`${n.name} adds`,children:(0,Y.jsx)(Be,{titleLevel:`h3`,children:i.instructions})}),i.goal?.objective&&(0,Y.jsx)(wt,{title:i.goal.maxRuns?`Goal, up to ${i.goal.maxRuns} runs`:`Goal`,children:(0,Y.jsx)(B,{as:`p`,variant:`body-sm`,className:`whitespace-pre-wrap`,children:i.goal.objective})}),(0,Y.jsxs)(B,{as:`p`,variant:`caption`,tone:`muted`,children:[`Session `,i.context||`work`,`, shared with phases that name it too.`]})]})]})}function wt({title:e,children:t}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(B,{as:`span`,variant:`caption`,tone:`faint`,children:e}),(0,Y.jsx)(`div`,{className:`bg-fill-subtle max-h-56 overflow-y-auto rounded-md px-2.5 py-2`,children:t})]})}function Tt({rules:e,title:t,to:n,boardId:r,boards:i}){return(0,Y.jsxs)(Ie,{children:[(0,Y.jsx)(Fe,{delay:0,closeDelay:100,render:(0,Y.jsx)(H,{to:n}),className:z(V,`w-fit rounded-sm underline decoration-dotted underline-offset-2`),children:Ve(e.length)}),(0,Y.jsxs)(Le,{side:`right`,align:`start`,sideOffset:8,collisionPadding:8,showArrow:!1,className:`flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2`,children:[(0,Y.jsx)(B,{as:`span`,variant:`caption`,tone:`faint`,children:t}),(0,Y.jsx)(`ul`,{"aria-label":t,className:`flex max-h-80 flex-col gap-1.5 overflow-y-auto`,children:e.map(e=>(0,Y.jsx)(s,{rule:e,boardId:r,boards:i},e.id))})]})]})}var Et=`px-[max(0.75rem,calc((100cqw_-_42rem)/2_-_1.25rem))]`;function Dt({factoryId:e,boardId:t,phases:n,skills:r,action:a,onAutoStart:o}){let s=ke(e),c=je(e),l=s.isPending||c.isPending,u=s.data?.find(e=>e.id===t)?.initialPhase??n[0]?.key,f=n.map(e=>h(e,n)),g=c.data&&u?i(c.data.intakeRoutes,{key:t,initialPhase:u}):void 0;return(0,Y.jsxs)(`section`,{"aria-label":`Board map`,className:`flex flex-col gap-3`,children:[a&&(0,Y.jsx)(X,{pinned:!0,className:`flex justify-end`,children:a}),c.isError&&(0,Y.jsx)(X,{pinned:!0,children:(0,Y.jsx)(U,{variant:`warning`,children:(0,Y.jsx)(U.Message,{children:`Rules didn’t load, so the map doesn’t count them.`})})}),g&&g.leaving.length>0&&(0,Y.jsx)(X,{pinned:!0,className:`mb-4`,children:(0,Y.jsxs)(B,{as:`p`,variant:`caption`,tone:`muted`,children:[(0,Y.jsx)(Tt,{rules:g.leaving,title:`Rules that send cards to other boards`,to:De(e,t,`leaving`),boardId:t,boards:s.data}),` `,g.leaving.length===1?`sends`:`send`,` cards from here to other boards.`]})}),(0,Y.jsx)(`ol`,{"aria-label":`Phases`,className:z(`mx-auto flex w-max`,Et),children:n.map(i=>{let a=Me(t,i.kind),c=g?.into.get(i.key)??[];return(0,Y.jsxs)(`li`,{"aria-label":i.name,className:`before:via-border-strong relative flex w-64 shrink-0 flex-col px-2 not-first:before:absolute not-first:before:inset-y-0 not-first:before:left-0 not-first:before:w-px not-first:before:bg-linear-to-b not-first:before:from-transparent not-first:before:to-transparent`,children:[(0,Y.jsx)(`div`,{className:`flex items-center gap-2 px-3 pt-3 pb-1`,children:(0,Y.jsxs)(H,{to:G(e,t,i.key),className:`flex min-w-0 items-center gap-2 hover:underline focus-visible:underline focus-visible:outline-hidden`,children:[(0,Y.jsx)(Pe,{stage:i.key,kind:a,decorative:!0}),(0,Y.jsx)(B,{as:`span`,variant:`label`,tone:`ink`,className:`truncate`,children:i.name})]})}),(0,Y.jsx)(`div`,{className:`px-3 py-3`,children:(0,Y.jsx)(m,{boardId:t,phase:h(i,n),phases:f,arrivals:(0,Y.jsxs)(Y.Fragment,{children:[l?(0,Y.jsx)(Oe,{className:`h-4 w-20`}):g?c.length>0?(0,Y.jsx)(Tt,{rules:c,title:`Rules that move cards into ${i.name}`,to:De(e,t,{into:i.key}),boardId:t,boards:s.data}):(0,Y.jsx)(d,{children:`No rule moves cards here`}):(0,Y.jsx)(d,{children:`Rules didn’t load`}),i.key===u&&(0,Y.jsx)(d,{children:`New cards start here`})]}),starts:(0,Y.jsx)(p,{label:i.name,autoStart:i.autoStart??!1,autoStartWhen:i.autoStartWhen,onChange:o&&(e=>o(i.key,e))}),agent:(0,Y.jsx)(Ct,{factoryId:e,boardId:t,phase:i,skills:r})})})]},i.key)})})]})}var Ot=`Finish or remove unfinished conditions to save.`;function kt({label:e,description:t,rule:n,disabled:r,facts:i=Ue,options:o,schema:s,json:c,onChange:l,onUnfinished:u}){let[d,f]=(0,J.useState)(void 0),p=c?c.text:d,m=c?c.onChange:f,h=(0,J.useId)(),g=p===void 0?a(s,n):v(s,p),_=e=>{m(e);let t=re(s,e);`problem`in t?l(n??null,t.problem):l(t.rule,void 0)};return(0,Y.jsxs)(Ye,{invalid:g!==void 0,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(Ke,{htmlFor:h,children:e}),(0,Y.jsx)(W,{size:`sm`,variant:`ghost`,disabled:r,onClick:()=>{p===void 0?m(n?JSON.stringify(n,null,2):``):(m(void 0),l(n??null,a(s,n)))},children:p===void 0?`Edit as JSON`:`Edit as conditions`})]}),(0,Y.jsx)(qe,{children:t}),p===void 0?r?(0,Y.jsx)(B,{id:h,as:`p`,variant:`caption`,tone:`muted`,children:He(n,o)}):(0,Y.jsx)(`div`,{id:h,children:(0,Y.jsx)(ut,{label:e,rule:n,facts:i,options:o,onChange:(e,t)=>{u?.(t),t?l(n??null,Ot):l(e,a(s,e))}})}):(0,Y.jsx)(M,{id:h,"aria-label":`${e} JSON`,value:p,disabled:r,rows:6,onChange:e=>_(e.target.value)}),g&&(0,Y.jsx)(Je,{children:g})]})}var At=`inline-flex h-8 max-w-48 min-w-0 items-center gap-1.5 rounded-lg border px-2.5`;function jt({phase:e,phases:t,next:n,required:r,boardId:i,disabled:a,onChange:o}){let s=e=>o(n.includes(e)?n.filter(t=>t!==e):t.filter(t=>t.key===e||n.includes(t.key)).map(e=>e.key));return(0,Y.jsx)(`ul`,{"aria-label":`Allowed moves from ${e.name}`,className:`flex flex-wrap gap-1.5`,children:t.map(t=>{let o=(0,Y.jsx)(Pe,{stage:t.key,kind:Me(i,t.kind),decorative:!0});if(t.key===e.key)return(0,Y.jsxs)(`li`,{className:z(At,`border-border-strong bg-card shadow-raised dark:bg-muted`),children:[o,(0,Y.jsx)(Mt,{children:t.name}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`(this phase)`})]},t.key);let c=n.includes(t.key),l=c&&r.has(t.key),u=l||a,d=(0,Y.jsxs)(`button`,{type:`button`,"aria-pressed":c,"aria-label":l?`${t.name} (locked)`:void 0,"aria-disabled":u||void 0,onClick:u?void 0:()=>s(t.key),className:z(At,`group/move transition-colors`,c?`bg-fill text-foreground border-transparent`:`border-border text-muted-foreground border-dashed`,!u&&(c?`hover:bg-fill-hover`:`hover:text-foreground hover:border-border-strong`),u&&!l&&`cursor-default`,V),children:[(0,Y.jsx)(`span`,{className:z(`grid place-items-center`,!c&&`opacity-50`),children:o}),(0,Y.jsx)(Mt,{children:t.name}),(0,Y.jsx)(`span`,{className:`text-muted-foreground grid size-3.5 shrink-0 place-items-center`,children:l?(0,Y.jsx)(dt,{className:`size-icon-sm`,"aria-hidden":!0}):c?(0,Y.jsx)(ft,{className:`size-icon-sm`,"aria-hidden":!0}):!a&&(0,Y.jsx)(pt,{className:`size-icon-sm invisible group-hover/move:visible group-focus-visible/move:visible`,"aria-hidden":!0})})]});return(0,Y.jsx)(`li`,{className:`min-w-0`,children:l?(0,Y.jsxs)(de,{children:[(0,Y.jsx)(ue,{render:d}),(0,Y.jsx)(le,{children:`Factory's code makes this move`})]}):d},t.key)})})}function Mt({children:e}){return(0,Y.jsx)(B,{as:`span`,variant:`label`,className:`truncate`,children:e})}function Nt({label:e,children:t}){return(0,Y.jsx)(`ol`,{"aria-label":e,className:`flex flex-col`,children:t})}function Z({icon:e,title:t,description:n,children:r}){let i=(0,J.useId)();return(0,Y.jsxs)(`li`,{"aria-labelledby":i,className:`before:bg-border relative grid grid-cols-[--spacing(7)_minmax(0,1fr)] gap-x-3 pb-8 before:absolute before:top-9 before:bottom-1 before:left-[calc(--spacing(3.5)-0.5px)] before:w-px last:pb-0 last:before:hidden`,children:[(0,Y.jsx)(`span`,{className:`border-border bg-card text-muted-foreground [&_svg]:size-icon-sm flex size-7 items-center justify-center rounded-full border`,children:e}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-h-7 flex-col justify-center`,children:[(0,Y.jsx)(B,{as:`h2`,id:i,variant:`subheading`,tone:`ink`,children:t}),n&&(0,Y.jsx)(B,{as:`p`,variant:`caption`,tone:`muted`,children:n})]}),r]})]})}var Pt=`__none__`,Ft=`sm:max-w-xs`,It=(e,t)=>e>=t-200?` ${e}/${t}`:``;function Q({title:e,description:t,error:n,disabled:r,children:i,after:a}){return(0,Y.jsxs)(ae,{children:[(0,Y.jsxs)(Ye,{invalid:!!n,disabled:r,children:[(0,Y.jsx)(F,{children:e}),(0,Y.jsx)(qe,{children:t}),i,n&&(0,Y.jsx)(Je,{children:n})]}),a]})}function Lt({label:e,value:t,placeholder:n,disabled:r,onChange:i}){return(0,Y.jsx)(L,{children:(0,Y.jsx)(`div`,{className:`px-4 py-3`,children:(0,Y.jsx)(Ge,{"aria-label":e,value:t,placeholder:n,editable:!r,onChange:i,language:`markdown`,font:`body`,variant:`inline`,lineNumbers:!1,showCopyButton:!1})})})}function Rt({phase:e,phases:t,requiredNextPhases:n,skills:r,skillsEditable:i,factoryId:a,boardId:o,disabled:s,rawRules:c,onChange:u,onRawRule:d,onUnfinished:f,onRemove:p}){let m=lt(a),h=e.kind===`working`,g=y(e,t),_=e.runner?.instructions??``,v=e.runner?.goal,x=v?.objective??``,C=e.tools??[],w=e.exitTool?.id??``,T=e.runner?.skill,E=T?r?.find(e=>e.name===T):void 0,ee=T!==void 0&&r!==void 0&&E===void 0,O=t=>{let n={...e.runner,...t},r=Object.fromEntries(Object.entries(n).filter(([,e])=>e!=null&&e!==``));u({...e,runner:Object.keys(r).length>0?r:null})},k=e=>({text:c[e],onChange:t=>d(e,t)}),M=(0,Y.jsx)(jt,{phase:e,phases:t,next:g,required:new Set(n),boardId:o,disabled:s,onChange:t=>u({...e,nextPhases:t})}),P=p&&(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(W,{variant:`ghost`,icon:(0,Y.jsx)(mt,{}),onClick:p,children:[`Remove `,e.name]})});return h?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,Y.jsxs)(Nt,{label:`How ${e.name} runs`,children:[(0,Y.jsx)(Z,{icon:(0,Y.jsx)(Ne,{}),title:`Starts`,children:(0,Y.jsxs)(L,{children:[(0,Y.jsx)(I,{label:`Start on its own`,disabled:s,children:(0,Y.jsx)(ct,{"aria-label":`${e.name}: start on its own`,checked:e.autoStart??!1,disabled:s,onCheckedChange:t=>{u(S(e,t)),t||d(`autoStartWhen`,void 0)}})}),e.autoStart&&(0,Y.jsx)(`div`,{className:`px-4 py-3`,children:(0,Y.jsx)(kt,{label:`${e.name}: start only when`,description:`Leave empty to start every card on its own.`,rule:e.autoStartWhen,schema:Ae,options:{"source.repository":m},disabled:s,json:k(`autoStartWhen`),onUnfinished:e=>f(`autoStartWhen`,e),onChange:t=>u({...e,autoStartWhen:t})})})]})}),(0,Y.jsxs)(Z,{icon:(0,Y.jsx)(ze,{}),title:`Agent runs`,children:[(0,Y.jsx)(Q,{title:`Instructions`,description:`Added to the agent's prompt when the phase starts.${It(_.length,N)}`,error:_.length>1e3?`Too long to save.`:void 0,disabled:s,children:(0,Y.jsx)(Lt,{label:`${e.name} instructions`,value:_,placeholder:`Tell the agent what to do, in Markdown`,disabled:s,onChange:e=>O({instructions:e})})}),(0,Y.jsx)(Q,{title:`Goal`,description:`The agent keeps working until a judge finds this objective met. Leave empty for a single run.${It(x.length,D)}`,error:x.length>2e3?`Too long to save.`:void 0,disabled:s,after:v&&(0,Y.jsxs)(Ye,{invalid:!j(v.maxRuns),disabled:s,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(Ke,{info:`After this many runs without meeting the goal, the card waits for a person. From 1 to 50; leave empty for Factory's default.`,children:`Pause goal after`}),(0,Y.jsx)(rt,{className:`w-36`,min:1,max:50,allowOutOfRange:!0,value:v.maxRuns??null,disabled:s,onValueChange:e=>{let{maxRuns:t,...n}=v;O({goal:e===null?n:{...n,maxRuns:e}})},children:(0,Y.jsxs)(nt,{size:`sm`,children:[(0,Y.jsx)($e,{placeholder:`Default`}),(0,Y.jsxs)(Qe,{align:`inline-end`,variant:`flush`,children:[(0,Y.jsx)(Ze,{className:`mr-1`,children:`runs`}),(0,Y.jsx)(tt,{}),(0,Y.jsx)(et,{})]})]})})]}),!j(v.maxRuns)&&(0,Y.jsxs)(Je,{children:[`Use a whole number from 1 to `,50,`.`]})]}),children:(0,Y.jsx)(Lt,{label:`${e.name} goal`,value:x,placeholder:`Describe what done looks like`,disabled:s,onChange:e=>O({goal:e.trim()?{...v,objective:e}:void 0})})}),(0,Y.jsx)(Q,{title:`Session`,description:`Phases with the same session share one agent session per card.`,disabled:s,children:(0,Y.jsx)(Xe,{className:Ft,"aria-label":`${e.name} session`,value:e.runner?.context??``,placeholder:b,disabled:s,onChange:e=>O({context:e.target.value})})}),(0,Y.jsx)(q,{title:`Skill`,children:(0,Y.jsx)(L,{children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 py-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsxs)(st,{value:T??Pt,disabled:s,onValueChange:e=>O({skill:e===Pt?void 0:String(e)}),children:[(0,Y.jsx)(it,{variant:`ghost`,size:`sm`,"aria-label":`${e.name} skill`,className:`-ml-2 w-fit`,children:(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(l,{"aria-hidden":!0,className:`text-muted-foreground size-icon-md shrink-0`}),(0,Y.jsx)(`span`,{className:`truncate`,children:T??`No skill`})]})}),(0,Y.jsxs)(at,{children:[(0,Y.jsx)(ot,{value:Pt,children:`None`}),(r??[]).map(e=>(0,Y.jsx)(ot,{value:e.name,children:e.name},e.name))]})]}),ee&&(0,Y.jsx)(We,{variant:`destructive`,children:`Not found`}),E?.error&&(0,Y.jsx)(We,{variant:`destructive`,children:`Failed to load`}),E&&(0,Y.jsx)(Ce,{skill:E}),E&&(0,Y.jsx)(W,{size:`sm`,variant:`ghost`,icon:i?(0,Y.jsx)(Re,{}):(0,Y.jsx)(he,{}),"aria-label":`${i?`Edit`:`View`} ${E.name}`,className:`ml-auto`,render:(0,Y.jsx)(H,{to:we(a,o,E.name)}),children:i?`Edit`:`View`})]}),E?.error?(0,Y.jsxs)(B,{as:`p`,variant:`caption`,role:`alert`,className:`text-destructive-foreground`,children:[`Agents can't load this skill: `,E.error]}):ee?(0,Y.jsxs)(B,{as:`p`,variant:`caption`,role:`alert`,className:`text-destructive-foreground`,children:[`This factory has no `,T,` skill, so cards entering `,e.name,` fail to start.`]}):E?.description&&(0,Y.jsx)(B,{as:`p`,variant:`caption`,tone:`muted`,children:E.description})]})})}),(0,Y.jsx)(q,{title:`Factory tools`,description:`Given to the session that works the card in this phase.`,children:(0,Y.jsx)(L,{children:A.map(t=>(0,Y.jsx)(I,{label:t.label,disabled:s,children:(0,Y.jsx)(ct,{"aria-label":`${e.name}: ${t.label}`,checked:C.includes(t.id),disabled:s,onCheckedChange:n=>{let r=A.map(({id:e})=>e).filter(e=>e===t.id?n:C.includes(e));u({...e,tools:r.length>0?r:null})}})},t.id))})})]}),(0,Y.jsxs)(Z,{icon:(0,Y.jsx)(ne,{}),title:`Ends`,children:[(0,Y.jsx)(Q,{title:`Exit tool`,description:`Ends the phase when it succeeds. Leave empty for none.`,disabled:s,children:(0,Y.jsx)(Xe,{className:Ft,"aria-label":`${e.name} exit tool`,value:w,disabled:s,onChange:t=>{let n=t.target.value.trim();u({...e,exitTool:n?{...e.exitTool,id:n}:null}),n||d(`autoApproveWhen`,void 0)}})}),w!==``&&(0,Y.jsxs)(L,{children:[(0,Y.jsx)(I,{label:`Approve on its own`,disabled:s,children:(0,Y.jsx)(ct,{"aria-label":`${e.name}: approve ${w} on its own`,checked:e.exitTool?.autoApprove??!1,disabled:s,onCheckedChange:t=>{u({...e,exitTool:{...e.exitTool,id:w,autoApprove:t,autoApproveWhen:t?e.exitTool?.autoApproveWhen:void 0}}),t||d(`autoApproveWhen`,void 0)}})}),e.exitTool?.autoApprove&&(0,Y.jsx)(`div`,{className:`px-4 py-3`,children:(0,Y.jsx)(kt,{label:`${e.name}: approve only when`,description:`Leave empty to approve for every card.`,rule:e.exitTool.autoApproveWhen,schema:Ae,options:{"source.repository":m},disabled:s,json:k(`autoApproveWhen`),onUnfinished:e=>f(`autoApproveWhen`,e),onChange:t=>u({...e,exitTool:{...e.exitTool,id:w,autoApprove:!0,autoApproveWhen:t??void 0}})})})]})]}),(0,Y.jsx)(Z,{icon:(0,Y.jsx)(te,{}),title:`Allowed moves`,children:M})]}),P]}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,Y.jsx)(q,{title:`Allowed moves`,children:M}),P]})}var zt=[`autoStartWhen`,`autoApproveWhen`];function Bt({factory:e,boardId:t,phaseKey:n,response:i,skills:a,skillsEditable:o,sidebarHidden:s,onReload:c}){let{board:u,canEdit:d}=i,{draft:f,rawRules:p,locked:m,setDraft:h,setRawRule:g,discard:v}=k(e.id,t,u),[y,b]=(0,J.useState)(0),C=()=>{v(),b(e=>e+1)},ee=me(),D=_e(e.id,t),te=fe(),A=!d||!u.editable,j=n?f.phases.find(e=>e.key===n):void 0,M=j&&`${j.key}:${u.revision??`code`}:${y}`,[N,P]=(0,J.useState)({page:M,fields:[]});N.page!==M&&P({page:M,fields:[]});let ne=N.page===M?N.fields:[],re=(e,t)=>P(n=>{let r=n.fields.filter(t=>t!==e);return{...n,fields:t?[...r,e]:r}}),ie=!A&&(_(f,u)||Object.keys(p).length>0||ne.length>0),F=f.phases.filter(e=>x(e,p)||e===j&&ne.length>0),I=f.name.trim()===``,ae=D.error?.code===`revision_mismatch`,R=pe(({nextLocation:n})=>{let r=te.getQueryData(ge.boardCatalog(e.id))?.boards.some(e=>e.id===t);if(!ie||r===!1)return!1;let i=Te(n.pathname);return i?.factoryId!==e.id||i.boardId!==t||i.skills===!0||i.rules===!0||i.intake===!0}),oe=G(e.id,t),se;return se=n&&!j?(0,Y.jsx)(r,{titleSlot:(0,Y.jsxs)(`span`,{role:`alert`,children:[u.name,` has no such phase.`]}),actionSlot:(0,Y.jsx)(W,{size:`sm`,render:(0,Y.jsx)(H,{to:oe}),children:`Back to general`})}):j?(0,Y.jsx)(Rt,{phase:j,phases:f.phases,requiredNextPhases:u.codeBehaviour?.[j.key]?.requiredNextPhases??[],skills:a,skillsEditable:o,factoryId:e.id,boardId:t,disabled:A||m,rawRules:{autoStartWhen:p[O(j.key,`autoStartWhen`)],autoApproveWhen:p[O(j.key,`autoApproveWhen`)]},onRawRule:(e,t)=>{g(O(j.key,e),t),re(e,!1)},onUnfinished:re,onRemove:A||m||!w(f.phases,j.key,u.codeBehaviour)?void 0:()=>{for(let e of zt)g(O(j.key,e),void 0);h(e=>({...e,phases:E(e.phases,j.key)})),ee(oe)},onChange:e=>h(t=>({...t,phases:t.phases.map(t=>t.key===e.key?e:t)}))},M):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,Y.jsx)(Dt,{factoryId:e.id,boardId:t,phases:f.phases,skills:a,onAutoStart:A||m?void 0:(e,t)=>{h(n=>({...n,phases:n.phases.map(n=>n.key===e?S(n,t):n)})),t||g(O(e,`autoStartWhen`),void 0)},action:s&&!A?(0,Y.jsx)(T,{factoryId:e.id,boardId:t,board:u,disabled:m}):void 0}),(0,Y.jsx)(X,{pinned:!0,className:`flex flex-col gap-8 empty:hidden`,children:s&&(0,Y.jsx)(q,{title:`Factory`,children:(0,Y.jsx)(L,{children:(0,Y.jsxs)(H,{to:Ee(e.id,t),className:`hover:bg-fill focus-visible:bg-fill flex items-center gap-3 px-4 py-3 focus-visible:outline-hidden`,children:[(0,Y.jsx)(l,{className:`text-muted-foreground size-icon-md`,"aria-hidden":!0}),(0,Y.jsx)(B,{as:`span`,variant:`label`,className:`min-w-0 flex-1 truncate`,children:`Skills`}),(0,Y.jsx)(ce,{className:`text-muted-foreground size-icon-md`,"aria-hidden":!0})]})})})})]}),(0,Y.jsxs)(`div`,{className:z(`flex flex-col gap-8 pb-4`,!j&&`w-max min-w-full`),children:[u.editable?!d&&(0,Y.jsx)(X,{pinned:!j,children:(0,Y.jsx)(U,{variant:`info`,children:`Only organization admins can change this board.`})}):(0,Y.jsx)(X,{pinned:!j,children:(0,Y.jsx)(U,{variant:`info`,children:`This board is defined in code, so it can't be changed here.`})}),!j&&u.problems.length>0&&(0,Y.jsx)(X,{pinned:!0,children:(0,Y.jsx)(U,{variant:`warning`,title:`This board has problems`,children:(0,Y.jsx)(U.Message,{children:u.problems.join(` `)})})}),se,ie&&(0,Y.jsxs)(X,{pinned:!j,sticky:!0,className:`rounded-card bg-card shadow-overlay dark:bg-muted flex flex-col gap-3 p-3`,children:[ae&&(0,Y.jsx)(U,{variant:`warning`,title:`Someone else changed this board`,action:(0,Y.jsx)(U.Button,{onClick:c,children:`Reload`}),children:(0,Y.jsx)(U.Message,{children:`Reload to see their version. Your unsaved changes will be lost.`})}),D.error&&!ae&&(0,Y.jsx)(U,{variant:`destructive`,role:`alert`,children:(0,Y.jsxs)(U.Message,{children:[`The board was not saved. `,D.error.reasons]})}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(B,{variant:`body-sm`,tone:`muted`,className:`min-w-0 flex-1`,role:`status`,children:I?`Name the board to save.`:F.length>0?`Fix ${F.map(e=>e.name||e.key).join(`, `)} to save.`:`Unsaved changes`}),(0,Y.jsx)(W,{size:`sm`,variant:`ghost`,disabled:D.isPending,onClick:C,children:`Discard`}),(0,Y.jsx)(W,{size:`sm`,variant:`primary`,disabled:D.isPending||I||F.length>0,onClick:()=>D.mutate({name:f.name,description:f.description,phases:f.phases,expectedRevision:u.revision??0}),children:D.isPending?`Saving…`:`Save`})]})]}),(0,Y.jsx)(K,{open:R.state===`blocked`,onOpenChange:e=>!e&&R.reset?.(),children:(0,Y.jsxs)(K.Content,{children:[(0,Y.jsxs)(K.Header,{children:[(0,Y.jsxs)(K.Title,{children:[`Discard changes to `,u.name,`?`]}),(0,Y.jsx)(K.Description,{children:`Your unsaved changes to this board will be lost.`})]}),(0,Y.jsxs)(K.Footer,{children:[(0,Y.jsx)(K.Cancel,{children:`Keep editing`}),(0,Y.jsx)(W,{variant:`destructive`,size:`md`,onClick:()=>{v(),R.proceed?.()},children:`Discard`})]})]})})]})}function Vt({name:e,pending:t,onDelete:n}){return(0,Y.jsxs)(K,{children:[(0,Y.jsx)(K.Trigger,{render:(0,Y.jsx)(W,{variant:`ghost`,size:`sm`,icon:(0,Y.jsx)(mt,{}),disabled:t,children:`Delete`})}),(0,Y.jsxs)(K.Content,{children:[(0,Y.jsxs)(K.Header,{children:[(0,Y.jsxs)(K.Title,{children:[`Delete `,e,`?`]}),(0,Y.jsx)(K.Description,{children:`The board and its phases are removed from this project. A board that still has cards can’t be deleted.`})]}),(0,Y.jsxs)(K.Footer,{children:[(0,Y.jsx)(K.Cancel,{children:`Cancel`}),(0,Y.jsx)(K.Action,{onClick:n,children:`Delete`})]})]})]})}function Ht({name:e,pending:t,onReset:n}){return(0,Y.jsxs)(K,{children:[(0,Y.jsx)(K.Trigger,{render:(0,Y.jsx)(W,{variant:`ghost`,size:`sm`,icon:(0,Y.jsx)(_t,{}),tooltip:`Go back to Factory's version of this board`,tooltipPosition:`bottom`,disabled:t,children:`Reset`})}),(0,Y.jsxs)(K.Content,{children:[(0,Y.jsxs)(K.Header,{children:[(0,Y.jsxs)(K.Title,{children:[`Reset `,e,` to default?`]}),(0,Y.jsx)(K.Description,{children:`Every change made to this board's name and phases is replaced with Factory's version.`})]}),(0,Y.jsxs)(K.Footer,{children:[(0,Y.jsx)(K.Cancel,{children:`Cancel`}),(0,Y.jsx)(K.Action,{onClick:n,children:`Reset`})]})]})]})}var $={resting:{label:`Resting`,meaning:`No agent works here. Cards wait for a person or an event to move them.`},working:{label:`Working`,meaning:`An agent works on each card here, following the steps below.`},terminal:{label:`Terminal`,meaning:`Cards are finished here. Their agent sessions stop.`}},Ut=[`resting`,`working`,`terminal`];function Wt({label:e,meaning:t,children:n}){return(0,Y.jsxs)(de,{children:[(0,Y.jsx)(ue,{render:(0,Y.jsx)(`span`,{role:`img`,tabIndex:0,"aria-label":`${e}. ${t}`,className:z(`inline-flex rounded-sm`,V),children:n})}),(0,Y.jsx)(le,{side:`bottom`,className:`max-w-72`,children:t})]})}function Gt({factoryId:e,boardId:t,phaseKey:n,response:r}){let{board:i,canEdit:a}=r,{draft:s,locked:c,setDraft:l,setRawRule:u,discard:d}=k(e,t,i),f=ke(e),p=me(),m=!a||!i.editable||c,h=be(e,t),_=ve(e,t,()=>{d();let n=ht(f.data??[]).find(e=>e.id!==t);p(n?gt(e,n.id):`/factories/${e}`,{replace:!0})}),v=!n&&a&&i.editable,y=v&&i.source!==`stored`,b=v&&i.source!==`builtin`,x=n?s.phases.find(e=>e.key===n):void 0;if(n&&!x)return null;let S=e=>l(t=>({...t,phases:t.phases.map(t=>t.key===n?{...t,...e}:t)})),C=e=>{x&&(u(O(x.key,`autoStartWhen`),void 0),u(O(x.key,`autoApproveWhen`),void 0),l(t=>({...t,phases:t.phases.map(n=>n.key===x.key?g(n,e,t.phases):n)})))},w=x?x.name:s.name,T=(x?x.description:s.description)??``,E=x!==void 0&&!m&&!P(s.phases,x.key,i.codeBehaviour);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(o,{children:[(0,Y.jsxs)(o.Title,{className:`gap-2.5`,children:[x&&(0,Y.jsx)(Pe,{stage:x.key,kind:Me(t,x.kind),decorative:!0}),(0,Y.jsx)(vt,{value:w,label:x?`Phase name`:`Board name`,required:!0,readOnly:m,variant:`heading`,tone:`ink`,onChange:e=>x?S({name:e}):l(t=>({...t,name:e}))})]}),x&&(0,Y.jsx)(o.Meta,{beside:!0,children:E?(0,Y.jsxs)(st,{value:x.kind,onValueChange:e=>{let t=Ut.find(t=>t===e);t&&C(t)},children:[(0,Y.jsx)(it,{size:`sm`,"aria-label":`Phase kind`,children:$[x.kind].label}),(0,Y.jsx)(at,{children:Ut.map(e=>(0,Y.jsx)(ot,{value:e,children:$[e].label},e))})]}):(0,Y.jsx)(Wt,{label:$[x.kind].label,meaning:$[x.kind].meaning,children:(0,Y.jsx)(We,{children:$[x.kind].label})})}),(T||!m)&&(0,Y.jsx)(o.Description,{children:(0,Y.jsx)(vt,{value:T,label:x?`Phase description`:`Board description`,placeholder:`Add a description`,multiline:!0,readOnly:m,variant:`caption`,tone:`muted`,className:`zoom-safe-text w-full`,onChange:e=>x?S({description:e||null}):l(t=>({...t,description:e||null}))})}),(y||b)&&(0,Y.jsxs)(o.Action,{className:`gap-1`,children:[y&&(0,Y.jsx)(Ht,{name:i.name,pending:c,onReset:()=>h.mutate(i.revision??0)}),b&&(0,Y.jsx)(Vt,{name:i.name,pending:c,onDelete:()=>_.mutate(i.revision??0)})]})]}),h.error&&(0,Y.jsx)(U,{variant:`destructive`,role:`alert`,className:`mt-4`,children:(0,Y.jsxs)(U.Message,{children:[`The board was not reset. `,h.error.reasons]})}),_.error&&(0,Y.jsx)(U,{variant:`destructive`,role:`alert`,className:`mt-4`,children:(0,Y.jsxs)(U.Message,{children:[`The board was not deleted. `,_.error.reasons]})})]})}function Kt(){let e=f(),i=ee(),a=i?.boardId??``,o=i?.phaseKey,{isMobile:s,desktopState:l}=ie(),d=s||l===`collapsed`,p=ye(e.id,a),m=Se(e.id),h=p.data?.board,g=C(e.id,a,h),_=o?g?.phases.find(e=>e.key===o):void 0,v=G(e.id,a),y=c({breadcrumbs:d&&h?(0,Y.jsxs)(n,{label:`Breadcrumb`,className:`min-w-0 flex-1 overflow-hidden`,children:[(0,Y.jsx)(t,{as:H,to:gt(e.id,a),children:g?.name||h.name}),o?(0,Y.jsx)(t,{as:H,to:v,children:`Configure`}):(0,Y.jsx)(t,{as:`span`,isCurrent:!0,children:`Configure`}),_&&(0,Y.jsx)(t,{as:`span`,isCurrent:!0,children:_.name})]}):void 0}),b=p.isSuccess&&(!o||_)?(0,Y.jsx)(Gt,{factoryId:e.id,boardId:a,phaseKey:o,response:p.data},`${a}:${p.data.board.revision??`code`}`):void 0,x=p.isPending?(0,Y.jsx)(L,{children:(0,Y.jsx)(R,{label:`Loading board`,rows:3})}):p.isError&&p.error instanceof xe&&p.error.code===`board_not_found`?(0,Y.jsx)(r,{variant:`fill`,titleSlot:(0,Y.jsx)(`span`,{role:`alert`,children:`Board unavailable: this board is not installed.`})}):p.isError?(0,Y.jsx)(yt,{title:`Couldn’t load this board`,error:p.error,onRetry:()=>void p.refetch(),retrying:p.isFetching}):(0,Y.jsx)(Bt,{factory:e,boardId:a,phaseKey:o,response:p.data,skills:m.data?.skills,skillsEditable:m.data?.canEdit??!1,sidebarHidden:d,onReload:()=>void p.refetch()},`${a}:${p.data.board.revision??`code`}`);return o?(0,Y.jsx)(u,{variant:`settings`,header:b,...y,children:x}):(0,Y.jsx)(u,{variant:`page`,body:`fixed`,header:b&&(0,Y.jsx)(`div`,{className:z(`mx-auto w-full max-w-2xl`,`pb-3`),children:b}),...y,children:(0,Y.jsx)(`div`,{className:p.isSuccess?xt:z(bt,`px-4`),children:x})})}export{Kt as BoardConfigPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,T as t,f as n}from"./IconChevronRightMedium.es-BjSIsine.js";import{s as r}from"./useBoardCatalog-DZf1osB2.js";import{B as i}from"./useSessionRows-aTHnrKGG.js";import{i as a,n as o,o as s,r as c}from"./TrashIcon.es-CLx-KWTg.js";import{t as l}from"./IconCircleDashed.es-Chw6BTXK.js";import{t as u}from"./IconCircleX.es-3P8aywDS.js";import{n as d}from"./IconSettingsSliderHor.es-CSwP_iSG.js";import{t as f}from"./IconCircleCheck.es-e9o_0ikv.js";var p=e();function m({size:e=16,className:t}){return(0,p.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:t,"aria-hidden":!0,children:(0,p.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8 14.67C11.68 14.67 14.67 11.68 14.67 8C14.67 4.32 11.68 1.33 8 1.33C4.32 1.33 1.33 4.32 1.33 8C1.33 11.68 4.32 14.67 8 14.67ZM9.14 5.53C8.88 5.27 8.46 5.27 8.2 5.53C7.93 5.79 7.93 6.21 8.2 6.47L9.06 7.33H5.33C4.97 7.33 4.67 7.63 4.67 8C4.67 8.37 4.97 8.67 5.33 8.67H9.06L8.2 9.53C7.93 9.79 7.93 10.21 8.2 10.47C8.46 10.73 8.88 10.73 9.14 10.47L11.14 8.47C11.4 8.21 11.4 7.79 11.14 7.53L9.14 5.53Z`,fill:`currentColor`})})}var h=n(`IconPlay`,()=>(0,p.jsx)(`path`,{d:`M20.245 10.2984L9.05099 3.38443C7.71854 2.56145 6 3.51992 6 5.08603V18.914C6 20.4801 7.71854 21.4385 9.05098 20.6156L20.245 13.7016C21.5104 12.9201 21.5104 11.0799 20.245 10.2984Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`})),g=n(`IconHammer`,()=>(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`path`,{d:`M6.70694 14.7929C6.31641 15.1834 5.68325 15.1834 5.29272 14.7929L2.45696 11.9571C2.06643 11.5666 2.06643 10.9334 2.45696 10.5429L9.70694 3.29289C9.89447 3.10536 10.1488 3 10.414 3L14.0857 3C14.3509 3 14.6052 3.10536 14.7928 3.29289L15.7927 4.29286C16.1832 4.68338 16.1832 5.31655 15.7927 5.70707L6.70694 14.7929Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,p.jsx)(`path`,{d:`M9.5 12.5L16.3358 19.3358C17.1168 20.1168 18.3832 20.1168 19.1642 19.3358L19.3358 19.1642C20.1168 18.3832 20.1168 17.1168 19.3358 16.3358L12.5 9.5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]}));function _({source:e,className:n}){let{Icon:r,iconClassName:a}=i[e];return(0,p.jsx)(r,{"data-source":e,className:t(`size-4 shrink-0`,a,n),"aria-hidden":!0})}var v={Investigate:d,Build:g,"Prepare approval":o,Review:c};function y(e){let t=v[e]??h;return(0,p.jsx)(t,{"aria-hidden":!0})}var b={resting:`neutral`,working:`info`,terminal:`success`},x={neutral:{icon:`text-muted-foreground`,tint:`bg-fill-subtle`,strongTint:`bg-fill-strong`,gradientFrom:`from-fill-subtle`},orange:{icon:`text-(--orange-500) dark:text-(--orange-400)`,tint:`bg-badge-orange-subtle`,strongTint:`bg-badge-orange-strong`,gradientFrom:`from-badge-orange-subtle`},cyan:{icon:`text-(--cyan-500) dark:text-(--cyan-400)`,tint:`bg-badge-cyan-subtle`,strongTint:`bg-badge-cyan-strong`,gradientFrom:`from-badge-cyan-subtle`},info:{icon:`text-info-indicator`,tint:`bg-info-subtle`,strongTint:`bg-badge-blue-strong`,gradientFrom:`from-badge-blue-subtle`},green:{icon:`text-badge-green-indicator`,tint:`bg-badge-green-subtle`,strongTint:`bg-badge-green-strong`,gradientFrom:`from-badge-green-subtle`},purple:{icon:`text-badge-purple-indicator`,tint:`bg-badge-purple-subtle`,strongTint:`bg-badge-purple-strong`,gradientFrom:`from-badge-purple-subtle`},success:{icon:`text-(--green-500) dark:text-(--green-400)`,tint:`bg-success-subtle`,strongTint:`bg-badge-green-strong`,gradientFrom:`from-badge-green-subtle`},destructive:{icon:`text-destructive-indicator`,tint:`bg-destructive-subtle`,strongTint:`bg-badge-red-strong`,gradientFrom:`from-badge-red-subtle`}};function S({source:e,className:n}){return(0,p.jsx)(`span`,{"aria-hidden":!0,style:{maskImage:`url(${e})`},className:t(`size-4 shrink-0 bg-current mask-center mask-no-repeat mask-contain`,n)})}var C=2.25,w=2*Math.PI*C;function T({progress:e,className:n}){return(0,p.jsxs)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,className:t(`shrink-0`,n),children:[(0,p.jsx)(`circle`,{cx:8,cy:8,r:6,stroke:`currentColor`,strokeWidth:1.5}),(0,p.jsx)(`circle`,{cx:8,cy:8,r:C,stroke:`currentColor`,strokeWidth:C*2,strokeDasharray:`${e*w} ${w}`,transform:`rotate(-90 8 8)`})]})}function E(e,t){return t?void 0:a(e)}function D(e,t){return e===`work`||e===`review`?void 0:t}function O(e,t){let n=r(e,t);return e&&n?D(e.id,n):void 0}function k(e,t){let n=E(e,t);return n?s(n):b[t??`resting`]}function A({stage:e,kind:n,className:r}){let i=t(`shrink-0`,r);switch(E(e,n)??n??`resting`){case`intake`:return(0,p.jsx)(m,{className:i});case`triage`:return(0,p.jsx)(S,{source:`/factory-stage-icons/triage.svg`,className:r});case`planning`:return(0,p.jsx)(T,{progress:.25,className:r});case`execute`:case`working`:return(0,p.jsx)(T,{progress:.5,className:r});case`review`:case`pr-review`:return(0,p.jsx)(S,{source:`/factory-stage-icons/review.svg`,className:r});case`done`:case`terminal`:return(0,p.jsx)(f,{"aria-hidden":!0,className:t(`size-icon-md`,i)});case`canceled`:return(0,p.jsx)(u,{"aria-hidden":!0,className:t(`size-icon-md`,i)});case`resting`:return(0,p.jsx)(l,{"aria-hidden":!0,className:t(`size-icon-md`,i)})}}function j(e,t){return x[k(e,t)].tint}function M(e,n){return t(`bg-fill-subtle dark:bg-card bg-linear-to-r to-transparent`,x[k(e,n)].gradientFrom)}function N(e,t){return x[k(e,t)].strongTint}function P(e,t){return x[k(e,t)].icon}var F=`opacity-30`;function I({stage:e,kind:t,decorative:n=!1}){let r=(0,p.jsx)(A,{stage:e,kind:t,className:x[k(e,t)].icon});return n||!t?r:(0,p.jsx)(`span`,{role:`img`,"aria-label":`${t} phase`,className:`inline-flex shrink-0`,children:r})}export{D as a,N as c,h as d,m as f,O as i,j as l,_ as n,P as o,y as r,M as s,I as t,F as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Fr as t,Nr as n,Pr as r,Tr as i,nn as a}from"./index-D4fnG4KO.js";import{n as o,t as s}from"./Breadcrumb.es-D9PSmzYq.js";import{a as c}from"./Sidebar.es-9pwBnu_Z.js";import{$n as l,n as u,ni as d}from"./GithubIcon.es-B1lB1Q-8.js";import{r as f}from"./useBoardEditor-Dm78Yoiu.js";import{a as p,n as m,s as h,t as g}from"./boardConfigPaths-Btimpi_r.js";import{k as _}from"./TabsRoot-C1o0G1CK.js";import{yt as v}from"./useSessionRows-aTHnrKGG.js";import{O as y,T as b,k as x,n as S}from"./IconChevronRightMedium.es-BjSIsine.js";import{o as C,s as w,t as T,u as E}from"./settings-DTWGb7K_-PW2CFx0g.js";import{a as D,c as O,d as k,i as A,l as j,n as M,o as N,r as P,t as F,u as I}from"./useRowDrag-DQBjWerU.js";import{o as L}from"./useIntakeRoutes-BNBPe6sx.js";import{h as R,p as z}from"./ruleLanes-D9QkgLJm.js";import{s as B}from"./Field.es-BmqB8MIv.js";import{n as V}from"./useBoardCatalog-DZf1osB2.js";import{t as H}from"./SettingsSubsection-DznON6FW.js";import{s as U}from"./settingsSections-B0_LEh3l.js";var W=e(x(),1),G=y();function K({factoryId:e}){let t=A(e),n=D(e),r=new Map((V(e).data??[]).map(e=>[e.id,e.name])),i=t.data?.pages??[],a=i.flatMap(e=>e.notRouted),o=i[0]?.canEdit??!1,s=e=>n.mutate(e.id,{onSuccess:t=>v.success(`Filing “${e.title}” on ${r.get(t.boardKey)??t.boardKey}.`),onError:e=>v.error(e.message)}),c=t.isPending?`Loading…`:t.isError?`Items not routed didn’t load.`:t.hasNextPage?`${a.length>0?`${a.length}+`:`More`} waiting for a board.`:a.length===0?`Every new issue and pull request found a board.`:`${a.length} waiting for a board.`;return(0,G.jsxs)(`section`,{id:m,"aria-label":`Not routed`,className:`flex scroll-mt-4 flex-col gap-3 px-3.5 pt-3 pb-3.5`,children:[(0,G.jsx)(C,{media:(0,G.jsx)(w,{children:(0,G.jsx)(j,{})}),title:(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`Not routed`,(0,G.jsx)(B,{"aria-label":`When an item is not routed`,children:`A new issue or pull request ends up here when no board’s rules take it. Change a board’s rules, then route it again.`})]}),description:c}),(a.length>0||t.hasNextPage)&&(0,G.jsxs)(`ul`,{"aria-label":`Items not routed`,className:`ml-11 flex flex-col`,children:[a.map(t=>(0,G.jsx)(`li`,{className:`border-border border-t py-3`,children:(0,G.jsxs)(C,{title:t.url?(0,G.jsx)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,className:`hover:underline`,children:t.title}):t.title,description:(0,G.jsxs)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:[t.sourceKey&&(0,G.jsx)(`span`,{children:t.sourceKey}),(0,G.jsx)(`span`,{children:t.reason??`No board’s rules match it.`}),(0,G.jsx)(`time`,{dateTime:t.decidedAt,children:q(t.decidedAt)})]}),children:[(0,G.jsx)(M,{factoryProjectId:e,itemId:t.id,label:`Why?`}),o&&(0,G.jsx)(d,{size:`sm`,variant:`ghost`,onClick:()=>s(t),disabled:n.isPending&&n.variables===t.id,children:`Route again`})]})},t.id)),t.hasNextPage&&(0,G.jsx)(`li`,{className:`border-border flex justify-center border-t pt-3`,children:(0,G.jsx)(d,{size:`sm`,variant:`ghost`,onClick:()=>void t.fetchNextPage(),disabled:t.isFetchingNextPage,children:t.isFetchingNextPage?`Loading…`:`Load more`})})]})]})}function q(e){return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}var J=b(`relative before:pointer-events-none before:absolute before:right-0 before:left-0 before:z-20 before:hidden before:h-0.5 before:rounded-full before:bg-border-focus`,`data-[drop=before]:before:top-0 data-[drop=before]:before:block data-[drop=after]:before:bottom-0 data-[drop=after]:before:block`);function Y({factoryId:e}){let t=P(e);return(0,G.jsx)(H,{id:g,scope:`factory`,title:`Intake order`,description:`A new issue or pull request is offered to each board in this order. The first board whose rules take it keeps it.`,children:t.isPending?(0,G.jsx)(T,{children:(0,G.jsx)(E,{label:`Loading intake order`,variant:`item`,rows:3})}):t.isError?(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(u,{variant:`destructive`,children:`The intake order didn’t load.`}),(0,G.jsx)(`div`,{className:`border-border rounded-xl border`,children:(0,G.jsx)(K,{factoryId:e})})]}):(0,G.jsx)(X,{factoryId:e,order:t.data},e)})}function X({factoryId:e,order:t}){let n=L(e),r=N(e),[i,a]=(0,W.useState)(),o=t.boards.map(e=>e.boardKey),s=i&&$(i,o)?i:void 0,c=s??o,f=new Map(t.boards.map(e=>[e.boardKey,e.name])),p=s!==void 0&&s.some((e,t)=>e!==o[t]),m=(e,t)=>{let n=[...c],[r]=n.splice(e,1);r!==void 0&&(n.splice(t,0,r),a(n))},g=F({min:0,max:c.length-1,onDrop:m}),_=()=>r.mutate(c,{onSuccess:()=>{a(void 0),v.success(`Intake order saved.`)},onError:e=>v.error(e.message)}),y=t.canEdit&&c.length>1,x=y&&!r.isPending;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(Q,{order:t,changed:p}),n.isError&&(0,G.jsx)(u,{variant:`warning`,children:`Rule counts didn’t load.`}),(0,G.jsxs)(`div`,{className:`border-border flex flex-col rounded-xl border`,children:[(0,G.jsx)(T,{role:`list`,"aria-label":`Intake order`,children:c.map((t,r)=>{let i=g.drag?.from===r,a=f.get(t)??t;return(0,G.jsx)(C,{role:`listitem`,"data-drop":g.dropAt(r),style:i?{transform:`translateY(${g.drag?.offset??0}px)`}:void 0,onPointerDown:x?e=>g.onPointerDown(e,r):void 0,onKeyDown:x?e=>g.onKeyDown(e,r):void 0,className:b(`group/row`,J,i&&`z-10 opacity-90`),media:(0,G.jsxs)(w,{children:[(0,G.jsx)(S,{as:`span`,variant:`caption`,className:b(`tabular-nums`,y&&`pointer-fine:group-hover/row:hidden`,i&&`hidden`),children:r+1}),y&&(0,G.jsx)(`span`,{"data-grip":!0,"aria-hidden":!0,className:b(`text-icon3 hidden cursor-grab touch-none pointer-fine:group-hover/row:inline-flex`,i&&`inline-flex`),children:(0,G.jsx)(O,{className:`size-icon-md`})})]}),title:a,description:(0,G.jsx)(Z,{routes:n.data?.intakeRoutes,boardKey:t}),children:(0,G.jsxs)(`div`,{className:`flex items-center gap-1 transition-opacity pointer-fine:opacity-0 pointer-fine:group-focus-within/row:opacity-100 pointer-fine:group-hover/row:opacity-100`,children:[y&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(d,{size:`icon-sm`,variant:`ghost`,tooltip:`Check earlier`,disabled:!x||r===0,onClick:()=>m(r,r-1),children:(0,G.jsx)(I,{})}),(0,G.jsx)(d,{size:`icon-sm`,variant:`ghost`,tooltip:`Check later`,disabled:!x||r===c.length-1,onClick:()=>m(r,r+1),children:(0,G.jsx)(k,{})})]}),(0,G.jsx)(d,{size:`sm`,variant:`ghost`,render:(0,G.jsx)(l,{to:h(e,t)}),children:`Edit rules`})]})},t)})}),(0,G.jsx)(K,{factoryId:e})]}),t.canEdit&&p&&(0,G.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,G.jsx)(d,{size:`sm`,variant:`ghost`,onClick:()=>a(void 0),disabled:r.isPending,children:`Discard`}),(0,G.jsx)(d,{size:`sm`,variant:`primary`,onClick:_,disabled:r.isPending,children:`Save order`})]})]})}function Z({routes:e,boardKey:t}){if(!e)return null;let{count:n,catchesAll:r}=z(e.filter(e=>e.target.boardKey===t));return(0,G.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{children:n===0?`No rules for new issues and pull requests`:`${R(n)} for new issues and pull requests`}),r&&(0,G.jsx)(_,{children:`Ends in catch-all`})]})}function Q({order:e,changed:t}){let{compared:n,differing:r,notRouted:i}=e.comparison,a=[];if(e.origin===`derived`&&a.push(`Worked out from the old route list until someone saves an order.`),n>0){let e=i>0?`, ${i} of them Not routed`:``;a.push(r===0?`The last ${n} cards land on the same boards as with the old route list.`:`Of the last ${n} cards, ${r} would land on another board than with the old route list${e}.`)}return e.evaluator===`route-list`&&a.push(`Intake still files cards by the old route list.`),t&&a.push(`Not saved yet. The comparison is for the saved order.`),a.length===0?null:(0,G.jsx)(u,{variant:`info`,children:(0,G.jsx)(`span`,{className:`flex flex-col gap-1`,children:a.map(e=>(0,G.jsx)(`span`,{children:e},e))})})}function $(e,t){let n=new Set(t);return e.length===t.length&&e.every(e=>n.has(e))}function ee(){let e=i(),u=a()?.boardId??``,{isMobile:d,desktopState:m}=c(),h=d||m===`collapsed`,g=f(e.id,u).data?.board,_=n({breadcrumbs:h&&g?(0,G.jsxs)(s,{label:`Breadcrumb`,className:`min-w-0 flex-1 overflow-hidden`,children:[(0,G.jsx)(o,{as:l,to:p(e.id,u),children:g.name}),(0,G.jsx)(o,{as:`span`,isCurrent:!0,children:`Routing`})]}):void 0});return(0,G.jsx)(r,{variant:`settings`,header:(0,G.jsxs)(t,{children:[(0,G.jsx)(t.Title,{children:`Routing`}),(0,G.jsx)(t.Description,{children:(0,G.jsxs)(`span`,{children:[`The order boards are offered new issues and pull requests. What comes in is chosen in`,` `,(0,G.jsx)(l,{to:U(e.id,`intake`),className:`underline`,children:`Settings → Work Intake`}),`.`]})})]}),..._,children:(0,G.jsx)(Y,{factoryId:e.id})})}export{ee as BoardIntakePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$n as t,Fr as n,Jn as r,Kn as i,Nr as a,Pr as o,Tr as s,Yn as c,nn as l,qn as u}from"./index-D4fnG4KO.js";import{n as d,t as f}from"./Breadcrumb.es-D9PSmzYq.js";import{a as p}from"./Sidebar.es-9pwBnu_Z.js";import{$n as m,At as h,Dt as ee,St as g,ir as _,jt as v,kt as y,n as b,ni as x,t as S,wt as C}from"./GithubIcon.es-B1lB1Q-8.js";import{r as w,t as T}from"./useBoardEditor-Dm78Yoiu.js";import{a as E,i as D,o as O,s as k,t as A}from"./boardConfigPaths-Btimpi_r.js";import{r as j}from"./CompositeItem-CD2x3KaL.js";import{yt as M}from"./useSessionRows-aTHnrKGG.js";import{d as N,n as te}from"./settings-DTWGb7K_-PW2CFx0g.js";import{O as P,T as F,k as I,n as L}from"./IconChevronRightMedium.es-BjSIsine.js";import{n as R}from"./useBoardCatalog-DZf1osB2.js";import{c as ne,d as re,l as z,n as B,r as ie,s as V,t as H,u as U}from"./useRowDrag-DQBjWerU.js";import{a as ae,d as oe,f as se,g as W,o as ce,r as G,s as le}from"./useIntakeRoutes-BNBPe6sx.js";import{C as ue,E as de,_ as fe,a as pe,c as K,d as me,f as he,g as ge,i as _e,l as q,m as ve,n as ye,o as be,s as xe,u as J,w as Se}from"./ruleLanes-D9QkgLJm.js";import{t as Y}from"./createLucideIcon-B6gALBEh.js";import{a as Ce,t as we}from"./BoardIcons-DXB--WrY.js";import{t as Te}from"./input-DqReKX0A-B4MUvQwj.js";import{n as Ee,t as De}from"./RadioGroup.es-Ws4_oCJe.js";import{n as Oe,t as ke}from"./ConditionRows-CJG9M2Dv.js";import{i as X,k as Ae}from"./TabsRoot-C1o0G1CK.js";import{E as je}from"./combobox-parts-s-DJvMW4-CR5ZbuEq.js";var Me={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};Me.node;var Ne=Y(Me),Pe={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Pe.node;var Fe=Y(Pe),Ie={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Ie.node;var Le=Y(Ie),Re={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Re.node;var ze=Y(Re),Be={name:`funnel`,size:24,node:[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]],aliases:[`filter`]};Be.node;var Ve=Y(Be),He={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};He.node;var Ue=Y(He),We={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};We.node;var Ge=Y(We),Ke={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};Ke.node;var qe=Y(Ke),Je={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Je.node;var Ye=Y(Je),Xe={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Xe.node;var Ze=Y(Xe),Qe={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Qe.node;var $e=Y(Qe),Z=e(I(),1),Q=P();function et({when:e,options:t,everything:n}){let r=ue(e,t);return!e||!r?(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,children:n}):(0,Q.jsx)(`span`,{className:`flex flex-wrap items-center gap-1`,children:r.parts.map((t,n)=>{let i=e.conditions[n],a=i&&`conditions`in i?i:void 0;return(0,Q.jsxs)(`span`,{className:`contents`,children:[n>0&&(0,Q.jsx)(L,{as:`span`,variant:`meta`,tone:`muted`,children:r.join}),a?(0,Q.jsxs)(`span`,{className:`border-border inline-flex max-w-full items-center gap-1 rounded-md border border-dashed px-1 py-0.5`,children:[(0,Q.jsx)(L,{as:`span`,variant:`meta`,tone:`muted`,children:a.operator===`OR`?`any of`:`all of`}),(0,Q.jsx)(tt,{children:t.replace(/^\((.*)\)$/,`$1`)})]}):(0,Q.jsx)(tt,{children:t})]},n)})})}function tt({children:e}){return(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`bg-fill max-w-full truncate rounded-sm px-1.5 py-0.5`,children:e})}function nt({boards:e,ownBoard:t,boardKey:n,phaseKey:r}){let a=e.find(e=>e.id===n);if(!a)return(0,Q.jsxs)(L,{as:`span`,variant:`caption`,tone:`muted`,children:[n,` (not installed)`]});let o=r??a.initialPhase,s=a.phases.find(e=>e.id===o);return(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[a.id!==t&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(L,{as:`span`,variant:`caption`,className:`truncate`,children:i(a)}),(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,children:`›`})]}),s&&(0,Q.jsx)(we,{stage:s.id,kind:Ce(a.id,s.kind),decorative:!0}),(0,Q.jsx)(L,{as:`span`,variant:`caption`,className:`truncate`,children:u(a,o)??o})]})}function rt({factoryId:e,rules:t,board:n,boards:a}){return(0,Q.jsxs)(`section`,{"aria-label":`From other boards`,className:`border-border mt-3 flex flex-col gap-1.5 border-t pt-3`,children:[(0,Q.jsxs)(L,{as:`h4`,variant:`meta`,tone:`muted`,className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(qe,{className:`size-icon-xs shrink-0`,"aria-hidden":!0}),`From other boards`]}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:t.map(t=>{let o=a.find(e=>e.id===t.target.boardKey);return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(m,{to:k(e,t.target.boardKey),"aria-label":`${t.name}, on ${o?i(o):t.target.boardKey}`,className:F(`group flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3`,!t.enabled&&`opacity-50`),children:[(0,Q.jsxs)(`span`,{className:`border-border group-hover:border-border-hover flex w-full min-w-0 flex-col gap-1 rounded-lg border border-dashed px-3 py-2 sm:flex-1`,children:[(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`ink`,className:`truncate font-medium`,children:o?i(o):`${t.target.boardKey} (not installed)`}),(0,Q.jsx)(et,{when:t.when,options:r(o),everything:`Every card`})]}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 shrink-0 items-center`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`border-border-strong h-0 w-8 shrink-0 border-t border-dashed`}),(0,Q.jsx)(Ne,{"aria-hidden":!0,className:`text-muted-foreground size-icon-sm mr-2 -ml-1.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`flex w-44 shrink-0 items-center px-3 py-2`,children:(0,Q.jsx)(nt,{boards:a,ownBoard:n.id,boardKey:n.id,phaseKey:t.target.phaseKey})})]}),!t.enabled&&(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,children:`Off`})]})},t.id)})})]})}function it({factoryId:e,boardKey:t,order:n,evaluator:r}){let i=n.some(e=>e.boardKey===t);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[r===`route-list`?(0,Q.jsx)(L,{as:`p`,variant:`caption`,tone:`muted`,children:`Intake still files new issues and pull requests by the old route list, not by board.`}):i?(0,Q.jsxs)(`ol`,{"aria-label":`Intake order`,className:`flex flex-wrap items-center gap-1`,children:[n.map(n=>(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(`li`,{children:n.boardKey===t?(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`ink`,"aria-current":`step`,className:`bg-surface3 rounded-md px-2 py-0.5 font-medium`,children:n.name}):(0,Q.jsx)(m,{to:k(e,n.boardKey),className:`text-muted-foreground hover:text-foreground rounded-md px-2 py-0.5`,children:(0,Q.jsx)(L,{as:`span`,variant:`caption`,children:n.name})})}),(0,Q.jsx)(Le,{"aria-hidden":!0,className:`text-muted-foreground size-icon-xs shrink-0`})]},n.boardKey)),(0,Q.jsx)(`li`,{children:(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`px-2 py-0.5`,children:`Not routed`})})]}):(0,Q.jsx)(L,{as:`p`,variant:`caption`,tone:`muted`,children:`Not in the intake order: new issues and pull requests never reach these rules.`}),(0,Q.jsxs)(m,{to:O(e,t,A),className:`text-muted-foreground hover:text-foreground flex items-center gap-1.5`,children:[(0,Q.jsx)(Ge,{className:`size-icon-xs shrink-0`,"aria-hidden":!0}),(0,Q.jsx)(L,{as:`span`,variant:`caption`,className:`underline decoration-dotted underline-offset-2`,children:`Reorder`})]})]})}var at=`flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors`,ot=`border-border-focus bg-fill-hover`,st=`border-border bg-fill-subtle hover:border-border-hover hover:bg-fill-hover`;function ct({selected:e,disabled:t,onClick:n,children:r}){return(0,Q.jsx)(`button`,{type:`button`,role:`checkbox`,"aria-checked":e,disabled:t,onClick:n,className:F(at,`disabled:opacity-50`,e?ot:st),children:r})}function lt({value:e,selected:t,disabled:n,onClick:r,children:i}){let a=(0,Z.useId)();return(0,Q.jsxs)(`label`,{onClick:r,className:F(at,`has-[[role=radio]:focus-visible]:outline-border-focus has-[[role=radio]:focus-visible]:outline-1 has-[[role=radio]:focus-visible]:outline-solid`,t?ot:st,n?`cursor-not-allowed opacity-50`:`cursor-pointer`),children:[(0,Q.jsx)(Ee,{value:e,disabled:n,"aria-labelledby":a,className:`sr-only`}),(0,Q.jsx)(`span`,{id:a,className:`flex min-w-0 items-start gap-3`,children:i})]})}function ut(){return(0,Q.jsx)(Ae,{size:`xs`,variant:`neutral`,emphasis:`subtle`,icon:(0,Q.jsx)(S,{"aria-hidden":`true`}),children:`GitHub only`})}var dt=120,ft=W(le),$=[{id:`trigger`,title:`Trigger`,question:`What should this rule listen for?`},{id:`conditions`,title:`Only if`,question:`Which items should it apply to?`},{id:`action`,title:`Move to`,question:`Where should it go?`},{id:`review`,title:`Review`,question:`Name and check your rule`}];function pt(e,t){let n=e?.phases??[];return t?n.filter(e=>e.kind!==`terminal`):n}function mt(e,t){if(t){let e=ft.safeParse(t);if(!e.success)return e.error.issues[0]?.message}return se(e,t)??void 0}function ht(e,t,n){let r=`When ${e.map(e=>J(e).label.toLowerCase()).join(` or `)}${t?`, ${Se(t).charAt(0).toLowerCase()}${Se(t).slice(1)}`:``}, move to ${n}`;return r.length>dt?`${r.slice(0,119)}…`:r}function gt({factoryId:e,board:t,boards:n,initial:a,initialEvent:o,initialStep:s,readOnly:c,saving:l,error:d,onSave:f,onClose:p}){let m=Oe(e),[_,S]=(0,Z.useState)(()=>a?.on??(o?[o]:[])),[w,T]=(0,Z.useState)(()=>a?.when??null),[E,D]=(0,Z.useState)(()=>(a?.when?.conditions.length??0)>0),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)(()=>a?.target.moveToBoardKey??t.id),[M,N]=(0,Z.useState)(()=>a?a.target.phaseKey??void 0:void 0),[te,P]=(0,Z.useState)(()=>a?.name),[I,R]=(0,Z.useState)(s),[ne,re]=(0,Z.useState)(0),z=ve(_),B=n.find(e=>e.id===A),ie=pt(B,z),V=ie.find(e=>e.id===(M??B?.initialPhase)),H=E?w:null,U=_.length?mt(_,H):void 0,ae=V&&B?`${i(B)} › ${u(B,V.id)}`:``,se=te??(V?ht(_,H,ae):``),W={trigger:_.length>0,conditions:_.length>0&&!(E&&O)&&!U,action:V!==void 0,review:se.trim().length>0},ce=!c&&W.trigger&&W.conditions&&W.action&&W.review,G=$.findIndex(e=>e.id===I),le=$[G]??$[0],ue=e=>{S(e),ve(e)&&A!==t.id&&(j(t.id),N(void 0))},fe=()=>{ce&&V&&f({name:se.trim(),on:_,when:H,target:{phaseKey:V.id,moveToBoardKey:A===t.id?null:A}})},pe=()=>{let e={field:`pullRequest.trusted`,operator:`equals`,value:!0};T(H===null?{operator:`AND`,conditions:[e]}:H.operator===`AND`?{...H,conditions:[...H.conditions,e]}:{operator:`AND`,conditions:[H,e]}),D(!0),k(!1),re(e=>e+1)},K={trigger:_.length?_.map(e=>J(e).label).join(`, `):void 0,conditions:_.length?Se(H,r(t)):void 0,action:V?(0,Q.jsx)(nt,{boards:n,ownBoard:t.id,boardKey:A,phaseKey:V.id}):void 0,review:void 0};return(0,Q.jsx)(g,{open:!0,onOpenChange:e=>!e&&p(),children:(0,Q.jsxs)(ee,{size:`xl`,children:[(0,Q.jsx)(h,{children:(0,Q.jsx)(v,{children:c?`Rule`:a?`Edit rule`:`Add rule`})}),(0,Q.jsx)(C,{children:(0,Q.jsxs)(`div`,{className:`grid min-h-105 grid-cols-1 gap-6 sm:grid-cols-[12rem_1fr]`,children:[(0,Q.jsx)(`nav`,{"aria-label":`Rule steps`,className:`sm:border-border flex gap-1 overflow-x-auto sm:flex-col sm:border-r sm:pr-4`,children:$.map((e,t)=>{let n=t===0||$.slice(0,t).every(e=>W[e.id]),r=W[e.id]&&e.id!==`review`;return(0,Q.jsxs)(`button`,{type:`button`,disabled:!n,"aria-current":I===e.id?`step`:void 0,onClick:()=>R(e.id),className:F(`flex shrink-0 items-start gap-2.5 rounded-lg px-2 py-2 text-left transition-colors disabled:opacity-40`,I===e.id?`bg-fill-hover`:`hover:bg-fill-subtle`),children:[(0,Q.jsx)(L,{as:`span`,variant:`meta`,className:F(`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full border`,r?`border-transparent bg-fill-inverse text-background`:`border-border-strong`),children:r?(0,Q.jsx)(Fe,{className:`size-icon-xs`,"aria-hidden":!0}):t+1}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(L,{as:`span`,variant:`label`,tone:`ink`,className:`block`,children:e.title}),K[e.id]&&(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`hidden truncate sm:block`,children:K[e.id]})]})]},e.id)})}),(0,Q.jsxs)(`section`,{"aria-label":le.title,className:`flex min-w-0 flex-col gap-4`,children:[(0,Q.jsx)(L,{as:`h3`,variant:`heading`,children:le.question}),I===`trigger`&&(0,Q.jsx)(yt,{value:_,disabled:c,onChange:ue}),I===`conditions`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsxs)(De,{"aria-label":`Which ones`,value:E?`matching`:`every`,disabled:c,onValueChange:e=>{D(e===`matching`),k(!1)},className:`grid-cols-1 sm:grid-cols-2`,children:[(0,Q.jsx)(lt,{value:`every`,selected:!E,disabled:c,children:(0,Q.jsx)(_t,{title:z?`Every new one`:`Every card`,hint:`Run whenever this happens.`})}),(0,Q.jsx)(lt,{value:`matching`,selected:E,disabled:c,children:(0,Q.jsx)(_t,{title:`Only ones that match`,hint:`Narrow it down by repository, label, author and more.`})})]}),E&&(0,Q.jsx)(`div`,{className:`border-border bg-fill-subtle rounded-xl border p-3`,children:(0,Q.jsx)(ke,{label:`Conditions`,rule:w,facts:de(_),options:{...r(t),"source.repository":m},onChange:(e,t)=>{T(e),k(t)}},ne)}),U&&(0,Q.jsx)(b,{variant:`warning`,children:U}),!a?.outsiderPullRequestsGated&&oe(_,H)&&(0,Q.jsx)(b,{variant:`info`,children:(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,Q.jsx)(`span`,{children:`Also matches pull requests from outside authors.`}),!c&&(0,Q.jsx)(`button`,{type:`button`,onClick:pe,className:`shrink-0 underline`,children:`Add: Pull request trusted is yes`})]})})]}),I===`action`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[z?(0,Q.jsx)(L,{as:`p`,variant:`caption`,tone:`muted`,children:`An item with no card yet can only be filed on this board.`}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(L,{as:`span`,variant:`eyebrow`,tone:`muted`,children:`Board`}),(0,Q.jsx)(De,{"aria-label":`Board`,value:A,disabled:c,onValueChange:e=>{typeof e==`string`&&e!==A&&(j(e),N(void 0))},className:`grid-cols-1 sm:grid-cols-3`,children:n.map(e=>(0,Q.jsx)(lt,{value:e.id,selected:e.id===A,disabled:c,children:(0,Q.jsxs)(L,{as:`span`,variant:`label`,tone:`ink`,children:[i(e),e.id===t.id?` (this board)`:``]})},e.id))})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(L,{as:`span`,variant:`eyebrow`,tone:`muted`,children:`Phase`}),(0,Q.jsx)(De,{"aria-label":`Phase`,value:V?.id??null,disabled:c,onValueChange:e=>typeof e==`string`&&N(e),className:`grid-cols-1 sm:grid-cols-2`,children:B&&ie.map(e=>(0,Q.jsx)(lt,{value:e.id,selected:e.id===V?.id,disabled:c,onClick:()=>{N(e.id),R(`review`)},children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(we,{stage:e.id,kind:Ce(B.id,e.kind),decorative:!0}),(0,Q.jsx)(L,{as:`span`,variant:`label`,tone:`ink`,children:u(B,e.id)})]})},e.id))})]})]}),I===`review`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(L,{as:`span`,variant:`label`,tone:`muted`,children:`Name`}),(0,Q.jsx)(Te,{value:se,maxLength:dt,disabled:c,onChange:e=>P(e.target.value)})]}),(0,Q.jsxs)(`div`,{className:`border-border bg-fill-subtle rounded-xl border p-4`,children:[(0,Q.jsx)(L,{as:`span`,variant:`eyebrow`,tone:`muted`,className:`mb-3 block`,children:`This rule reads as`}),(0,Q.jsxs)(`ol`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(vt,{label:`When`,children:K.trigger}),(0,Q.jsx)(vt,{label:`Only if`,children:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(Ve,{className:`text-muted-foreground size-icon-sm`,"aria-hidden":!0}),K.conditions]})}),(0,Q.jsx)(vt,{label:`Then`,children:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Move to `,(0,Q.jsx)(Ne,{className:`size-icon-sm`,"aria-hidden":!0}),` `,K.action]})})]})]})]}),d&&(0,Q.jsx)(b,{variant:`destructive`,role:`alert`,children:d})]})]})}),(0,Q.jsxs)(y,{children:[(0,Q.jsx)(x,{variant:`ghost`,onClick:p,children:c?`Close`:`Cancel`}),(0,Q.jsx)(`div`,{className:`flex-1`}),G>0&&(0,Q.jsx)(x,{variant:`default`,onClick:()=>R($[G-1].id),children:`Back`}),!c&&(I===`review`||a&&ce?(0,Q.jsx)(x,{variant:`primary`,disabled:!ce||l,onClick:fe,children:l?`Saving…`:a?`Save rule`:`Create rule`}):(0,Q.jsx)(x,{variant:`primary`,disabled:!W[I],onClick:()=>R($[G+1]?.id??`review`),children:`Continue`}))]})]})})}function _t({title:e,hint:t}){return(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(L,{as:`span`,variant:`label`,tone:`ink`,className:`block`,children:e}),(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`block`,children:t})]})}function vt({label:e,children:t}){return(0,Q.jsxs)(`li`,{className:`grid grid-cols-[4.5rem_1fr] items-start gap-3`,children:[(0,Q.jsx)(L,{as:`span`,variant:`body-sm`,tone:`muted`,children:e}),(0,Q.jsx)(L,{as:`span`,variant:`body-sm`,children:t})]})}function yt({value:e,disabled:t,onChange:n}){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.includes(`work_item.created`)&&(0,Q.jsxs)(b,{variant:`info`,children:[`Also listens on “`,J(`work_item.created`).label,`”, which takes new issues and pull requests. Saving keeps it.`]}),ye.map(r=>(0,Q.jsxs)(`div`,{role:`group`,"aria-label":r.title,className:`flex flex-col gap-2`,children:[(0,Q.jsx)(L,{as:`span`,variant:`eyebrow`,tone:`muted`,children:r.title}),(0,Q.jsx)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`,children:r.events.map(r=>{let i=J(r),a=i.icon,o=e.includes(r);return(0,Q.jsxs)(ct,{selected:o,disabled:t||o&&e.length===1,onClick:()=>n(o?e.filter(e=>e!==r):[...e,r]),children:[(0,Q.jsx)(a,{className:`text-badge-amber-indicator mt-0.5 size-4 shrink-0`,"aria-hidden":!0}),(0,Q.jsx)(_t,{title:i.label,hint:i.description}),i.githubOnly&&(0,Q.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,Q.jsx)(ut,{})})]},r)})})]},r.title))]})}function bt({count:e,into:t,leaving:n,showAll:r}){let i=n?`sending cards to ${t}`:`moving cards into ${t}`;return(0,Q.jsxs)(`div`,{className:`border-border flex items-center gap-2 rounded-lg border px-3 py-2`,children:[(0,Q.jsx)(Ue,{className:`size-icon-md text-muted-foreground shrink-0`,"aria-hidden":!0}),(0,Q.jsx)(L,{as:`p`,variant:`body-sm`,tone:e===void 0?`muted`:`ink`,className:`flex-1`,children:e===void 0?`Couldn’t pick out the rules ${i}, so every rule is shown.`:e===0?`No rule is ${i}.`:`Only the ${e===1?`rule`:`${e} rules`} ${i}.`}),(0,Q.jsx)(x,{size:`sm`,variant:`ghost`,render:(0,Q.jsx)(m,{to:r}),children:`Show all`})]})}var xt=F(`relative before:pointer-events-none before:absolute before:right-0 before:left-0 before:z-20 before:hidden before:h-0.5 before:rounded-full before:bg-border-focus`,`data-[drop=before]:before:-top-1 data-[drop=before]:before:block data-[drop=after]:before:-bottom-1 data-[drop=after]:before:block`);function St({event:e,rules:t,board:n,boards:r,phaseOptions:a,canEdit:o,skips:s,footer:c,incoming:l,only:d,onEdit:f,onAdd:p,onMove:m,onToggle:h,onDelete:ee,onUngate:g}){let _=J(e),v=_.icon,y=pe(t,e),b=K(e),S=be(e),C=H({min:0,max:t.length-1,onDrop:m}),w=o&&t.length>1&&!d,T=c??(t.length?`Otherwise, the card stays where it is`:l?`No rules: this board’s cards stay where they are`:`No rules: the card stays where it is`);return(0,Q.jsxs)(`section`,{"aria-label":_.label,className:F(`flex flex-col gap-3 rounded-xl border border-border bg-card p-4`,!t.length&&!l&&`opacity-60 focus-within:opacity-100 hover:opacity-100`),children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(v,{className:`text-badge-amber-indicator size-3.5 shrink-0`,"aria-hidden":!0}),(0,Q.jsx)(L,{as:`h3`,variant:`label`,tone:`ink`,children:_.label}),_.githubOnly&&(0,Q.jsx)(ut,{})]}),_.description&&(0,Q.jsx)(L,{as:`p`,variant:`caption`,tone:`muted`,children:_.description})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsxs)(`ol`,{"aria-label":`${_.label} rules`,className:`flex min-w-0 flex-col`,children:[t.map((c,l)=>{if(d&&!d.has(c.id))return null;let p=ge(t,e,l),v=p>=0,T=!c.enabled||v,E=C.drag?.from===l,D=s?.get(c.id),O=r.find(e=>e.id===(c.target.moveToBoardKey??c.target.boardKey)),k=!he(c.name,[_.label,Se(c.when,a),O&&i(O),u(O,c.target.phaseKey)].join(` `));return(0,Q.jsxs)(`li`,{"aria-label":c.name,"data-drop":C.dropAt(l),style:E?{transform:`translateY(${C.drag?.offset??0}px)`}:void 0,onPointerDown:w?e=>C.onPointerDown(e,l):void 0,className:F(`group/rule flex flex-col`,xt,E&&`z-10 opacity-90`),children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3`,children:[(0,Q.jsxs)(`div`,{className:`relative min-w-0 sm:flex-1`,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-label":`Edit conditions of ${c.name}`,onClick:()=>f(c,`conditions`),onKeyDown:w?e=>C.onKeyDown(e,l):void 0,className:F(`flex w-full items-start gap-2.5 rounded-lg border bg-fill-subtle px-3 py-2 text-left transition-colors hover:border-border-hover`,T?`border-dashed border-border opacity-50`:`border-border`),children:[(0,Q.jsxs)(L,{as:`span`,variant:`meta`,tone:`muted`,className:`bg-fill mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full tabular-nums`,children:[(0,Q.jsx)(`span`,{className:F(w&&`pointer-fine:group-hover/rule:hidden`,E&&`hidden`),children:l+1}),w&&(0,Q.jsx)(`span`,{"data-grip":!0,"aria-hidden":!0,className:F(`hidden cursor-grab touch-none pointer-fine:group-hover/rule:flex`,E&&`flex`),children:(0,Q.jsx)(ne,{className:`size-icon-sm`})})]}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[k&&(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`ink`,className:`truncate font-medium`,children:c.name}),(0,Q.jsx)(et,{when:c.when,options:a,everything:S})]})]}),w&&(0,Q.jsxs)(`div`,{className:`border-border bg-card absolute top-0 right-2 flex -translate-y-1/2 rounded-md border shadow-sm transition-opacity pointer-fine:opacity-0 pointer-fine:group-focus-within/rule:opacity-100 pointer-fine:group-hover/rule:opacity-100`,children:[(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,tooltip:`Check earlier`,disabled:l===0,onClick:()=>m(l,l-1),children:(0,Q.jsx)(U,{})}),(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,tooltip:`Check later`,disabled:l===t.length-1,onClick:()=>m(l,l+1),children:(0,Q.jsx)(re,{})})]})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 sm:shrink-0`,children:[(0,Q.jsxs)(`div`,{className:F(`flex min-w-0 items-center`,T&&`opacity-40`),children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:F(`h-px w-8 shrink-0`,T?`border-t border-dashed border-border-strong`:`bg-muted-foreground`)}),(0,Q.jsx)(Ne,{"aria-hidden":!0,className:`text-muted-foreground size-icon-sm mr-2 -ml-1.5 shrink-0`}),(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Edit where ${c.name} moves the card`,onClick:()=>f(c,`action`),className:`border-border bg-fill-subtle hover:border-border-hover flex w-44 shrink-0 rounded-lg border px-3 py-2 text-left`,children:(0,Q.jsx)(nt,{boards:r,ownBoard:n.id,boardKey:c.target.moveToBoardKey??c.target.boardKey,phaseKey:c.target.phaseKey})})]}),o&&(0,Q.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,Q.jsx)(je,{"aria-label":`${c.name} on`,checked:c.enabled,onCheckedChange:e=>h(c,e)}),(0,Q.jsxs)(X,{children:[(0,Q.jsx)(X.Trigger,{render:(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,tooltip:`More for ${c.name}`,children:(0,Q.jsx)(ze,{})})}),(0,Q.jsx)(X.Content,{align:`end`,children:(0,Q.jsxs)(X.Item,{variant:`destructive`,onClick:()=>ee(c),children:[(0,Q.jsx)(Ze,{}),`Delete rule`]})})]})]})]})]}),T&&(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3 flex items-center gap-1.5`,children:v?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($e,{className:`text-warning-indicator size-icon-xs`,"aria-hidden":!0}),`Never reached: rule `,p+1,` above matches `,S.toLowerCase(),`.`]}):`Off, skipped`}),c.problems.map(e=>(0,Q.jsxs)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3 flex items-center gap-1.5`,children:[(0,Q.jsx)($e,{className:`text-warning-indicator size-icon-xs shrink-0`,"aria-hidden":!0}),e]},e)),D&&(0,Q.jsx)(wt,{skips:D}),fe(c,e)&&(0,Q.jsxs)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3 flex flex-wrap items-center gap-x-1.5 gap-y-1`,children:[`Skips outside authors’ pull requests (older rule).`,o&&(0,Q.jsx)(`button`,{type:`button`,onClick:()=>g(c),className:`underline`,children:`Let outside authors match`})]}),me(c,e)&&(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3`,children:`Moves cards only: files no new pull requests`}),b&&xe(c)&&(0,Q.jsx)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3`,children:J(`work_item.created`).label}),l!==y&&!d&&(0,Q.jsxs)(`div`,{"aria-hidden":!0,className:`flex h-7 items-center pl-5.5`,children:[(0,Q.jsx)(`span`,{className:`bg-border-strong h-full w-px`}),(0,Q.jsx)(L,{as:`span`,variant:`meta`,tone:`muted`,className:`ml-2`,children:`no`})]})]},c.id)}),!d&&(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3`,children:[y<0&&(0,Q.jsxs)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`flex flex-1 items-center gap-2.5 px-3 py-1.5`,children:[(0,Q.jsx)(z,{className:`size-icon-md shrink-0`,"aria-hidden":!0}),T]}),o&&(0,Q.jsx)(x,{variant:`ghost`,size:`sm`,icon:(0,Q.jsx)(Ye,{}),onClick:p,children:`Add rule`})]})]}),l]})]})}function Ct(e){return e?.match(/was skipped: (.+?)\.?$/)?.[1]??e??`its target couldn’t take the card`}function wt({skips:e}){let{count:t,latest:n}=e;return(0,Q.jsxs)(L,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3 flex flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,Q.jsx)($e,{className:`text-warning-indicator size-icon-xs shrink-0`,"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[`Skipped `,t===1?`once`:`${t} times`,` in the last 30 days: `,Ct(n.reason),`.`]}),n.url?(0,Q.jsxs)(`a`,{href:n.url,target:`_blank`,rel:`noreferrer`,className:`underline`,children:[`Latest: `,n.title]}):(0,Q.jsxs)(`span`,{children:[`Latest: `,n.title]})]})}var Tt=new Set([`revision_mismatch`,`intake_route_set_mismatch`,`intake_route_not_found`]);function Et(e){return e instanceof T&&e.code!==void 0&&Tt.has(e.code)}function Dt(e){return Et(e)?`Someone else changed these rules first. They have been reloaded; try again.`:e instanceof Error?e.message:`The change didn’t save.`}function Ot({factoryId:e,boardId:t}){let n=R(e),r=n.data?.find(e=>e.id===t);return n.isPending?(0,Q.jsx)(j,{className:`h-64 w-full`}):n.isError?(0,Q.jsx)(b,{variant:`destructive`,children:`Boards didn’t load.`}):r?(0,Q.jsx)(kt,{factoryId:e,board:r,boards:n.data},`${e}:${r.id}`):(0,Q.jsx)(b,{variant:`warning`,children:`This board isn’t installed.`})}function kt({factoryId:e,board:n,boards:i}){let a=G(e,n.id),o=ce(e),s=ie(e),l=V(e),d=ae(e),[f,p]=(0,Z.useState)(),m=(0,Z.useRef)(void 0),h=e=>{m.current=e,p(e)},[ee,g]=(0,Z.useState)(),v=a.data?.intakeRoutes??[],y=a.data?.canEdit??!1,x=r(n),S=(o.data?.intakeRoutes??[]).filter(e=>e.target.moveToBoardKey===n.id&&e.target.boardKey!==n.id),C=new Map(l.data?.skipped.map(e=>[e.routeId,e])),[w]=_(),T=w.get(`into`)??void 0,E=w.has(D),O=E||T!==void 0,A=O&&o.data?t(o.data.intakeRoutes,{key:n.id,initialPhase:n.initialPhase}):void 0,P=A&&new Set((E?A.leaving:A.into.get(T??``)??[]).map(e=>e.id)),F=e=>!P||e.some(e=>P.has(e.id));if(a.isPending||O&&o.isPending)return(0,Q.jsx)(j,{className:`h-64 w-full`});if(a.isError)return(0,Q.jsx)(b,{variant:`destructive`,children:`This board’s rules didn’t load.`});let I=e=>d.mutateAsync(e).catch(e=>M.error(Dt(e))),L=(e,t,r)=>{let i=q(v,e).map(e=>e.id);I([{kind:`reorder`,boardKey:n.id,ids:c(v,i,t,r)}])},R=e=>{g(void 0),h(e)},ne=async e=>{let t=m.current,r=t?.rule,i=()=>t!==void 0&&m.current===t;g(void 0);try{if(r)await d.mutateAsync([{kind:`update`,id:r.id,patch:{name:e.name,on:e.on,when:e.when,target:{boardKey:r.target.boardKey,...e.target,joinClosedIssue:r.target.joinClosedIssue},expectedRevision:r.revision}}]);else{let[t]=await d.mutateAsync([{kind:`create`,route:{...e,target:{boardKey:n.id,...e.target}}}]);i()&&h(void 0),t&&await z(t,e.on).catch(e=>M.error(Dt(e)));return}i()&&h(void 0)}catch(e){if(!i())return;if(r&&Et(e))return re(r);g(Dt(e))}},re=async e=>{let t=m.current,n=(await a.refetch()).data?.intakeRoutes.find(t=>t.id===e.id);t&&m.current===t&&(n?(h({...t,rule:n}),g(`Someone else changed this rule first. It now shows their version; make your change again.`)):(h(void 0),M.error(`Someone else deleted this rule first.`)))},z=async(e,t)=>{if(e.target.boardKey!==n.id)return;let r=(await a.refetch()).data?.intakeRoutes??[],i=r.map(e=>e.id),o=i.indexOf(e.id),s=t.flatMap(t=>{let n=q(r,t),a=n[ge(n,t,n.findIndex(t=>t.id===e.id))];return a?[i.indexOf(a.id)]:[]}),l=Math.min(...s);o<0||!(l<o)||await d.mutateAsync([{kind:`reorder`,boardKey:n.id,ids:c(r,i,o,l)}])},B=s.data?.evaluator===`route-list`?`Otherwise: the old route list decides`:_e(s.data?.boards,n.id);return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[o.isError&&(0,Q.jsx)(b,{variant:`warning`,children:`Rules on other boards that move cards here didn’t load, so they aren’t shown.`}),O&&(0,Q.jsx)(bt,{count:P?.size,into:E||!T?`other boards`:u(n,T)??T,leaving:E,showAll:k(e,n.id)}),ye.filter(e=>e.events.some(e=>F([...q(v,e),...q(S,e)]))).map(t=>(0,Q.jsxs)(`section`,{"aria-label":t.title,className:`flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(N,{children:t.title}),t.events.some(K)?s.data&&(0,Q.jsx)(it,{factoryId:e,boardKey:n.id,order:s.data.boards,evaluator:s.data.evaluator}):(0,Q.jsx)(te,{children:`Only cards already on this board; other boards never see them.`})]}),t.events.map(t=>{let r=K(t),a=q(v,t),o=q(S,t).filter(e=>!P||P.has(e.id));return F([...a,...o])?(0,Q.jsx)(St,{event:t,rules:a,board:n,boards:i,phaseOptions:x,canEdit:y,skips:C,footer:r?B:void 0,only:P,incoming:o.length?(0,Q.jsx)(rt,{factoryId:e,rules:o,board:n,boards:i}):void 0,onEdit:(e,t)=>R({rule:e,step:t}),onAdd:()=>R({event:t,step:`conditions`}),onMove:(e,n)=>L(t,e,n),onToggle:(e,t)=>void I([{kind:`update`,id:e.id,patch:{enabled:t,expectedRevision:e.revision}}]),onDelete:e=>void I([{kind:`delete`,id:e.id,expectedRevision:e.revision}]).then(t=>t&&M.success(`Deleted “${e.name}”`)),onUngate:e=>void I([{kind:`update`,id:e.id,patch:{outsiderPullRequestsGated:!1,expectedRevision:e.revision}}]).then(t=>t&&M.success(`“${e.name}” now matches outside authors’ pull requests`))},t):null})]},t.title)),f&&(0,Q.jsx)(gt,{factoryId:e,board:n,boards:i,initial:f.rule,initialEvent:f.event,initialStep:f.step,readOnly:!y,saving:d.isPending,error:ee,onSave:e=>void ne(e),onClose:()=>h(void 0)},f.rule?`${f.rule.id}:${f.rule.revision}`:`new-${f.event}`)]})}function At(){let e=s(),t=l()?.boardId??``,{isMobile:r,desktopState:i}=p(),c=r||i===`collapsed`,u=w(e.id,t).data?.board,h=a({breadcrumbs:c&&u?(0,Q.jsxs)(f,{label:`Breadcrumb`,className:`min-w-0 flex-1 overflow-hidden`,children:[(0,Q.jsx)(d,{as:m,to:E(e.id,t),children:u.name}),(0,Q.jsx)(d,{as:`span`,isCurrent:!0,children:`Rules`})]}):void 0});return(0,Q.jsx)(o,{variant:`settings`,header:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(n,{children:[(0,Q.jsx)(n.Title,{children:`Rules`}),(0,Q.jsx)(n.Description,{children:`What happens to issues and pull requests on this board. In each lane the first matching rule wins.`})]}),(0,Q.jsx)(`div`,{className:`mt-3`,children:(0,Q.jsx)(B,{factoryProjectId:e.id,label:`Test an issue or pull request`})})]}),...h,children:(0,Q.jsx)(Ot,{factoryId:e.id,boardId:t})})}export{At as BoardRulesPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ei as t,Jt as n,Mi as r,qt as i}from"./GithubIcon.es-B1lB1Q-8.js";import{O as a,T as o,k as s,o as c}from"./IconChevronRightMedium.es-BjSIsine.js";import{r as l}from"./CompositeItem-CD2x3KaL.js";import{t as u}from"./popup-anchor.es-B4jCSTe8.js";var d=e(s(),1),f=a(),p=e=>(0,f.jsx)(`svg`,{width:`19.125`,height:`18`,viewBox:`-1.0625 -1 19.125 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,f.jsx)(`path`,{d:`M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z`,fill:`currentColor`})}),m=({children:e,label:t,className:n,listClassName:r})=>(0,f.jsx)(`nav`,{"aria-label":t,className:n,children:(0,f.jsx)(`ol`,{className:o(`flex items-center gap-0.5`,r),children:e})}),h=e=>(0,f.jsx)(l,{className:`h-3 w-24`,...e}),g=({className:e,as:a,to:s,href:l,isCurrent:m,action:g,switcher:_,icon:v,isLoading:y,children:b,...x})=>{let S=a||`span`,C=!(!_||!m&&(s||l)),w=d.useRef(null);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`li`,{ref:w,className:o(`group flex h-control-sm min-w-0 items-center`,m?`shrink`:`shrink-0`,C&&`relative rounded-full has-[[data-slot=crumb-switcher]_[data-popup-open]]:bg-fill-subtle has-[[data-slot=crumb-switcher]_button:enabled]:hover:bg-fill-subtle has-[[data-slot=crumb-switcher]_button:enabled]:active:bg-fill`),children:[(0,f.jsxs)(S,{"aria-current":m?`page`:void 0,className:o(`inline-flex min-w-0 items-center gap-2 overflow-hidden rounded-full px-[.9em]`,t.sm,c,m?`max-w-xs cursor-default text-foreground`:C?o(n,`max-w-48`):o(i,`max-w-48 cursor-pointer hover:bg-fill-subtle active:bg-fill`),e),to:s,href:l,...x,children:[v&&(0,f.jsx)(r,{className:o(`ml-[-.3em] shrink-0 opacity-50 group-hover:opacity-100`,`transition-opacity duration-normal ease-out-custom`),children:v}),y?(0,f.jsx)(h,{}):(0,f.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:b})]}),_&&(0,f.jsx)(`span`,{"data-slot":`crumb-switcher`,className:o(`-ml-1 flex h-control-sm shrink-0 items-center`,C&&`[&_button]:bg-transparent! [&_button:enabled]:after:absolute [&_button:enabled]:after:inset-0 [&_button:enabled]:after:rounded-full`),children:(0,f.jsx)(u,{value:w,children:_})}),g&&(0,f.jsx)(`span`,{className:`-ml-1 flex h-control-sm shrink-0 items-center`,children:g})]}),!m&&(0,f.jsx)(`li`,{role:`separator`,className:`flex h-full items-center`,children:(0,f.jsx)(r,{className:`text-placeholder`,children:(0,f.jsx)(p,{})})})]})};export{g as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Fs as t,Is as n,Rs as r,Si as i}from"./GithubIcon.es-B1lB1Q-8.js";import{O as a,T as o,c as s,k as c}from"./IconChevronRightMedium.es-BjSIsine.js";var l=e(c(),1),u=a(),d=o(`motion-safe:not-disabled:not-aria-disabled:hover:[&_[data-emphasis=grow-y]]:scale-y-125`,`motion-safe:not-disabled:not-aria-disabled:hover:[&_[data-emphasis=grow-x]]:scale-x-125`,`motion-safe:not-disabled:not-aria-disabled:hover:[&_[data-emphasis=pop]]:scale-110`,`motion-safe:not-disabled:not-aria-disabled:focus-visible:[&_[data-emphasis=grow-y]]:scale-y-125`,`motion-safe:not-disabled:not-aria-disabled:focus-visible:[&_[data-emphasis=grow-x]]:scale-x-125`,`motion-safe:not-disabled:not-aria-disabled:focus-visible:[&_[data-emphasis=pop]]:scale-110`),f=r(o(t,`rounded-xl transition-all duration-normal ease-out-custom motion-reduce:transition-none`),{variants:{elevation:{flat:`shadow-none`,raised:``},interactive:{true:o(n,i,d,`cursor-pointer active:scale-99 aria-[current=true]:[--surface-rim:var(--border-focus)]`),false:``}},compoundVariants:[{elevation:`flat`,interactive:!0,class:o(s,`aria-[current=true]:outline-1 aria-[current=true]:-outline-offset-1 aria-[current=true]:outline-border-focus aria-[current=true]:outline-solid`)}],defaultVariants:{elevation:`raised`,interactive:!1}}),p=l.forwardRef(({className:e,elevation:t,interactive:n,as:r,...i},a)=>{let s=r||(n?`button`:`div`);return(0,u.jsx)(s,{ref:a,type:s===`button`?`button`:void 0,className:o(f({elevation:t,interactive:n}),e),...i})});p.displayName=`Card`;function m({className:e,elevation:t,LinkComponent:n=`a`,...r}){return(0,u.jsx)(n,{className:o(f({elevation:t,interactive:!0}),e),...r})}var h=l.forwardRef(({className:e,...t},n)=>(0,u.jsx)(`div`,{ref:n,className:o(`flex flex-col space-y-1.5 px-3 py-1`,e),...t}));h.displayName=`CardHeader`;var g=l.forwardRef(({className:e,...t},n)=>(0,u.jsx)(`h3`,{ref:n,className:o(`text-subheading text-foreground`,e),...t}));g.displayName=`CardTitle`;var _=l.forwardRef(({className:e,...t},n)=>(0,u.jsx)(`p`,{ref:n,className:o(`text-caption text-muted-foreground`,e),...t}));_.displayName=`CardDescription`;var v=r(``,{variants:{density:{default:`p-3`,compact:`p-2`}},defaultVariants:{density:`default`}}),y=l.forwardRef(({className:e,density:t,...n},r)=>(0,u.jsx)(`div`,{ref:r,className:o(v({density:t}),e),...n}));y.displayName=`CardContent`;var b=l.forwardRef(({className:e,...t},n)=>(0,u.jsx)(`div`,{ref:n,className:o(`flex items-center p-3 pt-0`,e),...t}));b.displayName=`CardFooter`;var x=l.forwardRef(({className:e,as:t=`div`,...n},r)=>(0,u.jsx)(t,{ref:r,className:o(`divide-y divide-border overflow-hidden rounded-lg border border-border bg-sidebar *:p-3`,e),...n}));x.displayName=`CardInset`;export{y as n,m as r,p as t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-Sr6WSEaV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/dist-6WNNvkM4.js","assets/dist-B5wMYzWI.js","assets/dist-D1JI_ikE.js","assets/dist-DtnqB3m_.js","assets/dist-CMX7_OjZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{O as t,T as n,b as r,d as i,f as a,k as o,m as s,o as c,s as l,u,v as d}from"./IconChevronRightMedium.es-BjSIsine.js";import{Ds as f,Fi as p,Gt as m,Ii as h,Li as g,Lo as _,Oo as v,Os as y,Pi as b,Qa as x,Ra as S,Rs as C,Ti as w,Tn as T,Wi as E,ao as D,ci as O,cs as k,di as ee,ds as A,fs as j,is as M,ls as N,no as P,ns as te,oi as F,os as I,qn as L,qt as ne,ra as re}from"./GithubIcon.es-B1lB1Q-8.js";import{a as ie,i as R,n as z,r as B,t as ae}from"./select-Bdt18YBg-DJqvU5Dv.js";import{n as oe}from"./CompositeItem-CD2x3KaL.js";import{i as V,n as H,r as U,t as se}from"./TabsRoot-C1o0G1CK.js";import{n as ce,t as le}from"./CompositeRoot-C9XORM0H.js";import{t as ue}from"./copy-button-Brk8iwgE-DHsIfP0z.js";import{n as de}from"./index.module-D3qeux6j.js";import{a as W,i as fe,m as pe,n as me}from"./dist-6WNNvkM4.js";import{t as G}from"./preload-helper-BLdHbfdN.js";var K=e(o(),1),q=t(),he=re();function ge(e){let t=I(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=A(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(x(n)!==a||x(r)!==o)&&(n=a,r=o),{width:n,height:r}}var _e=K.createContext(void 0);function ve(){let e=K.useContext(_e);if(e===void 0)throw Error(f(65));return e}var ye=K.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:c=!0,style:l,...u}=e,{value:d,getTabPanelIdByValue:f,onValueChange:p,orientation:m,tabActivationDirection:h}=U(),{activateOnFocus:g,registerTabResizeObserverElement:b,tabsListElement:x}=ve(),{highlightedIndex:S,onHighlightedIndexChange:C}=ee(),w=E(o),T=K.useMemo(()=>({disabled:r,id:w,value:a}),[r,w,a]),{compositeProps:k,compositeRef:A,index:j}=oe({metadata:T}),N=a===d,F=K.useRef(!1),I=K.useRef(null),L=D(e=>{I.current?.(),I.current=e?b(e):null});y(()=>{if(F.current){F.current=!1;return}if(!(N&&j>-1&&S!==j))return;let e=x;if(e!=null){let t=te(P(e));if(t&&M(e,t))return}r||C(j)},[N,j,S,C,r,x]);let{getButtonProps:ne,buttonRef:re}=O({disabled:r,native:c,focusableWhenDisabled:!0}),ie=f(a),R=K.useRef(!1),z=K.useRef(!1);function B(e){p(a,_(v,e.nativeEvent,void 0,{activationDirection:`none`}))}function ae(e){N||r||B(e)}function V(e){N||r||g&&(!R.current||z.current)&&B(e)}function se(e){if(N||r)return;R.current=!0,z.current=e.button===0;let t=P(e.currentTarget);function n(){R.current=!1,z.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return s(`button`,e,{state:{disabled:r,active:N,orientation:m,tabActivationDirection:h},ref:[t,re,A,L],props:[k,{role:`tab`,"aria-controls":ie,"aria-selected":N,id:w,onClick:ae,onFocus:V,onPointerDown:se,[ce]:N?``:void 0,onKeyDownCapture(){F.current=!0}},u,ne],stateAttributesMapping:H})}),be=()=>()=>{},xe=()=>!0,Se=()=>!1;function Ce(){return(0,he.useSyncExternalStore)(be,xe,Se)}function we(){let[e,t]=K.useState(!1);return K.useEffect(()=>{t(!0)},[]),e}var Te=d(18)?Ce:we;function Ee(){return!Te()}function De(e){let{script:t}=e,{nonce:n}=m();return Ee()?(0,q.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var Oe=`--active-tab-left`,ke=`--active-tab-right`,Ae=`--active-tab-top`,je=`--active-tab-bottom`,Me=`--active-tab-width`,Ne=`--active-tab-height`,Pe,Fe={...H,activeTabPosition:()=>null,activeTabSize:()=>null},Ie=2,Le=K.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...o}=e,{getTabElementBySelectedValue:c,orientation:l,tabActivationDirection:u,value:d}=U(),{tabsListElement:f,registerIndicatorUpdateListener:p}=ve(),m=S();K.useEffect(()=>p(m),[p,m]);let h=0,g=0,_=0,v=0,y=0,b=0,x=!1;if(d!=null&&f!=null){let e=c(d);if(e!=null){x=!0;let{width:t,height:n}=ge(e),{width:r,height:i}=ge(f),a=e.getBoundingClientRect(),o=f.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1,l=Re(e,f);h=l.left,_=l.top;let u=(a.left-o.left)/s+f.scrollLeft-f.clientLeft,d=(a.top-o.top)/c+f.scrollTop-f.clientTop,p=Be(e);Math.abs(u-p.x-h)<=Ie&&Math.abs(d-p.y-_)<=Ie&&(h=u,_=d),y=t,b=n,g=f.scrollWidth-h-y,v=f.scrollHeight-_-b}}let C=x?{left:h,right:g,top:_,bottom:v}:null,w=x?{width:y,height:b}:null,T=x?{[Oe]:`${h}px`,[ke]:`${g}px`,[Ae]:`${_}px`,[je]:`${v}px`,[Me]:`${y}px`,[Ne]:`${b}px`}:void 0,E=s(`span`,e,{state:{orientation:l,activeTabPosition:C,activeTabSize:w,tabActivationDirection:u},ref:t,props:[{role:`presentation`,style:T,hidden:!(x&&y>0&&b>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:Fe});return d==null?null:(0,q.jsxs)(K.Fragment,{children:[E,i&&(Pe||=(0,q.jsx)(De,{script:``}))]})});function Re(e,t){let n=ze(e),r=ze(t),i=n.left-r.left-t.clientLeft,a=n.top-r.top-t.clientTop,o=k(e);for(;A(o)&&o!==t&&!j(o);)i-=o.scrollLeft,a-=o.scrollTop,o=k(o);return{left:i,top:a}}function ze(e){let t=0,n=0,r=e;for(;r!=null;){t+=r.offsetLeft,n+=r.offsetTop;let e=r.offsetParent;e!=null&&(t+=e.clientLeft,n+=e.clientTop),r=e}return{left:t,top:n}}function Be(e){let t=N(e).getComputedStyle(e),{x:n,y:r}=T(e,t),i=n,a=r,{translate:o}=t;if(o&&o!==`none`){let t=o.split(` `);i+=Ve(t[0],e.offsetWidth),a+=Ve(t[1],e.offsetHeight)}return{x:i,y:a}}function Ve(e,t){if(!e)return 0;let n=parseFloat(e);return Number.isFinite(n)?e.endsWith(`%`)?n/100*t:n:0}var He=K.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:i,loopFocus:a=!0,render:o,style:s,...c}=e,{orientation:l,setTabMap:u,tabActivationDirection:d}=U(),[f,p]=K.useState(0),[m,h]=K.useState(null),g=K.useRef(new Set),_=K.useRef(new Set),v=K.useRef(null);y(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{g.current.forEach(e=>{e()})});return v.current=e,m&&e.observe(m),_.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[m]);let b=D(e=>(g.current.add(e),()=>{g.current.delete(e)})),x=D(e=>(_.current.add(e),v.current?.observe(e),()=>{_.current.delete(e),v.current?.unobserve(e)})),S={orientation:l,tabActivationDirection:d},C={"aria-orientation":l===`vertical`?`vertical`:void 0,role:`tablist`},w=K.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:b,registerTabResizeObserverElement:x,tabsListElement:m}),[n,b,x,m]);return(0,q.jsx)(_e.Provider,{value:w,children:(0,q.jsx)(le,{render:o,className:i,style:s,state:S,refs:[t,h],props:[C,c],stateAttributesMapping:H,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:a,orientation:l,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:r})})}),Ue=a(`IconArrowInbox`,()=>(0,q.jsx)(`path`,{d:`M20 15V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V15M12 14.5V4M12 14.5L8.5 11M12 14.5L15.5 11`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})),J=(0,K.createContext)(null),We=(0,K.createContext)(null),Ge=C(`relative flex items-center text-body`,{variants:{variant:{pill:`w-fit gap-1 rounded-full bg-fill-subtle p-1`,"pill-ghost":`w-fit gap-0.5 rounded-full`}},defaultVariants:{variant:`pill`}});function Ke(e,t){return e===`pill`?t?`h-[calc(100%-0.5rem)]`:`h-[calc(100%-0.25rem)]`:`h-full`}var qe=({children:e,className:t,variant:r,size:a=`md`,sticky:o,style:s,overflow:c=`scroll`})=>{let l=r??`pill`,d=(0,K.useContext)(J),f=(0,K.useRef)(null),m=(0,K.useRef)(new Map),_=(0,K.useRef)(new Map),v=(0,K.useRef)(d?.value),[y,x]=(0,K.useState)(null),[S,C]=(0,K.useState)([]),T=(0,K.useCallback)(e=>{C(t=>{let n=t.find(t=>t.value===e.value);return n&&n.element===e.element&&n.width===e.width&&n.label===e.label&&n.disabled===e.disabled&&n.onClick===e.onClick&&n.onClose===e.onClose?t:(n?t.map(t=>t.value===e.value?e:t):[...t,e]).sort((e,t)=>e.element===t.element?0:e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)})},[]),E=(0,K.useCallback)(e=>C(t=>t.filter(t=>t.value!==e)),[]),D=d?.appearance===`contained`,O=D||c===`menu`,k=l===`pill`&&!D,ee=Ke(l,D);(0,K.useLayoutEffect)(()=>{let e=f.current;if(!e||!O)return;let t=()=>x(e.clientWidth);if(t(),!(`ResizeObserver`in globalThis))return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[O]);let A=D||k?4:l===`pill-ghost`?2:0,j=D?30:k?4:0,M=D?48:72,N=(0,K.useMemo)(()=>{let e=new Set;if(!O||y===null||S.reduce((e,t)=>e+t.width,0)+A*Math.max(S.length-1,0)+j<=y)return e;let t=y-j-M,n=S.find(e=>e.value===d?.value);n&&(t-=n.width+A);let r=!1;for(let i of S)i!==n&&(r||i.width+A>t?(r=!0,e.add(i.value)):t-=i.width+A);return e},[O,y,S,A,j,M,d?.value]),P=S.filter(e=>N.has(e.value)),te=S.filter(e=>!N.has(e.value)).reduce((e,t)=>e+t.width+A,D?4:0),F=S.filter(e=>!N.has(e.value)&&e.onClose),I=(0,K.useMemo)(()=>({variant:l,size:a,hiddenValues:N,register:T,unregister:E}),[l,a,N,T,E]);return(0,K.useLayoutEffect)(()=>{let e=new Map(_.current),t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;for(let n of S){if(N.has(n.value))continue;let r=n.element.offsetLeft,i=_.current.get(n.value),a=m.current.get(n.value);a&&(a.style.left=`${r}px`,a.style.top=`${n.element.offsetTop}px`,a.style.width=`${n.element.offsetWidth}px`,a.style.height=`${n.element.offsetHeight}px`);let o=i===void 0?0:i-r,s=n.value!==d?.value&&Math.abs(o)<=32;!t&&s&&o!==0&&`animate`in n.element&&n.element.animate([{transform:`translateX(${o}px)`},{transform:`translateX(0)`}],{duration:180,easing:`cubic-bezier(0.32, 0.72, 0, 1)`}),e.set(n.value,r)}for(let t of e.keys())S.some(e=>e.value===t)||e.delete(t);_.current=e},[N,S,d?.value]),(0,K.useLayoutEffect)(()=>{let e=v.current;v.current=d?.value;let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;if(!D||e===d?.value||t)return;let n=f.current?.querySelector(`[data-slot="tabs-indicator"]`);n&&`animate`in n&&n.animate([{opacity:.72,scale:`0.97`},{opacity:1,scale:`1`}],{duration:140,easing:`cubic-bezier(0.32, 0.72, 0, 1)`})},[D,d?.value]),(0,q.jsx)(We.Provider,{value:I,children:(0,q.jsx)(h,{delay:200,children:(0,q.jsxs)(`div`,{ref:f,"data-slot":`tabs-list-scroll`,className:n(`relative w-full`,O&&!D?`flex items-center gap-1`:`overflow-x-auto`,o&&`sticky top-0 z-10 bg-background`),children:[(0,q.jsxs)(He,{"data-slot":`tabs-list`,"data-overflow":P.length>0||void 0,"data-variant":l,"data-size":a,className:n(`group/tabs-list`,Ge({variant:l}),k&&n(w[a],`items-stretch p-0.5`),t),style:s,children:[e,(0,q.jsx)(Le,{className:n(`absolute top-1/2 left-0 z-0 rounded-full bg-[var(--tab-indicator-color,var(--fill-hover))]`,ee,`w-[var(--active-tab-width)]`,`transition-[width,transform] duration-200 ease-in-out motion-reduce:transition-none`),"data-slot":`tabs-indicator`,style:{transform:`translateY(var(--tabs-indicator-y, -50%)) translateX(var(--active-tab-left))`}})]}),(0,q.jsx)(`div`,{"data-slot":`tabs-close-actions`,children:F.map(e=>(0,q.jsx)(`div`,{ref:t=>{t?m.current.set(e.value,t):m.current.delete(e.value)},"data-slot":`tab-close-item`,"data-visible":d?.value===e.value||void 0,children:(0,q.jsxs)(b,{children:[(0,q.jsxs)(g,{render:(0,q.jsx)(`button`,{type:`button`,tabIndex:d?.value===e.value?0:-1,"data-slot":`tab-close`,onClick:e.onClose,className:n(`rounded p-0.5 hover:bg-fill-hover hover:text-destructive-foreground`,u.colors)}),children:[(0,q.jsxs)(`span`,{className:`sr-only`,children:[`Close `,e.label]}),(0,q.jsx)(L,{"aria-hidden":`true`,className:`size-icon-xs`})]}),(0,q.jsxs)(p,{children:[`Close `,e.label]})]})},e.value))}),P.length>0&&(0,q.jsx)(`div`,{"data-slot":`tabs-overflow`,style:D?{transform:`translateX(${te}px)`}:void 0,className:D?`tabs-overflow`:void 0,children:(0,q.jsxs)(V,{children:[(0,q.jsxs)(V.Trigger,{"aria-label":`${P.length} more tabs`,variant:`ghost`,size:`sm`,className:`tabular-nums`,children:[`+`,P.length,(0,q.jsx)(i,{"aria-hidden":`true`,className:`size-icon-xs`})]}),(0,q.jsx)(V.Content,{children:P.map((e,t)=>(0,q.jsxs)(K.Fragment,{children:[(0,q.jsx)(V.Item,{"data-slot":`tabs-overflow-tab`,disabled:e.disabled,className:e.onClose?`pr-9`:void 0,style:{gridArea:`${t+1} / 1`},onClick:()=>{d?.select(e.value),e.onClick?.()},children:e.label}),e.onClose?(0,q.jsxs)(b,{children:[(0,q.jsxs)(g,{render:(0,q.jsx)(V.Item,{"data-slot":`tabs-overflow-close`,className:`pointer-events-none z-10 m-1 size-6 self-center justify-self-end p-0 opacity-0 hover:text-destructive-foreground data-[highlighted]:text-destructive-foreground`,style:{gridArea:`${t+1} / 1`},onClick:e.onClose}),children:[(0,q.jsxs)(`span`,{className:`sr-only`,children:[`Close `,e.label]}),(0,q.jsx)(L,{"aria-hidden":`true`,className:`size-icon-xs`})]}),(0,q.jsxs)(p,{side:`right`,children:[`Close `,e.label]})]}):null]},e.value))})]})})]})})})},Je=({children:e,defaultTab:t,value:r,onValueChange:i,appearance:a=`default`,frame:o=`inset`,className:s,...c})=>{let[l,u]=(0,K.useState)(t),d=r??l,f=e=>{u(e),i?.(e)};return(0,q.jsx)(J.Provider,{value:{appearance:a,value:d,select:f},children:(0,q.jsx)(se,{defaultValue:t,value:d,onValueChange:f,"data-slot":`tabs`,"data-appearance":a,"data-frame":o,className:n(`group/tabs`,a==="default"?`overflow-y-auto`:`w-full min-w-0`,s),...c,children:e})})},Ye=({children:e,value:t,onClick:r,onClose:i,disabled:a,disabledTooltip:o,tooltip:s,attention:u=!1,className:d})=>{let f=(0,K.useContext)(We),m=(0,K.useRef)(null),h=f?.register,_=f?.unregister,v=f?.hiddenValues.has(t)??!1;(0,K.useEffect)(()=>{let n=m.current;if(!n||!h)return;let o=()=>h({value:t,label:e,disabled:a??!1,width:n.getBoundingClientRect().width,element:n,onClick:r,onClose:i});if(o(),!(`ResizeObserver`in globalThis))return;let s=new ResizeObserver(o);return s.observe(n),()=>s.disconnect()},[h,t,e,a,r,i]),(0,K.useEffect)(()=>()=>_?.(t),[_,t]);let y=f?.size??`md`,x=f?.variant===`pill-ghost`?n(F({variant:`ghost`,size:y}),`relative z-10 whitespace-nowrap`,`data-[active]:text-foreground`,`aria-disabled:cursor-not-allowed aria-disabled:opacity-50`,`data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,d):n(`text-label`,ne,u&&`relative`,`flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap outline-none`,c,l,`data-[active]:text-foreground`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:text-muted-foreground`,`aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:text-muted-foreground`,`data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:hover:text-muted-foreground`,d),S=(0,q.jsxs)(ye,{ref:m,render:(0,q.jsx)(`div`,{}),nativeButton:!1,"data-overflowed":v||void 0,"aria-hidden":v||void 0,value:t,disabled:a||v,"data-slot":`tab`,"data-base-ui-swipe-ignore":``,"data-closable":i?``:void 0,className:x,onClick:r,children:[e,u&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`tab-attention`}),(0,q.jsx)(`span`,{className:`sr-only`,children:` Needs attention`})]})]});return a&&o?(0,q.jsxs)(b,{children:[(0,q.jsx)(g,{render:(0,q.jsx)(`span`,{tabIndex:0,className:`inline-flex`}),children:S}),(0,q.jsx)(p,{children:o})]}):s&&!a?(0,q.jsxs)(b,{children:[(0,q.jsx)(g,{render:S}),(0,q.jsx)(p,{children:s})]}):S},Xe={js:`javascript`,javascript:`javascript`,mjs:`javascript`,cjs:`javascript`,node:`javascript`,ts:`typescript`,typescript:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,jsx:`jsx`,json:`json`,json5:`json`,md:`markdown`,markdown:`markdown`,py:`python`,python:`python`,sh:`bash`,bash:`bash`,shell:`bash`,zsh:`bash`,yml:`yaml`,yaml:`yaml`,diff:`diff`,patch:`diff`,css:`css`,scss:`css`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,sql:`sql`};async function Y(e){let[{StreamLanguage:t},n]=await Promise.all([G(()=>import(`./dist-Sr6WSEaV.js`).then(e=>e.h),__vite__mapDeps([0,1,2])),e]);return t.define(n).parser}async function X(e){let{javascript:t}=await G(async()=>{let{javascript:e}=await import(`./dist-B5wMYzWI.js`).then(e=>e.t);return{javascript:e}},__vite__mapDeps([3,1,4,2,0]));return t(e).language.parser}var Ze={javascript:()=>X({}),jsx:()=>X({jsx:!0}),typescript:()=>X({typescript:!0}),tsx:()=>X({jsx:!0,typescript:!0}),json:()=>G(()=>import(`./dist-DtnqB3m_.js`).then(e=>e.t).then(e=>e.jsonLanguage.parser),__vite__mapDeps([5,1,4,2,0])),markdown:()=>G(()=>import(`./dist-CMX7_OjZ.js`).then(e=>e.t).then(e=>e.markdownLanguage.parser),__vite__mapDeps([6,1,0,2,3,4])),bash:()=>Y(G(()=>import(`./shell-DwuoZtxw.js`).then(e=>e.shell),[])),python:()=>Y(G(()=>import(`./python-DIWH3FmR.js`).then(e=>e.python),[])),yaml:()=>Y(G(()=>import(`./yaml-BEzOWJ7L.js`).then(e=>e.yaml),[])),diff:()=>Y(G(()=>import(`./diff-ChtP43wD.js`).then(e=>e.diff),[])),css:()=>Y(G(()=>import(`./css-CIHhKeSF.js`).then(e=>e.css),[])),html:()=>Y(G(()=>import(`./xml-aKzObEic.js`).then(e=>e.html),[])),xml:()=>Y(G(()=>import(`./xml-aKzObEic.js`).then(e=>e.xml),[])),sql:()=>Y(G(()=>import(`./sql-DrH7SW3s.js`).then(e=>e.standardSQL),[]))},Z=new Map;function Qe(e){let t=Z.get(e);return t||(t=Ze[e](),t.catch(()=>Z.delete(e)),Z.set(e,t)),t}var Q=[{tag:[W.comment,W.bracket],class:`syntax-comment`},{tag:[W.string,W.meta,W.regexp,W.name,W.quote,W.standard(W.tagName)],class:`syntax-string`},{tag:[W.atom,W.bool,W.special(W.variableName)],class:`syntax-literal`},{tag:[W.keyword,W.operator,W.tagName,W.deleted],class:`syntax-keyword`},{tag:[W.function(W.propertyName),W.propertyName,W.variableName,W.number],class:`syntax-name`},{tag:[W.definition(W.variableName),W.function(W.variableName),W.className,W.attributeName,W.url],class:`syntax-definition`},{tag:W.link,class:`syntax-link`},{tag:W.heading,class:`syntax-heading`},{tag:W.emphasis,class:`syntax-emphasis`},{tag:W.strong,class:`syntax-strong`},{tag:W.strikethrough,class:`syntax-strike`},{tag:W.invalid,class:`syntax-invalid`}],$e=fe(Q);function et(e,t){if(!t||!e.startsWith(t.code))return;let n=t.code.length;return pe.applyChanges(pe.addTree(t.tree),[{fromA:n,toA:n,fromB:n,toB:e.length}])}async function tt(e,t,n){let r=Xe[t?.toLowerCase()];if(!r)return null;let i=(await Qe(r)).parse(e,et(e,n)),a=[],o=[a],s=(e,t)=>{e.split(`
|
|
3
|
+
`).forEach((e,n)=>{n>0&&o.push(a=[]),e&&a.push(t?{content:e,className:t}:{content:e})})},c=0;return me(i,$e,(t,n,r)=>{t>c&&s(e.slice(c,t)),s(e.slice(t,n),r),c=n}),c<e.length&&s(e.slice(c)),{code:e,tokens:o,tree:i}}function nt(e){let t=e?.split(`.`).pop()?.toLowerCase();return t?Xe[t]:void 0}var rt=75;function it(e,t){let[n,r]=(0,K.useState)(null),i=(0,K.useRef)(null),[a,o]=de(e,rt,{leading:!0,maxWait:rt});return(0,K.useEffect)(()=>()=>o.cancel(),[o]),(0,K.useEffect)(()=>{if(!t)return;let e=!1,n=i.current?.lang===t?i.current:void 0;return tt(a,t,n).then(n=>{!e&&n?.tokens.length&&(i.current={...n,lang:t},r(i.current))}).catch(()=>{}),()=>{e=!0}},[a,t]),t?n:null}function at(e,t,n){return!e||e.lang!==n?null:t.startsWith(e.code)?e:null}var $=K.memo(function({code:e,lang:t,lineClassName:n,...r}){let i=at(it(e,t),e,t);if(!i){if(!n)return(0,q.jsx)(`pre`,{...r,children:e});let t=e.split(`
|
|
4
|
+
`);return(0,q.jsx)(`pre`,{...r,children:t.map((e,r)=>(0,q.jsxs)(K.Fragment,{children:[(0,q.jsx)(`span`,{"data-line":r,className:n(r,e),children:e}),r!==t.length-1&&`
|
|
5
|
+
`]},r))})}let a=e.slice(i.code.length),o=0;return(0,q.jsx)(`pre`,{...r,children:(0,q.jsxs)(`code`,{className:`font-[inherit]`,children:[i.tokens.map((e,t)=>{let r=o,a=r,s=e.map(e=>{let t=a;return a+=e.content.length,(0,q.jsx)(`span`,{className:e.className,children:e.content},t)});return o=a+1,(0,q.jsxs)(K.Fragment,{children:[n?(0,q.jsx)(`span`,{"data-line":t,className:n(t,e.map(e=>e.content).join(``)),children:s}):(0,q.jsx)(`span`,{children:s}),t!==i.tokens.length-1&&`
|
|
6
|
+
`]},r)}),a]})})});function ot({code:e,options:t,value:r,onValueChange:i,selector:a=`select`,fileName:o,lang:s,overflow:c=`wrap`,copyMessage:l,copyTooltip:d,actions:f,className:p}){let m=t&&t.length>0,h=m&&a===`tabs`,g=m&&a===`select`,_=t?.[0],v=r??_?.value;return(0,q.jsxs)(`figure`,{className:n(`group relative flex w-full flex-col overflow-hidden rounded-2xl border border-border bg-background [contain:inline-size]`,p),children:[h&&_&&(0,q.jsx)(Je,{defaultTab:_.value,value:v,onValueChange:i??(()=>{}),children:(0,q.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,q.jsx)(qe,{children:t.map(e=>(0,q.jsx)(Ye,{value:e.value,children:e.label},e.value))})}),f&&(0,q.jsx)(`div`,{className:`flex shrink-0 items-center border-b border-border pr-2 pl-3`,children:f})]})}),g&&t&&(0,q.jsxs)(`div`,{className:`flex items-center border-b border-border px-2 py-1.5`,children:[(0,q.jsxs)(ae,{value:v,onValueChange:i,children:[(0,q.jsx)(R,{size:`sm`,variant:`ghost`,className:`w-auto`,children:(0,q.jsx)(ie,{})}),(0,q.jsx)(z,{children:t.map(e=>(0,q.jsx)(B,{value:e.value,children:e.label},e.value))})]}),f&&(0,q.jsx)(`div`,{className:`ml-auto flex items-center`,children:f})]}),!m&&o&&(0,q.jsxs)(`div`,{className:`flex items-center border-b border-border px-4 py-2`,children:[(0,q.jsx)(`figcaption`,{className:`font-mono text-caption text-muted-foreground`,children:o}),f&&(0,q.jsx)(`div`,{className:`ml-auto flex items-center`,children:f})]}),!m&&!o&&f&&(0,q.jsx)(`div`,{className:`flex items-center justify-end border-b border-border px-2 py-1.5`,children:f}),(0,q.jsxs)(`div`,{className:`relative`,children:[(0,q.jsx)($,{code:e,lang:s,className:n(`px-4 py-3 font-mono text-caption text-foreground`,c===`scroll`?`overflow-x-auto whitespace-pre`:`break-all whitespace-pre-wrap`)}),(0,q.jsx)(ue,{content:e,copyMessage:l,tooltip:d,className:n(`absolute top-2 right-2 opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 pointer-fine:opacity-0`,u.opacity)})]})]})}export{$e as a,qe as c,Ue as d,nt as i,Je as l,$ as n,Q as o,it as r,Ye as s,ot as t,J as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Rs as t,mi as n,ni as r,vi as i}from"./GithubIcon.es-B1lB1Q-8.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./esm-Dp9Y59hS.js";import{a as d}from"./CodeBlock.es-BeD4YikJ.js";import{t as f}from"./copy-button-Brk8iwgE-DHsIfP0z.js";import{t as p}from"./IconCodeBrackets.es-o1byTuto.js";import{t as m}from"./preload-helper-BLdHbfdN.js";import{yt as h}from"./useSessionRows-aTHnrKGG.js";import{O as g,T as _,k as v}from"./IconChevronRightMedium.es-BjSIsine.js";import{n as y}from"./dist-DtnqB3m_.js";import{n as b,r as x}from"./dist-CMX7_OjZ.js";import{F as S,I as C,L as w,N as T,_ as E,dt as D,j as O}from"./dist-Sr6WSEaV.js";import{c as k}from"./dist-B5wMYzWI.js";var A,j=()=>A??=Promise.all([m(()=>import(`./standalone-YobQElH8.js`),[]),m(()=>import(`./babel-BaOs8qJH.js`),[]),m(()=>import(`./estree-Cw-tQG5d.js`),[])]).catch(e=>{throw A=void 0,e}),M=async e=>{let[t,n,r]=await j();return await t.format(e,{semi:!1,parser:`json`,printWidth:80,tabWidth:2,plugins:[n,r]})},N=e(v(),1),P=g(),F=S.theme({".cm-foldGutter .cm-gutterElement":{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`0 4px`},".cm-fold-marker":{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`12px`,height:`12px`,boxSizing:`border-box`,border:`1px solid var(--border)`,borderRadius:`2px`,color:`var(--muted-foreground)`,fontSize:`var(--text-caption)`,lineHeight:`1`,cursor:`pointer`,userSelect:`none`},".cm-fold-marker:hover":{background:`var(--fill-hover)`,color:`var(--foreground)`},".cm-foldPlaceholder":{background:`var(--fill-hover)`,border:`1px solid var(--border)`,color:`var(--muted-foreground)`,borderRadius:`2px`,padding:`0 4px`,margin:`0 2px`}}),I=[E({markerDOM:e=>{let t=document.createElement(`span`);return t.className=`cm-fold-marker`,t.dataset.state=e?`open`:`closed`,t.title=e?`Fold`:`Unfold`,t.textContent=e?`−`:`+`,t}}),F];function L(e,t=5){if(!e?.properties)return[];let n=[];function r(e,i,a){if(a>t)return;let o=Array.isArray(e.type)?e.type.join(` | `):e.type;if(n.push({path:i,label:i,description:e.description??e.title,type:o}),e.properties)for(let[t,n]of Object.entries(e.properties))r(n,`${i}.${t}`,a+1);if(e.items?.properties)for(let[t,n]of Object.entries(e.items.properties))r(n,`${i}[].${t}`,a+1)}for(let[t,n]of Object.entries(e.properties))r(n,t,1);return n}function R(e){let t=L(e);return k({override:[z(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function z(e){return t=>{let n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;let r=n[1]??``,i=t.pos-r.length,a=r?e.filter(e=>e.path.toLowerCase().startsWith(r.toLowerCase())):e;return a.length===0?null:{from:i,options:a.map(e=>({label:e.path,displayLabel:e.path,detail:e.type,info:e.description,apply:(e,t,n,r)=>{let i=r+(e.state.sliceDoc(r).match(/^[a-zA-Z0-9_.\[\]]*/)?.[0].length??0),a=e.state.sliceDoc(i,i+2)===`}}`,o=a?i:r,s=a?t.label:`${t.label}}}`;e.dispatch({changes:{from:n,to:o,insert:s},selection:{anchor:n+s.length}})}})),validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}var B=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,V=T.mark({class:`cm-variable-highlight`}),H=new C({regexp:B,decoration:()=>V}),U=w.fromClass(class{decorations;constructor(e){this.decorations=H.createDeco(e)}update(e){this.decorations=H.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),W=(e=`mono`)=>(0,N.useMemo)(()=>[l(e),O(d)],[e]),G=t(_(`relative overflow-hidden font-mono outline-hidden focus-within:outline-hidden focus:outline-hidden`,`transition-colors duration-normal ease-out-custom`),{variants:{variant:{default:_(i,`rounded-md p-1`,n),embedded:`rounded-none border-none bg-transparent p-0`,inline:`rounded-none border-none bg-transparent p-0`}},defaultVariants:{variant:`default`}}),K=(0,N.forwardRef)(({data:e,value:t,onChange:n,showCopyButton:i=!0,showFormatButton:l=!1,className:d,language:m=`json`,font:g=`mono`,highlightVariables:v=!1,placeholder:C,schema:w,autoFocus:T,lineNumbers:E=!0,lineWrapping:O=!0,editable:k,extensions:A,variant:j,id:F,"aria-label":L,"aria-labelledby":z,"aria-describedby":B,"aria-invalid":V,...H},K)=>{let{ariaLabel:q,contentAttributes:J}=c({id:F,"aria-label":L,"aria-labelledby":z,"aria-describedby":B,"aria-invalid":V},`Code editor`),Y=W(g),X=e?JSON.stringify(e,null,2):t??``,Z=l&&m===`json`&&k!==!1&&!!n,Q=async()=>{try{n?.((await M(X)).trimEnd())}catch{h.error(`Can’t format: the JSON is invalid`)}},$=(0,N.useMemo)(()=>{let e=[...o,J,j===`inline`?a:I];return O&&e.push(S.lineWrapping),m===`json`?e.push(y):m===`markdown`&&e.push(b({base:x,codeLanguages:s})),v&&m===`markdown`&&e.push(U),w&&m===`markdown`&&e.push(R(w)),k===!1&&e.push(D.readOnly.of(!0)),A&&e.push(...A),e},[A,j,m,v,w,k,O,J]);return(0,P.jsxs)(`div`,{className:_(G({variant:j}),d),...H,children:[(i||Z)&&(0,P.jsxs)(`div`,{className:`absolute top-2 right-2 z-20 flex gap-1`,children:[Z&&(0,P.jsx)(r,{type:`button`,size:`icon-sm`,tooltip:`Format JSON`,"aria-label":`Format JSON`,onClick:Q,children:(0,P.jsx)(p,{})}),i&&(0,P.jsx)(f,{content:X})]}),(0,P.jsx)(u,{ref:K,value:X,theme:Y,extensions:$,onChange:n,editable:k,"aria-label":q,placeholder:C,height:`100%`,style:{height:`100%`},autoFocus:T,basicSetup:{lineNumbers:E,foldGutter:!1}})]})});export{K as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Bt as t,Dt as n,Ot as r,St as i,Vt as a,jt as o,ua as s,vo as c}from"./GithubIcon.es-BPBhMx2H.js";import{O as l,T as u,k as d,n as f,u as p}from"./IconChevronRightMedium.es-BjSIsine.js";import{D as m,E as h,O as g,S as _,T as v,k as y}from"./Sidebar.es-DSPzNNju.js";import{t as ee}from"./password-manager-autofill.es-Cs1VH0JI.js";var b=e(d(),1),x=l(),S=1,C=.9,w=.8,T=.17,E=.1,D=.999,O=.9999,k=.99,te=/[\\\/_+.#"@\[\(\{&]/,A=/[\\\/_+.#"@\[\(\{&]/g,j=/[\s-]/,ne=/[\s-]/g;function M(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?S:k;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=M(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=S:te.test(e.charAt(l-1))?(d*=w,p=e.slice(i,l-1).match(A),p&&i>0&&(d*=D**+p.length)):j.test(e.charAt(l-1))?(d*=C,m=e.slice(i,l-1).match(ne),m&&i>0&&(d*=D**+m.length)):(d*=T,i>0&&(d*=D**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=O)),(d<E&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=M(e,t,n,r,l+1,a+2,o),f*E>d&&(d=f*E)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function re(e){return e.toLowerCase().replace(ne,` `)}function ie(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,M(e,t,re(e),re(t),0,0,{})}var ae=Object.defineProperty,N=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),oe=!!(typeof window<`u`&&window.document&&window.document.createElement);function P(e,t,{checkForDefaultPrevented:n=!0}={}){return N(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}N(P,`composeEventHandlers`);function se(e){if(!oe)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}N(se,`getOwnerWindow`);function ce(e){if(!oe)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}N(ce,`getOwnerDocument`);function le(e,t=!1){let{activeElement:n}=ce(e);if(!n?.nodeName)return null;if(ue(n)&&n.contentDocument)return le(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ce(n).getElementById(e);if(t)return t}}return n}N(le,`getActiveElement`);function ue(e){return e.tagName===`IFRAME`}N(ue,`isFrame`);var de=Object.defineProperty,F=(e,t)=>de(e,`name`,{value:t,configurable:!0});function fe(e,t){let n=b.createContext(t);n.displayName=e+`Context`;let r=F(e=>{let{children:t,...r}=e,i=b.useMemo(()=>r,Object.values(r));return(0,x.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=b.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return F(i,`useContext`),[r,i]}F(fe,`createContext`);function pe(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=F(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,x.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=b.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return F(s,`useContext`),[o,s]}F(r,`createContext`);let i=F(()=>{let t=n.map(e=>b.createContext(e));return F(function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,me(i,...t)]}F(pe,`createContextScope`);function me(...e){let t=e[0];if(e.length===1)return t;let n=F(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return F(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}F(me,`composeContextScopes`);var I=globalThis?.document?b.useLayoutEffect:()=>{},he=Object.defineProperty,ge=(e,t)=>he(e,`name`,{value:t,configurable:!0}),_e=b.useId||(()=>void 0),ve=0;function L(e){let[t,n]=b.useState(_e());return I(()=>{e||n(e=>e??String(ve++))},[e]),e||(t?`radix-${t}`:``)}ge(L,`useId`);var ye=Object.defineProperty,be=(e,t)=>ye(e,`name`,{value:t,configurable:!0}),xe=b.useEffectEvent,Se=b.useInsertionEffect;function Ce(e){if(typeof xe==`function`)return xe(e);let t=b.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Se==`function`?Se(()=>{t.current=e}):I(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}be(Ce,`useEffectEvent`);var we=Object.defineProperty,Te=(e,t)=>we(e,`name`,{value:t,configurable:!0}),Ee=b.useInsertionEffect||I;function De({prop:e,defaultProp:t,onChange:n=Te(()=>{},`onChange`),caller:r}){let[i,a,o]=Oe({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,b.useCallback(t=>{if(s){let n=ke(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Te(De,`useControllableState`);function Oe({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return Ee(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Te(Oe,`useUncontrolledState`);function ke(e){return typeof e==`function`}Te(ke,`isFunction`);var Ae=Symbol(`RADIX:SYNC_STATE`);function je(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ce(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=b.useReducer((t,n)=>{if(n.type===Ae)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=b.useRef(p);b.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=b.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return b.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Ae,state:i})},[i,d.state,c]),[h,f]}Te(je,`useControllableStateReducer`);var Me=Object.defineProperty,Ne=(e,t)=>Me(e,`name`,{value:t,configurable:!0}),Pe=b.useInsertionEffect;function R(e){let t=b.useRef(e);return typeof Pe==`function`?Pe(()=>{t.current=e}):I(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ne(R,`useCallbackRef`);var Fe=Object.defineProperty,z=(e,t)=>Fe(e,`name`,{value:t,configurable:!0}),Ie=`dismissableLayer.update`,Le=`dismissableLayer.pointerDownOutside`,Re=`dismissableLayer.focusOutside`,ze,Be=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ve=b.forwardRef(z(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=b.useContext(Be),[d,f]=b.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=b.useState({}),h=y(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),ee=_?g.indexOf(_):-1,S=d?g.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,w=S>=ee,T=b.useRef(!1),E=We(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:b.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return w&&!t},[u.branches,w])}),D=Ge(e=>{if(r&&T.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),O=d?S===g.length-1:!1,k=R(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return b.useEffect(()=>{if(O)return p.addEventListener(`keydown`,k,{capture:!0}),()=>p.removeEventListener(`keydown`,k,{capture:!0})},[p,O,k]),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ze=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ke(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ze))}},[d,p,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ke())},[d,u]),b.useEffect(()=>{let e=z(()=>m({}),`handleUpdate`);return document.addEventListener(Ie,e),()=>document.removeEventListener(Ie,e)},[]),(0,x.jsx)(v.div,{...l,ref:h,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:P(e.onFocusCapture,D.onFocusCapture),onBlurCapture:P(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:P(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function He(){let e=b.useContext(Be),[t,n]=b.useState(null);return b.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}z(He,`useDismissableLayerSurface`);var Ue=z(()=>!0,`IS_TRUE`);function We(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ue}=t,s=R(e),c=b.useRef(!1),l=b.useRef(!1),u=b.useRef(new Map),d=b.useRef(()=>{});return b.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}z(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}z(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}z(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}z(p,`handleInteractionBubble`);let m=z(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||qe(Le,s,p,{discrete:!0})};if(z(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!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`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:z(()=>c.current=!0,`onPointerDownCapture`)}}z(We,`usePointerDownOutside`);function Ge(e,t=globalThis?.document){let n=R(e),r=b.useRef(!1);return b.useEffect(()=>{let e=z(e=>{e.target&&!r.current&&qe(Re,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:z(()=>r.current=!0,`onFocusCapture`),onBlurCapture:z(()=>r.current=!1,`onBlurCapture`)}}z(Ge,`useFocusOutside`);function Ke(){let e=new CustomEvent(Ie);document.dispatchEvent(e)}z(Ke,`dispatchUpdate`);function qe(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?h(i,a):i.dispatchEvent(a)}z(qe,`handleAndDispatchCustomEvent`);var Je=Object.defineProperty,B=(e,t)=>Je(e,`name`,{value:t,configurable:!0}),Ye=`focusScope.autoFocusOnMount`,Xe=`focusScope.autoFocusOnUnmount`,Ze={bubbles:!1,cancelable:!0},Qe=b.forwardRef(B(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=b.useState(null),u=R(a),d=R(o),f=b.useRef(null),p=y(t,l),m=b.useRef(i);b.useEffect(()=>{m.current=i});let h=b.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:V(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||V(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&V(c)};B(e,`handleFocusIn`),B(t,`handleFocusOut`),B(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),b.useEffect(()=>{if(c){lt.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Ye,Ze);c.addEventListener(Ye,u),c.dispatchEvent(t),t.defaultPrevented||(rt(ft(at(c)),{select:!0}),document.activeElement===e&&V(c))}return()=>{c.removeEventListener(Ye,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Xe,Ze);c.addEventListener(Xe,d),c.dispatchEvent(r),r.defaultPrevented||V(e??t.body,{select:!0}),c.removeEventListener(Xe,d),lt.remove(g)},0)}}},[c,u,d,g]);let _=b.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]=it(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&V(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&V(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,x.jsx)(v.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),$e=b.createContext(null);function et({registry:e,children:t}){return e?(0,x.jsx)($e.Provider,{value:e,children:t}):t}B(et,`FocusScopeBranchProvider`);function tt(){let[e,t]=b.useState([]);return{nodes:e,registry:b.useMemo(()=>({add:B(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:B(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}B(tt,`useFocusScopeBranchRegistry`);function nt(e){let t=b.useContext($e);b.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}B(nt,`useFocusScopeBranch`);function rt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(V(r,{select:t}),document.activeElement!==n)return}B(rt,`focusFirst`);function it(e){let t=at(e);return[ot(t,e),ot(t.reverse(),e)]}B(it,`getTabbableEdges`);function at(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:B(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},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}B(at,`getTabbableCandidates`);function ot(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):st(r,{upTo:t})))return r}B(ot,`findVisible`);function st(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}B(st,`isHidden`);function ct(e){return e.tagName===`INPUT`&&typeof e.select==`function`}B(ct,`isSelectableInput`);function V(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&ct(e)&&t&&e.select()}}B(V,`focus`);var lt=ut();function ut(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=dt(e,t),e.unshift(t)},remove(t){e=dt(e,t),e[0]?.resume()}}}B(ut,`createFocusScopesStack`);function dt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}B(dt,`arrayRemove`);function ft(e){return e.filter(e=>e.tagName!==`A`)}B(ft,`removeLinks`);var pt=e(c(),1),mt=Object.defineProperty,ht=b.forwardRef(((e,t)=>mt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=b.useState(!1);I(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pt.createPortal((0,x.jsx)(v.div,{...r,ref:t}),o):null},`Portal`)),gt=Object.defineProperty,H=(e,t)=>gt(e,`name`,{value:t,configurable:!0});function _t(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}H(_t,`useStateMachine`);var vt=H(e=>{let{present:t,children:n}=e,r=yt(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=xt(r.ref,St(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null},`Presence`);function yt(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),o=b.useRef(void 0),[s,c]=_t(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{s===`mounted`?(a.current=o.current??U(r.current),o.current=void 0):a.current=`none`},[s]),I(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=U(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),I(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=H(a=>{let o=U(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=H(e=>{e.target===t&&(a.current=U(r.current))},`handleAnimationStart`);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)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:b.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=U(t)}else r.current=null;n(e)},[])}}H(yt,`usePresence`);function bt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}H(bt,`setRef`);function xt(...e){let t=b.useRef(e);return t.current=e,b.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=bt(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():bt(n[e],null)}}},[])}H(xt,`useStableComposedRefs`);function U(e){return e?.animationName||`none`}H(U,`getAnimationName`);function St(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)}H(St,`getElementRef`);var Ct=Object.defineProperty,wt=(e,t)=>Ct(e,`name`,{value:t,configurable:!0}),Tt=0,Et=null;function Dt(e){return Ot(),e.children}wt(Dt,`FocusGuards`);function Ot(){b.useEffect(()=>{Et||={start:kt(),end:kt()};let{start:e,end:t}=Et;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Tt++,()=>{Tt===1&&(Et?.start.remove(),Et?.end.remove(),Et=null),Tt=Math.max(0,Tt-1)}},[])}wt(Ot,`useFocusGuards`);function kt(){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}wt(kt,`createFocusGuard`);var W=function(){return W=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},W.apply(this,arguments)};function At(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 jt(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 Mt=`right-scroll-bar-position`,Nt=`width-before-scroll-bar`,Pt=`with-scroll-bars-hidden`,Ft=`--removed-body-scroll-bar-size`;function It(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Lt(e,t){var n=(0,b.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 Rt=typeof window<`u`?b.useLayoutEffect:b.useEffect,zt=new WeakMap;function Bt(e,t){var n=Lt(t||null,function(t){return e.forEach(function(e){return It(e,t)})});return Rt(function(){var t=zt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||It(e,null)}),i.forEach(function(e){r.has(e)||It(e,a)})}zt.set(n,e)},[e]),n}function Vt(e){return e}function Ht(e,t){t===void 0&&(t=Vt);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 Ut(e){e===void 0&&(e={});var t=Ht(null);return t.options=W({async:!0,ssr:!1},e),t}var Wt=function(e){var t=e.sideCar,n=At(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 b.createElement(r,W({},n))};Wt.isSideCarExport=!0;function Gt(e,t){return e.useMedium(t),Wt}var Kt=Ut(),qt=function(){},Jt=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:qt,onWheelCapture:qt,onTouchMoveCapture:qt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,ee=At(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Bt([n,t]),C=W(W({},ee),i);return b.createElement(b.Fragment,null,u&&b.createElement(x,{sideCar:Kt,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?b.cloneElement(b.Children.only(s),W(W({},C),{ref:S})):b.createElement(v,W({},C,{className:c,ref:S}),s))});Jt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jt.classNames={fullWidth:Nt,zeroRight:Mt};var Yt=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Xt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Yt();return t&&e.setAttribute(`nonce`,t),e}function Zt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var $t=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xt())&&(Zt(t,n),Qt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},en=function(){var e=$t();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tn=function(){var e=en();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},nn={left:0,top:0,right:0,gap:0},rn=function(e){return parseInt(e||``,10)||0},an=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[rn(n),rn(r),rn(i)]},on=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return nn;var t=an(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])}},sn=tn(),cn=`data-scroll-locked`,ln=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-XKyaHtl9.js";import{Bt as t,Dt as n,Ot as r,St as i,Vt as a,ji as o,jt as s,za as c}from"./GithubIcon.es-B1lB1Q-8.js";import{O as l,T as u,k as d,n as f,u as p}from"./IconChevronRightMedium.es-BjSIsine.js";import{a as m,i as h,n as g,o as _,r as v,s as y}from"./IconSettingsSliderHor.es-CSwP_iSG.js";import{t as ee}from"./password-manager-autofill.es-Cs1VH0JI.js";var b=e(d(),1),x=l(),S=1,C=.9,w=.8,T=.17,E=.1,D=.999,O=.9999,k=.99,te=/[\\\/_+.#"@\[\(\{&]/,A=/[\\\/_+.#"@\[\(\{&]/g,j=/[\s-]/,ne=/[\s-]/g;function M(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?S:k;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=M(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=S:te.test(e.charAt(l-1))?(d*=w,p=e.slice(i,l-1).match(A),p&&i>0&&(d*=D**+p.length)):j.test(e.charAt(l-1))?(d*=C,m=e.slice(i,l-1).match(ne),m&&i>0&&(d*=D**+m.length)):(d*=T,i>0&&(d*=D**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=O)),(d<E&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=M(e,t,n,r,l+1,a+2,o),f*E>d&&(d=f*E)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function re(e){return e.toLowerCase().replace(ne,` `)}function ie(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,M(e,t,re(e),re(t),0,0,{})}var ae=Object.defineProperty,N=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),oe=!!(typeof window<`u`&&window.document&&window.document.createElement);function P(e,t,{checkForDefaultPrevented:n=!0}={}){return N(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}N(P,`composeEventHandlers`);function se(e){if(!oe)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}N(se,`getOwnerWindow`);function ce(e){if(!oe)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}N(ce,`getOwnerDocument`);function le(e,t=!1){let{activeElement:n}=ce(e);if(!n?.nodeName)return null;if(ue(n)&&n.contentDocument)return le(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ce(n).getElementById(e);if(t)return t}}return n}N(le,`getActiveElement`);function ue(e){return e.tagName===`IFRAME`}N(ue,`isFrame`);var de=Object.defineProperty,F=(e,t)=>de(e,`name`,{value:t,configurable:!0});function fe(e,t){let n=b.createContext(t);n.displayName=e+`Context`;let r=F(e=>{let{children:t,...r}=e,i=b.useMemo(()=>r,Object.values(r));return(0,x.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=b.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return F(i,`useContext`),[r,i]}F(fe,`createContext`);function pe(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=F(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,x.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=b.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return F(s,`useContext`),[o,s]}F(r,`createContext`);let i=F(()=>{let t=n.map(e=>b.createContext(e));return F(function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,me(i,...t)]}F(pe,`createContextScope`);function me(...e){let t=e[0];if(e.length===1)return t;let n=F(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return F(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}F(me,`composeContextScopes`);var I=globalThis?.document?b.useLayoutEffect:()=>{},he=Object.defineProperty,ge=(e,t)=>he(e,`name`,{value:t,configurable:!0}),_e=b.useId||(()=>void 0),ve=0;function L(e){let[t,n]=b.useState(_e());return I(()=>{e||n(e=>e??String(ve++))},[e]),e||(t?`radix-${t}`:``)}ge(L,`useId`);var ye=Object.defineProperty,be=(e,t)=>ye(e,`name`,{value:t,configurable:!0}),xe=b.useEffectEvent,Se=b.useInsertionEffect;function Ce(e){if(typeof xe==`function`)return xe(e);let t=b.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Se==`function`?Se(()=>{t.current=e}):I(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}be(Ce,`useEffectEvent`);var we=Object.defineProperty,Te=(e,t)=>we(e,`name`,{value:t,configurable:!0}),Ee=b.useInsertionEffect||I;function De({prop:e,defaultProp:t,onChange:n=Te(()=>{},`onChange`),caller:r}){let[i,a,o]=Oe({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,b.useCallback(t=>{if(s){let n=ke(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Te(De,`useControllableState`);function Oe({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return Ee(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Te(Oe,`useUncontrolledState`);function ke(e){return typeof e==`function`}Te(ke,`isFunction`);var Ae=Symbol(`RADIX:SYNC_STATE`);function je(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ce(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=b.useReducer((t,n)=>{if(n.type===Ae)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=b.useRef(p);b.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=b.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return b.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Ae,state:i})},[i,d.state,c]),[h,f]}Te(je,`useControllableStateReducer`);var Me=Object.defineProperty,Ne=(e,t)=>Me(e,`name`,{value:t,configurable:!0}),Pe=b.useInsertionEffect;function R(e){let t=b.useRef(e);return typeof Pe==`function`?Pe(()=>{t.current=e}):I(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ne(R,`useCallbackRef`);var Fe=Object.defineProperty,z=(e,t)=>Fe(e,`name`,{value:t,configurable:!0}),Ie=`dismissableLayer.update`,Le=`dismissableLayer.pointerDownOutside`,Re=`dismissableLayer.focusOutside`,ze,Be=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ve=b.forwardRef(z(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=b.useContext(Be),[d,f]=b.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=b.useState({}),h=y(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),ee=_?g.indexOf(_):-1,S=d?g.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,w=S>=ee,T=b.useRef(!1),E=We(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:b.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return w&&!t},[u.branches,w])}),D=Ge(e=>{if(r&&T.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),O=d?S===g.length-1:!1,k=R(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return b.useEffect(()=>{if(O)return p.addEventListener(`keydown`,k,{capture:!0}),()=>p.removeEventListener(`keydown`,k,{capture:!0})},[p,O,k]),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ze=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ke(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ze))}},[d,p,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ke())},[d,u]),b.useEffect(()=>{let e=z(()=>m({}),`handleUpdate`);return document.addEventListener(Ie,e),()=>document.removeEventListener(Ie,e)},[]),(0,x.jsx)(v.div,{...l,ref:h,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:P(e.onFocusCapture,D.onFocusCapture),onBlurCapture:P(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:P(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function He(){let e=b.useContext(Be),[t,n]=b.useState(null);return b.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}z(He,`useDismissableLayerSurface`);var Ue=z(()=>!0,`IS_TRUE`);function We(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ue}=t,s=R(e),c=b.useRef(!1),l=b.useRef(!1),u=b.useRef(new Map),d=b.useRef(()=>{});return b.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}z(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}z(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}z(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}z(p,`handleInteractionBubble`);let m=z(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||qe(Le,s,p,{discrete:!0})};if(z(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!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`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:z(()=>c.current=!0,`onPointerDownCapture`)}}z(We,`usePointerDownOutside`);function Ge(e,t=globalThis?.document){let n=R(e),r=b.useRef(!1);return b.useEffect(()=>{let e=z(e=>{e.target&&!r.current&&qe(Re,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:z(()=>r.current=!0,`onFocusCapture`),onBlurCapture:z(()=>r.current=!1,`onBlurCapture`)}}z(Ge,`useFocusOutside`);function Ke(){let e=new CustomEvent(Ie);document.dispatchEvent(e)}z(Ke,`dispatchUpdate`);function qe(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?h(i,a):i.dispatchEvent(a)}z(qe,`handleAndDispatchCustomEvent`);var Je=Object.defineProperty,B=(e,t)=>Je(e,`name`,{value:t,configurable:!0}),Ye=`focusScope.autoFocusOnMount`,Xe=`focusScope.autoFocusOnUnmount`,Ze={bubbles:!1,cancelable:!0},Qe=b.forwardRef(B(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=b.useState(null),u=R(a),d=R(o),f=b.useRef(null),p=y(t,l),m=b.useRef(i);b.useEffect(()=>{m.current=i});let h=b.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:V(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||V(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&V(c)};B(e,`handleFocusIn`),B(t,`handleFocusOut`),B(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),b.useEffect(()=>{if(c){lt.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Ye,Ze);c.addEventListener(Ye,u),c.dispatchEvent(t),t.defaultPrevented||(rt(ft(at(c)),{select:!0}),document.activeElement===e&&V(c))}return()=>{c.removeEventListener(Ye,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Xe,Ze);c.addEventListener(Xe,d),c.dispatchEvent(r),r.defaultPrevented||V(e??t.body,{select:!0}),c.removeEventListener(Xe,d),lt.remove(g)},0)}}},[c,u,d,g]);let _=b.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]=it(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&V(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&V(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,x.jsx)(v.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),$e=b.createContext(null);function et({registry:e,children:t}){return e?(0,x.jsx)($e.Provider,{value:e,children:t}):t}B(et,`FocusScopeBranchProvider`);function tt(){let[e,t]=b.useState([]);return{nodes:e,registry:b.useMemo(()=>({add:B(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:B(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}B(tt,`useFocusScopeBranchRegistry`);function nt(e){let t=b.useContext($e);b.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}B(nt,`useFocusScopeBranch`);function rt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(V(r,{select:t}),document.activeElement!==n)return}B(rt,`focusFirst`);function it(e){let t=at(e);return[ot(t,e),ot(t.reverse(),e)]}B(it,`getTabbableEdges`);function at(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:B(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},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}B(at,`getTabbableCandidates`);function ot(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):st(r,{upTo:t})))return r}B(ot,`findVisible`);function st(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}B(st,`isHidden`);function ct(e){return e.tagName===`INPUT`&&typeof e.select==`function`}B(ct,`isSelectableInput`);function V(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&ct(e)&&t&&e.select()}}B(V,`focus`);var lt=ut();function ut(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=dt(e,t),e.unshift(t)},remove(t){e=dt(e,t),e[0]?.resume()}}}B(ut,`createFocusScopesStack`);function dt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}B(dt,`arrayRemove`);function ft(e){return e.filter(e=>e.tagName!==`A`)}B(ft,`removeLinks`);var pt=e(c(),1),mt=Object.defineProperty,ht=b.forwardRef(((e,t)=>mt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=b.useState(!1);I(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pt.createPortal((0,x.jsx)(v.div,{...r,ref:t}),o):null},`Portal`)),gt=Object.defineProperty,H=(e,t)=>gt(e,`name`,{value:t,configurable:!0});function _t(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}H(_t,`useStateMachine`);var vt=H(e=>{let{present:t,children:n}=e,r=yt(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=xt(r.ref,St(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null},`Presence`);function yt(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),o=b.useRef(void 0),[s,c]=_t(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{s===`mounted`?(a.current=o.current??U(r.current),o.current=void 0):a.current=`none`},[s]),I(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=U(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),I(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=H(a=>{let o=U(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=H(e=>{e.target===t&&(a.current=U(r.current))},`handleAnimationStart`);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)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:b.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=U(t)}else r.current=null;n(e)},[])}}H(yt,`usePresence`);function bt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}H(bt,`setRef`);function xt(...e){let t=b.useRef(e);return t.current=e,b.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=bt(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():bt(n[e],null)}}},[])}H(xt,`useStableComposedRefs`);function U(e){return e?.animationName||`none`}H(U,`getAnimationName`);function St(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)}H(St,`getElementRef`);var Ct=Object.defineProperty,wt=(e,t)=>Ct(e,`name`,{value:t,configurable:!0}),Tt=0,Et=null;function Dt(e){return Ot(),e.children}wt(Dt,`FocusGuards`);function Ot(){b.useEffect(()=>{Et||={start:kt(),end:kt()};let{start:e,end:t}=Et;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Tt++,()=>{Tt===1&&(Et?.start.remove(),Et?.end.remove(),Et=null),Tt=Math.max(0,Tt-1)}},[])}wt(Ot,`useFocusGuards`);function kt(){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}wt(kt,`createFocusGuard`);var W=function(){return W=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},W.apply(this,arguments)};function At(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 jt(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 Mt=`right-scroll-bar-position`,Nt=`width-before-scroll-bar`,Pt=`with-scroll-bars-hidden`,Ft=`--removed-body-scroll-bar-size`;function It(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Lt(e,t){var n=(0,b.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 Rt=typeof window<`u`?b.useLayoutEffect:b.useEffect,zt=new WeakMap;function Bt(e,t){var n=Lt(t||null,function(t){return e.forEach(function(e){return It(e,t)})});return Rt(function(){var t=zt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||It(e,null)}),i.forEach(function(e){r.has(e)||It(e,a)})}zt.set(n,e)},[e]),n}function Vt(e){return e}function Ht(e,t){t===void 0&&(t=Vt);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 Ut(e){e===void 0&&(e={});var t=Ht(null);return t.options=W({async:!0,ssr:!1},e),t}var Wt=function(e){var t=e.sideCar,n=At(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 b.createElement(r,W({},n))};Wt.isSideCarExport=!0;function Gt(e,t){return e.useMedium(t),Wt}var Kt=Ut(),qt=function(){},Jt=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:qt,onWheelCapture:qt,onTouchMoveCapture:qt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,ee=At(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Bt([n,t]),C=W(W({},ee),i);return b.createElement(b.Fragment,null,u&&b.createElement(x,{sideCar:Kt,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?b.cloneElement(b.Children.only(s),W(W({},C),{ref:S})):b.createElement(v,W({},C,{className:c,ref:S}),s))});Jt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jt.classNames={fullWidth:Nt,zeroRight:Mt};var Yt=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Xt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Yt();return t&&e.setAttribute(`nonce`,t),e}function Zt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var $t=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xt())&&(Zt(t,n),Qt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},en=function(){var e=$t();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tn=function(){var e=en();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},nn={left:0,top:0,right:0,gap:0},rn=function(e){return parseInt(e||``,10)||0},an=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[rn(n),rn(r),rn(i)]},on=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return nn;var t=an(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])}},sn=tn(),cn=`data-scroll-locked`,ln=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
|
.${Pt} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -38,4 +38,4 @@ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Bt as t,Dt as n,Ot as
|
|
|
38
38
|
`},un=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},dn=function(){b.useEffect(function(){return document.body.setAttribute(cn,(un()+1).toString()),function(){var e=un()-1;e<=0?document.body.removeAttribute(cn):document.body.setAttribute(cn,e.toString())}},[])},fn=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;dn();var a=b.useMemo(function(){return on(i)},[i]);return b.createElement(sn,{styles:ln(a,!t,i,n?``:`!important`)})},pn=!1;if(typeof window<`u`)try{var mn=Object.defineProperty({},"passive",{get:function(){return pn=!0,!0}});window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var G=pn?{passive:!1}:!1,hn=function(e){return e.tagName===`TEXTAREA`},gn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!hn(e)&&n[t]===`visible`)},_n=function(e){return gn(e,`overflowY`)},vn=function(e){return gn(e,`overflowX`)},yn=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Sn(e,r)){var i=Cn(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},xn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Sn=function(e,t){return e===`v`?_n(t):vn(t)},Cn=function(e,t){return e===`v`?bn(t):xn(t)},wn=function(e,t){return e===`h`&&t===`rtl`?-1:1},Tn=function(e,t,n,r,i){var a=wn(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Cn(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Sn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},En=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dn=function(e){return[e.deltaX,e.deltaY]},On=function(e){return e&&`current`in e?e.current:e},kn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},An=function(e){return`
|
|
39
39
|
.block-interactivity-${e} {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},jn=0,K=[];function Mn(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(jn++)[0],a=b.useState(tn)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=jt([e.lockRef.current],(e.shards||[]).map(On),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=b.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=En(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=yn(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=yn(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Tn(h,t,e,h===`h`?s:c,!0)},[]),c=b.useCallback(function(e){var n=e;if(K.length&&K[K.length-1]===a){var r=`deltaY`in n?Dn(n):En(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&kn(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(On).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=b.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Nn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=b.useCallback(function(e){n.current=En(e),r.current=void 0},[]),d=b.useCallback(function(t){l(t.type,Dn(t),t.target,s(t,e.lockRef.current))},[]),f=b.useCallback(function(t){l(t.type,En(t),t.target,s(t,e.lockRef.current))},[]);b.useEffect(function(){return K.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,G),document.addEventListener(`touchmove`,c,G),document.addEventListener(`touchstart`,u,G),function(){K=K.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,G),document.removeEventListener(`touchmove`,c,G),document.removeEventListener(`touchstart`,u,G)}},[]);var p=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(a,{styles:An(i)}):null,p?b.createElement(fn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Nn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Pn=Gt(Kt,Mn),Fn=b.forwardRef(function(e,t){return b.createElement(Jt,W({},e,{ref:t,sideCar:Pn}))});Fn.classNames=Jt.classNames;var In=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},q=new WeakMap,Ln=new WeakMap,Rn={},zn=0,Bn=function(e){return e&&(e.host||Bn(e.parentNode))},Vn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Bn(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Hn=function(e,t,n,r){var i=Vn(t,Array.isArray(e)?e:[e]);Rn[n]||(Rn[n]=new WeakMap);var a=Rn[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(q.get(e)||0)+1,l=(a.get(e)||0)+1;q.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ln.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),zn++,function(){o.forEach(function(e){var t=q.get(e)-1,i=a.get(e)-1;q.set(e,t),a.set(e,i),t||(Ln.has(e)||e.removeAttribute(r),Ln.delete(e)),i||e.removeAttribute(n)}),zn--,zn||(q=new WeakMap,q=new WeakMap,Ln=new WeakMap,Rn={})}},Un=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||In(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Hn(r,i,n,`aria-hidden`)):function(){return null}},Wn=Object.defineProperty,J=(e,t)=>Wn(e,`name`,{value:t,configurable:!0}),Gn=`Dialog`,[Kn,qn]=pe(Gn),[Jn,Y]=Kn(Gn),Yn=J(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=b.useRef(null),c=b.useRef(null),{nodes:l,registry:u}=tt(),[d,f]=De({prop:r,defaultProp:i??!1,onChange:a,caller:Gn}),[p,m]=b.useState(0),[h,g]=b.useState(0);return(0,x.jsx)(Jn,{scope:t,triggerRef:s,contentRef:c,contentId:L(),titleId:L(),descriptionId:L(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Xn=`DialogPortal`,[Zn,Qn]=Kn(Xn,{forceMount:void 0}),$n=J(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Y(Xn,t);return(0,x.jsx)(Zn,{scope:t,forceMount:n,children:b.Children.map(r,e=>(0,x.jsx)(vt,{present:n||a.open,children:(0,x.jsx)(ht,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),er=`DialogOverlay`,tr=b.forwardRef(J(function(e,t){let n=Qn(er,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(er,e.__scopeDialog);return a.modal?(0,x.jsx)(vt,{present:r||a.open,children:(0,x.jsx)(rr,{...i,ref:t})}):null},`DialogOverlay`)),nr=m(`DialogOverlay.RemoveScroll`),rr=b.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=Y(er,n),a=He(),o=y(t,a);return(0,x.jsx)(Fn,{as:nr,allowPinchZoom:!0,shards:b.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,x.jsx)(v.div,{"data-state":ur(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ir=`DialogContent`,ar=b.forwardRef(J(function(e,t){let n=Qn(ir,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(ir,e.__scopeDialog);return(0,x.jsx)(vt,{present:r||a.open,children:a.modal?(0,x.jsx)(or,{...i,ref:t}):(0,x.jsx)(sr,{...i,ref:t})})},`DialogContent`)),or=b.forwardRef(J(function(e,t){let n=Y(ir,e.__scopeDialog),r=b.useRef(null),i=y(t,n.contentRef,r);return b.useEffect(()=>{let e=r.current;if(e)return Un(e)},[]),(0,x.jsx)(cr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:P(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:P(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),sr=b.forwardRef(J(function(e,t){let n=Y(ir,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return(0,x.jsx)(cr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),cr=b.forwardRef(J(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Y(ir,n);return Ot(),(0,x.jsx)(et,{registry:l.branchRegistry,children:(0,x.jsx)(Qe,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,x.jsx)(Ve,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?lr(o,l.descriptionId):o,"data-state":ur(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function lr(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}J(lr,`concatAriaDescribedby`);function ur(e){return e?`open`:`closed`}J(ur,`getState`);var dr=`[cmdk-group=""]`,fr=`[cmdk-group-items=""]`,pr=`[cmdk-group-heading=""]`,mr=`[cmdk-item=""]`,hr=`${mr}:not([aria-disabled="true"])`,gr=`cmdk-item-select`,X=`data-value`,_r=(e,t,n)=>ie(e,t,n),vr=b.createContext(void 0),yr=()=>b.useContext(vr),br=b.createContext(void 0),xr=()=>b.useContext(br),Sr=b.createContext(void 0),Cr=b.forwardRef((e,t)=>{let n=Fr(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Fr(()=>new Set),i=Fr(()=>new Map),a=Fr(()=>new Map),o=Fr(()=>new Set),s=Pr(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,y=L(),ee=L(),x=L(),S=b.useRef(null),C=Lr();Q(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),Q(()=>{C(6,te)},[]);let w=b.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=A()?.id,w.emit()}),r||C(5,te),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=b.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:ee,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??_r;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(fr);t?t.appendChild(e.parentElement===t?e:e.closest(`${fr} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${fr} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${dr}[${X}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(X);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function te(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(dr)?.querySelector(pr))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return S.current?.querySelector(`${mr}[aria-selected="true"]`)}function j(){return Array.from(S.current?.querySelectorAll(hr)||[])}function ne(e){let t=j()[e];t&&w.setState(`value`,t.getAttribute(X))}function M(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(X))}function re(e){let t=A()?.closest(dr),n;for(;t&&!n;)t=e>0?Mr(t,dr):Nr(t,dr),n=t?.querySelector(hr);n?w.setState(`value`,n.getAttribute(X)):M(e)}let ie=()=>ne(j().length-1),ae=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?re(1):M(1)},N=e=>{e.preventDefault(),e.metaKey?ne(0):e.altKey?re(-1):M(-1)};return b.createElement(v.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ae(e);break;case`ArrowDown`:ae(e);break;case`p`:case`k`:g&&e.ctrlKey&&N(e);break;case`ArrowUp`:N(e);break;case`Home`:e.preventDefault(),ne(0);break;case`End`:e.preventDefault(),ie();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(gr);t.dispatchEvent(e)}}}}},b.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Br},c),zr(e,e=>b.createElement(br.Provider,{value:w},b.createElement(vr.Provider,{value:T},e))))}),wr=b.forwardRef((e,t)=>{let n=L(),r=b.useRef(null),i=b.useContext(Sr),a=yr(),o=Pr(e),s=o.current?.forceMount??i?.forceMount;Q(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Ir(n,r,[e.value,e.children,r],e.keywords),l=xr(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);b.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(gr,f),()=>t.removeEventListener(gr,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:_,forceMount:y,keywords:ee,...x}=e;return b.createElement(v.div,{ref:g(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Tr=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=L(),s=b.useRef(null),c=b.useRef(null),l=L(),u=yr(),d=$(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Q(()=>u.group(o),[]),Ir(o,s,[e.value,e.heading,c]);let f=b.useMemo(()=>({id:o,forceMount:i}),[i]);return b.createElement(v.div,{ref:g(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&b.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),zr(e,e=>b.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},b.createElement(Sr.Provider,{value:f},e))))}),Er=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=b.useRef(null),a=$(e=>!e.search);return!n&&!a?null:b.createElement(v.div,{ref:g(i,t),...r,"cmdk-separator":``,role:`separator`})}),Dr=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=xr(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=yr();return b.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),b.createElement(v.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Or=b.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=b.useRef(null),o=b.useRef(null),s=$(e=>e.selectedItemId),c=yr();return b.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),b.createElement(v.div,{ref:g(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},zr(e,e=>b.createElement(`div`,{ref:g(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),kr=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return b.createElement(Yn,{open:n,onOpenChange:r},b.createElement($n,{container:o},b.createElement(tr,{"cmdk-overlay":``,className:i}),b.createElement(ar,{"aria-label":e.label,"cmdk-dialog":``,className:a},b.createElement(Cr,{ref:t,...s}))))}),Ar=b.forwardRef((e,t)=>$(e=>e.filtered.count===0)?b.createElement(v.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),jr=b.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return b.createElement(v.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zr(e,e=>b.createElement(`div`,{"aria-hidden":!0},e)))}),Z=Object.assign(Cr,{List:Or,Item:wr,Input:Dr,Group:Tr,Separator:Er,Dialog:kr,Empty:Ar,Loading:jr});function Mr(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nr(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pr(e){let t=b.useRef(e);return Q(()=>{t.current=e}),t}var Q=typeof window>`u`?b.useEffect:b.useLayoutEffect;function Fr(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=xr(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function Ir(e,t,n,r=[]){let i=b.useRef(),a=yr();return Q(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(X,s),i.current=s}),i}var Lr=()=>{let[e,t]=b.useState(),n=Fr(()=>new Map);return Q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Rr(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function zr({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(Rr(t),{ref:t.ref},n(t.props.children)):n(t)}var Br={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Vr=b.forwardRef(({className:e,...t},n)=>(0,x.jsx)(Z,{ref:n,className:u(`flex size-full flex-col overflow-hidden rounded-xl bg-card text-muted-foreground in-data-[slot=dialog-content]:bg-transparent`,e),...t}));Vr.displayName=Z.displayName;var Hr={default:`overflow-hidden py-0`,inset:`overflow-hidden sm:top-1/4 sm:translate-y-0 rounded-[calc(var(--radius-xl)+--spacing(1))] bg-muted p-1`},Ur={default:u(`[&_[data-slot=command-input-wrapper]_svg]:size-icon-lg`,`**:[[cmdk-input]]:h-12`,`[&_[cmdk-item]_svg]:size-icon-lg`),inset:u(`gap-1`,`[&_[data-slot=command-input-wrapper]_svg]:size-icon-md`,`**:[[cmdk-input]]:h-11 **:[[cmdk-input]]:text-label`,`[&_[cmdk-item]_svg]:size-icon-sm`,`**:[[cmdk-empty]]:px-4 **:[[cmdk-empty]]:pt-3 **:[[cmdk-empty]]:pb-1 **:[[cmdk-empty]]:text-left **:[[cmdk-empty]]:text-caption`)},Wr={default:`upper`,inset:`sentence`},Gr=b.createContext(`default`),Kr=({variant:e,footer:t,children:n})=>e==="default"?n:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{"data-slot":`command-dialog-panel`,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl bg-background`,children:n}),t&&(0,x.jsx)(`div`,{"data-slot":`command-dialog-footer`,className:`flex items-center justify-between gap-3 pr-1`,children:t})]}),qr=({children:e,variant:t=`default`,footer:a,title:s=`Command Palette`,description:c=`Search for commands and actions`,size:l,contentClassName:d,commandClassName:f,commandLabel:p,showOverlay:m=!1,overlayClassName:h,...g})=>{let _=b.useCallback((e,t)=>{let n=e.toLowerCase();return+!!t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))},[]),v=b.useCallback(e=>{e.key!==`Escape`&&e.stopPropagation()},[]);return(0,x.jsx)(i,{...g,children:(0,x.jsxs)(n,{size:l,showOverlay:m,showCloseButton:t!==`inset`,overlayClassName:h,className:u(Hr[t],d),children:[(0,x.jsx)(o,{className:`sr-only`,children:s}),(0,x.jsx)(r,{className:`sr-only`,children:c}),(0,x.jsx)(Vr,{label:p,loop:!0,filter:_,onKeyDown:v,"data-heading-case":Wr[t],className:u(`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-column **:[[cmdk-group-heading]]:text-muted-foreground`,`[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2`,`**:[[cmdk-item]]:p-2`,Ur[t],f),children:(0,x.jsx)(Gr.Provider,{value:t,children:(0,x.jsx)(Kr,{variant:t,footer:a,children:e})})})]})})},Jr=b.forwardRef(({className:e,rightSlot:t,wrapperClassName:n,...r},i)=>(0,x.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:u(`flex items-center border-b border-border px-3`,p.colors,n),children:[(0,x.jsx)(_,{className:u(`mr-2 size-icon-md shrink-0 text-muted-foreground`,p.colors)}),(0,x.jsx)(Z.Input,{ref:i,className:u(`flex h-8 min-w-0 flex-1 rounded-md bg-transparent py-2 text-body-sm zoom-safe-text text-foreground`,`placeholder:text-placeholder disabled:cursor-not-allowed disabled:opacity-50`,`outline-none focus:outline-none focus-visible:outline-none`,p.colors,e),...r,...ee}),t&&(0,x.jsx)(`div`,{"data-slot":`command-input-right-slot`,className:`ml-2 flex shrink-0 items-center text-muted-foreground`,children:t})]}));Jr.displayName=Z.Input.displayName;var Yr=b.forwardRef(({className:e,children:n,scrollArea:r=!1,scrollAreaClassName:i,scrollAreaViewportClassName:o,scrollAreaMask:s,...c},l)=>{let d=b.useContext(Gr)===`inset`,f=(0,x.jsx)(Z.List,{className:u(`outline-none focus:outline-none focus-visible:outline-none`,r?`overflow-visible`:`max-h-dropdown overflow-x-hidden overflow-y-auto`,d&&u(`h-(--cmdk-list-height)`,`transition-[height] duration-normal ease-out-custom motion-reduce:transition-none`),e),...c,ref:l,children:n});return r?(0,x.jsx)(t,{className:u(`min-h-0 scrollbar-inset-xl`,i),mask:s,children:(0,x.jsx)(a,{className:o,children:f})}):f});Yr.displayName=Z.List.displayName;var Xr=b.forwardRef((e,t)=>(0,x.jsx)(Z.Empty,{ref:t,className:`py-6 text-center text-body-sm text-muted-foreground`,...e}));Xr.displayName=Z.Empty.displayName;var Zr=b.forwardRef(({className:e,...t},n)=>(0,x.jsx)(Z.Group,{ref:n,className:u(`overflow-hidden p-1 text-muted-foreground`,`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:text-muted-foreground`,`[&_[cmdk-group-heading]]:text-meta [&_[cmdk-group-heading]]:uppercase`,`in-data-[heading-case=sentence]:**:[[cmdk-group-heading]]:tracking-normal in-data-[heading-case=sentence]:**:[[cmdk-group-heading]]:normal-case`,e),...t}));Zr.displayName=Z.Group.displayName;var Qr=b.forwardRef(({className:e,...t},n)=>(0,x.jsx)(Z.Separator,{ref:n,className:u(`-mx-1 h-px bg-border`,e),...t}));Qr.displayName=Z.Separator.displayName;var $r=b.forwardRef(({className:e,...t},n)=>(0,x.jsx)(Z.Item,{ref:n,className:u(`relative flex cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-body-sm text-muted-foreground select-none`,`outline-none focus:outline-none focus-visible:outline-none`,`data-[selected=true]:bg-fill data-[selected=true]:text-foreground`,`data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`,`[&_svg]:pointer-events-none [&>svg]:size-icon-md [&>svg]:shrink-0`,s,`[--control-icon-hover:var(--foreground)] data-[selected=true]:[--control-icon:var(--control-icon-hover)]`,e),...t}));$r.displayName=Z.Item.displayName;var ei=({className:e,...t})=>(0,x.jsx)(f,{as:`span`,variant:`meta`,tone:`muted`,className:u(`ml-auto tracking-wider tabular-nums`,e),...t});ei.displayName=`CommandShortcut`;export{Jr as a,Qr as c,Zr as i,ei as l,qr as n,$r as o,Xr as r,Yr as s,Vr as t};
|
|
41
|
+
`},jn=0,K=[];function Mn(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(jn++)[0],a=b.useState(tn)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=jt([e.lockRef.current],(e.shards||[]).map(On),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=b.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=En(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=yn(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=yn(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Tn(h,t,e,h===`h`?s:c,!0)},[]),c=b.useCallback(function(e){var n=e;if(K.length&&K[K.length-1]===a){var r=`deltaY`in n?Dn(n):En(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&kn(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(On).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=b.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Nn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=b.useCallback(function(e){n.current=En(e),r.current=void 0},[]),d=b.useCallback(function(t){l(t.type,Dn(t),t.target,s(t,e.lockRef.current))},[]),f=b.useCallback(function(t){l(t.type,En(t),t.target,s(t,e.lockRef.current))},[]);b.useEffect(function(){return K.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,G),document.addEventListener(`touchmove`,c,G),document.addEventListener(`touchstart`,u,G),function(){K=K.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,G),document.removeEventListener(`touchmove`,c,G),document.removeEventListener(`touchstart`,u,G)}},[]);var p=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(a,{styles:An(i)}):null,p?b.createElement(fn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Nn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Pn=Gt(Kt,Mn),Fn=b.forwardRef(function(e,t){return b.createElement(Jt,W({},e,{ref:t,sideCar:Pn}))});Fn.classNames=Jt.classNames;var In=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},q=new WeakMap,Ln=new WeakMap,Rn={},zn=0,Bn=function(e){return e&&(e.host||Bn(e.parentNode))},Vn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Bn(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Hn=function(e,t,n,r){var i=Vn(t,Array.isArray(e)?e:[e]);Rn[n]||(Rn[n]=new WeakMap);var a=Rn[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(q.get(e)||0)+1,l=(a.get(e)||0)+1;q.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ln.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),zn++,function(){o.forEach(function(e){var t=q.get(e)-1,i=a.get(e)-1;q.set(e,t),a.set(e,i),t||(Ln.has(e)||e.removeAttribute(r),Ln.delete(e)),i||e.removeAttribute(n)}),zn--,zn||(q=new WeakMap,q=new WeakMap,Ln=new WeakMap,Rn={})}},Un=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||In(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Hn(r,i,n,`aria-hidden`)):function(){return null}},Wn=Object.defineProperty,J=(e,t)=>Wn(e,`name`,{value:t,configurable:!0}),Gn=`Dialog`,[Kn,qn]=pe(Gn),[Jn,Y]=Kn(Gn),Yn=J(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=b.useRef(null),c=b.useRef(null),{nodes:l,registry:u}=tt(),[d,f]=De({prop:r,defaultProp:i??!1,onChange:a,caller:Gn}),[p,m]=b.useState(0),[h,g]=b.useState(0);return(0,x.jsx)(Jn,{scope:t,triggerRef:s,contentRef:c,contentId:L(),titleId:L(),descriptionId:L(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Xn=`DialogPortal`,[Zn,Qn]=Kn(Xn,{forceMount:void 0}),$n=J(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Y(Xn,t);return(0,x.jsx)(Zn,{scope:t,forceMount:n,children:b.Children.map(r,e=>(0,x.jsx)(vt,{present:n||a.open,children:(0,x.jsx)(ht,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),er=`DialogOverlay`,tr=b.forwardRef(J(function(e,t){let n=Qn(er,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(er,e.__scopeDialog);return a.modal?(0,x.jsx)(vt,{present:r||a.open,children:(0,x.jsx)(rr,{...i,ref:t})}):null},`DialogOverlay`)),nr=m(`DialogOverlay.RemoveScroll`),rr=b.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=Y(er,n),a=He(),o=y(t,a);return(0,x.jsx)(Fn,{as:nr,allowPinchZoom:!0,shards:b.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,x.jsx)(v.div,{"data-state":ur(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ir=`DialogContent`,ar=b.forwardRef(J(function(e,t){let n=Qn(ir,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(ir,e.__scopeDialog);return(0,x.jsx)(vt,{present:r||a.open,children:a.modal?(0,x.jsx)(or,{...i,ref:t}):(0,x.jsx)(sr,{...i,ref:t})})},`DialogContent`)),or=b.forwardRef(J(function(e,t){let n=Y(ir,e.__scopeDialog),r=b.useRef(null),i=y(t,n.contentRef,r);return b.useEffect(()=>{let e=r.current;if(e)return Un(e)},[]),(0,x.jsx)(cr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:P(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:P(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),sr=b.forwardRef(J(function(e,t){let n=Y(ir,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return(0,x.jsx)(cr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),cr=b.forwardRef(J(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Y(ir,n);return Ot(),(0,x.jsx)(et,{registry:l.branchRegistry,children:(0,x.jsx)(Qe,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,x.jsx)(Ve,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?lr(o,l.descriptionId):o,"data-state":ur(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function lr(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}J(lr,`concatAriaDescribedby`);function ur(e){return e?`open`:`closed`}J(ur,`getState`);var dr=`[cmdk-group=""]`,fr=`[cmdk-group-items=""]`,pr=`[cmdk-group-heading=""]`,mr=`[cmdk-item=""]`,hr=`${mr}:not([aria-disabled="true"])`,gr=`cmdk-item-select`,X=`data-value`,_r=(e,t,n)=>ie(e,t,n),vr=b.createContext(void 0),yr=()=>b.useContext(vr),br=b.createContext(void 0),xr=()=>b.useContext(br),Sr=b.createContext(void 0),Cr=b.forwardRef((e,t)=>{let n=Fr(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Fr(()=>new Set),i=Fr(()=>new Map),a=Fr(()=>new Map),o=Fr(()=>new Set),s=Pr(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,y=L(),ee=L(),x=L(),S=b.useRef(null),C=Lr();Q(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),Q(()=>{C(6,te)},[]);let w=b.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=A()?.id,w.emit()}),r||C(5,te),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=b.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:ee,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??_r;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(fr);t?t.appendChild(e.parentElement===t?e:e.closest(`${fr} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${fr} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${dr}[${X}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(X);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function te(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(dr)?.querySelector(pr))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return S.current?.querySelector(`${mr}[aria-selected="true"]`)}function j(){return Array.from(S.current?.querySelectorAll(hr)||[])}function ne(e){let t=j()[e];t&&w.setState(`value`,t.getAttribute(X))}function M(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(X))}function re(e){let t=A()?.closest(dr),n;for(;t&&!n;)t=e>0?Mr(t,dr):Nr(t,dr),n=t?.querySelector(hr);n?w.setState(`value`,n.getAttribute(X)):M(e)}let ie=()=>ne(j().length-1),ae=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?re(1):M(1)},N=e=>{e.preventDefault(),e.metaKey?ne(0):e.altKey?re(-1):M(-1)};return b.createElement(v.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ae(e);break;case`ArrowDown`:ae(e);break;case`p`:case`k`:g&&e.ctrlKey&&N(e);break;case`ArrowUp`:N(e);break;case`Home`:e.preventDefault(),ne(0);break;case`End`:e.preventDefault(),ie();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(gr);t.dispatchEvent(e)}}}}},b.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Br},c),zr(e,e=>b.createElement(br.Provider,{value:w},b.createElement(vr.Provider,{value:T},e))))}),wr=b.forwardRef((e,t)=>{let n=L(),r=b.useRef(null),i=b.useContext(Sr),a=yr(),o=Pr(e),s=o.current?.forceMount??i?.forceMount;Q(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Ir(n,r,[e.value,e.children,r],e.keywords),l=xr(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);b.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(gr,f),()=>t.removeEventListener(gr,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:y,keywords:ee,...x}=e;return b.createElement(v.div,{ref:_(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Tr=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=L(),s=b.useRef(null),c=b.useRef(null),l=L(),u=yr(),d=$(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Q(()=>u.group(o),[]),Ir(o,s,[e.value,e.heading,c]);let f=b.useMemo(()=>({id:o,forceMount:i}),[i]);return b.createElement(v.div,{ref:_(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&b.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),zr(e,e=>b.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},b.createElement(Sr.Provider,{value:f},e))))}),Er=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=b.useRef(null),a=$(e=>!e.search);return!n&&!a?null:b.createElement(v.div,{ref:_(i,t),...r,"cmdk-separator":``,role:`separator`})}),Dr=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=xr(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=yr();return b.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),b.createElement(v.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Or=b.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=b.useRef(null),o=b.useRef(null),s=$(e=>e.selectedItemId),c=yr();return b.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),b.createElement(v.div,{ref:_(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},zr(e,e=>b.createElement(`div`,{ref:_(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),kr=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return b.createElement(Yn,{open:n,onOpenChange:r},b.createElement($n,{container:o},b.createElement(tr,{"cmdk-overlay":``,className:i}),b.createElement(ar,{"aria-label":e.label,"cmdk-dialog":``,className:a},b.createElement(Cr,{ref:t,...s}))))}),Ar=b.forwardRef((e,t)=>$(e=>e.filtered.count===0)?b.createElement(v.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),jr=b.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return b.createElement(v.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zr(e,e=>b.createElement(`div`,{"aria-hidden":!0},e)))}),Z=Object.assign(Cr,{List:Or,Item:wr,Input:Dr,Group:Tr,Separator:Er,Dialog:kr,Empty:Ar,Loading:jr});function Mr(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nr(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pr(e){let t=b.useRef(e);return Q(()=>{t.current=e}),t}var Q=typeof window>`u`?b.useEffect:b.useLayoutEffect;function Fr(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=xr(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function Ir(e,t,n,r=[]){let i=b.useRef(),a=yr();return Q(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(X,s),i.current=s}),i}var Lr=()=>{let[e,t]=b.useState(),n=Fr(()=>new Map);return Q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Rr(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function zr({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(Rr(t),{ref:t.ref},n(t.props.children)):n(t)}var Br={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Vr=b.forwardRef(({className:e,...t},n)=>(0,x.jsx)(Z,{ref:n,className:u(`flex size-full flex-col overflow-hidden rounded-xl bg-card text-muted-foreground in-data-[slot=dialog-content]:bg-transparent`,e),...t}));Vr.displayName=Z.displayName;var Hr={default:`overflow-hidden py-0`,inset:`overflow-hidden sm:top-1/4 sm:translate-y-0 rounded-[calc(var(--radius-xl)+--spacing(1))] bg-muted p-1`},Ur={default:u(`[&_[data-slot=command-input-wrapper]_svg]:size-icon-lg`,`**:[[cmdk-input]]:h-12`,`[&_[cmdk-item]_svg]:size-icon-lg`),inset:u(`gap-1`,`[&_[data-slot=command-input-wrapper]_svg]:size-icon-md`,`**:[[cmdk-input]]:h-11 **:[[cmdk-input]]:text-label`,`[&_[cmdk-item]_svg]:size-icon-sm`,`**:[[cmdk-empty]]:px-4 **:[[cmdk-empty]]:pt-3 **:[[cmdk-empty]]:pb-1 **:[[cmdk-empty]]:text-left **:[[cmdk-empty]]:text-caption`)},Wr={default:`upper`,inset:`sentence`},Gr=b.createContext(`default`),Kr=({variant:e,footer:t,children:n})=>e==="default"?n:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{"data-slot":`command-dialog-panel`,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl bg-background`,children:n}),t&&(0,x.jsx)(`div`,{"data-slot":`command-dialog-footer`,className:`flex items-center justify-between gap-3 pr-1`,children:t})]}),qr=({children:e,variant:t=`default`,footer:a,title:o=`Command Palette`,description:c=`Search for commands and actions`,size:l,contentClassName:d,commandClassName:f,commandLabel:p,showOverlay:m=!1,overlayClassName:h,...g})=>{let _=b.useCallback((e,t)=>{let n=e.toLowerCase();return+!!t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))},[]),v=b.useCallback(e=>{e.key!==`Escape`&&e.stopPropagation()},[]);return(0,x.jsx)(i,{...g,children:(0,x.jsxs)(n,{size:l,showOverlay:m,showCloseButton:t!==`inset`,overlayClassName:h,className:u(Hr[t],d),children:[(0,x.jsx)(s,{className:`sr-only`,children:o}),(0,x.jsx)(r,{className:`sr-only`,children:c}),(0,x.jsx)(Vr,{label:p,loop:!0,filter:_,onKeyDown:v,"data-heading-case":Wr[t],className:u(`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-column **:[[cmdk-group-heading]]:text-muted-foreground`,`[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2`,`**:[[cmdk-item]]:p-2`,Ur[t],f),children:(0,x.jsx)(Gr.Provider,{value:t,children:(0,x.jsx)(Kr,{variant:t,footer:a,children:e})})})]})})},Jr=b.forwardRef(({className:e,rightSlot:t,wrapperClassName:n,...r},i)=>(0,x.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:u(`flex items-center border-b border-border px-3`,p.colors,n),children:[(0,x.jsx)(g,{className:u(`mr-2 size-icon-md shrink-0 text-muted-foreground`,p.colors)}),(0,x.jsx)(Z.Input,{ref:i,className:u(`flex h-8 min-w-0 flex-1 rounded-md bg-transparent py-2 text-body-sm zoom-safe-text text-foreground`,`placeholder:text-placeholder disabled:cursor-not-allowed disabled:opacity-50`,`outline-none focus:outline-none focus-visible:outline-none`,p.colors,e),...r,...ee}),t&&(0,x.jsx)(`div`,{"data-slot":`command-input-right-slot`,className:`ml-2 flex shrink-0 items-center text-muted-foreground`,children:t})]}));Jr.displayName=Z.Input.displayName;var Yr=b.forwardRef(({className:e,children:n,scrollArea:r=!1,scrollAreaClassName:i,scrollAreaViewportClassName:o,scrollAreaMask:s,...c},l)=>{let d=b.useContext(Gr)===`inset`,f=(0,x.jsx)(Z.List,{className:u(`outline-none focus:outline-none focus-visible:outline-none`,r?`overflow-visible`:`max-h-dropdown overflow-x-hidden overflow-y-auto`,d&&u(`h-(--cmdk-list-height)`,`transition-[height] duration-normal ease-out-custom motion-reduce:transition-none`),e),...c,ref:l,children:n});return r?(0,x.jsx)(t,{className:u(`min-h-0 scrollbar-inset-xl`,i),mask:s,children:(0,x.jsx)(a,{className:o,children:f})}):f});Yr.displayName=Z.List.displayName;var Xr=b.forwardRef((e,t)=>(0,x.jsx)(Z.Empty,{ref:t,className:`py-6 text-center text-body-sm text-muted-foreground`,...e}));Xr.displayName=Z.Empty.displayName;var Zr=b.forwardRef(({className:e,...t},n)=>(0,x.jsx)(Z.Group,{ref:n,className:u(`overflow-hidden p-1 text-muted-foreground`,`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:text-muted-foreground`,`[&_[cmdk-group-heading]]:text-meta [&_[cmdk-group-heading]]:uppercase`,`in-data-[heading-case=sentence]:**:[[cmdk-group-heading]]:tracking-normal in-data-[heading-case=sentence]:**:[[cmdk-group-heading]]:normal-case`,e),...t}));Zr.displayName=Z.Group.displayName;var Qr=b.forwardRef(({className:e,...t},n)=>(0,x.jsx)(Z.Separator,{ref:n,className:u(`-mx-1 h-px bg-border`,e),...t}));Qr.displayName=Z.Separator.displayName;var $r=b.forwardRef(({className:e,...t},n)=>(0,x.jsx)(Z.Item,{ref:n,className:u(`relative flex cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-body-sm text-muted-foreground select-none`,`outline-none focus:outline-none focus-visible:outline-none`,`data-[selected=true]:bg-fill data-[selected=true]:text-foreground`,`data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`,`[&_svg]:pointer-events-none [&>svg]:size-icon-md [&>svg]:shrink-0`,o,`[--control-icon-hover:var(--foreground)] data-[selected=true]:[--control-icon:var(--control-icon-hover)]`,e),...t}));$r.displayName=Z.Item.displayName;var ei=({className:e,...t})=>(0,x.jsx)(f,{as:`span`,variant:`meta`,tone:`muted`,className:u(`ml-auto tracking-wider tabular-nums`,e),...t});ei.displayName=`CommandShortcut`;export{Jr as a,Qr as c,Zr as i,ei as l,qr as n,$r as o,Xr as r,Yr as s,Vr as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{O as t,T as n,b as r,k as i,m as a,u as o,x as s,y as c}from"./IconChevronRightMedium.es-BjSIsine.js";import{di as l}from"./GithubIcon.es-B1lB1Q-8.js";import{pt as u}from"./useSessionRows-aTHnrKGG.js";var d=t(),f={default:`h-6 min-w-6 rounded-md px-1.5 text-caption`,sm:`h-5 min-w-5 rounded-md px-1 text-meta`,xs:`h-4 min-w-4 rounded px-1 text-meta leading-none`},p=({children:e,size:t=`default`,className:r})=>(0,d.jsx)(`kbd`,{className:n(`inline-flex items-center justify-center bg-card font-mono text-foreground shadow-raised`,f[t],o.transform,`active:scale-95 active:shadow-none`,r),children:(0,d.jsx)(`span`,{className:`[text-box:trim-both_cap_alphabetic]`,children:e})}),m=e(i(),1),h=2e3;function g(){let[e]=(0,m.useState)(()=>typeof performance>`u`?`0ms`:`${-Math.round(performance.now()%h)}ms`);return e}function _({className:e,style:t,...r}){let i=g();return(0,d.jsx)(`div`,{className:n(`relative overflow-hidden rounded-md bg-muted`,`before:absolute before:inset-0`,`before:-translate-x-full`,`before:animate-[shimmer_2s_infinite] before:[animation-delay:var(--shimmer-delay)]`,`before:bg-linear-to-r before:from-transparent before:via-fill-subtle before:to-transparent`,e),style:{"--shimmer-delay":i,...t},...r})}function v({line:e=`text-body-sm`,className:t}){return(0,d.jsxs)(`span`,{className:n(`flex items-center`,e),children:[(0,d.jsx)(`span`,{"aria-hidden":!0,children:``}),(0,d.jsx)(_,{className:n(`h-3.5`,t)})]})}function y(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=l(),{ref:i,index:a}=u(e),o=n===a,s=m.useRef(null),d=c(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:d,index:a}}function b(e){let{render:t,className:n,style:i,state:o=s,props:c=r,refs:l=r,metadata:u,stateAttributesMapping:d,tag:f=`div`,...p}=e,{compositeProps:m,compositeRef:h}=y({metadata:u});return a(f,e,{state:o,ref:[h,...l],props:[m,...c,p],stateAttributesMapping:d})}export{p as a,v as i,y as n,_ as r,b as t};
|