mastra 1.40.0-alpha.7 → 1.40.1-alpha.0
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-D8KrNZz7.js +1 -0
- package/dist/factory/assets/BoardConfigPage-BMQgJK7P.js +1 -0
- package/dist/factory/assets/{BoardIcons-Dl09bTFD.js → BoardIcons-GeX8LFoy.js} +1 -1
- package/dist/factory/assets/BoardIntakePage-BBn80ZX6.js +1 -0
- package/dist/factory/assets/BoardRulesPage-CTZfGx2i.js +1 -0
- package/dist/factory/assets/Breadcrumb.es-0R_XL00x.js +1 -0
- package/dist/factory/assets/CodeBlock.es-DIA2ZrN9.js +6 -0
- package/dist/factory/assets/{CodeEditor-AaW7HgY9-BnB7l8h1.js → CodeEditor-AaW7HgY9-D5UgwB1I.js} +2 -2
- package/dist/factory/assets/Command.es-CaAQo3gp.js +41 -0
- package/dist/factory/assets/CompositeRoot-Cd7voRpR.js +1 -0
- package/dist/factory/assets/ConditionRows-BLnr6YQo.js +1 -0
- package/dist/factory/assets/CreateFactoryPage-DHxyLJKF.js +1 -0
- package/dist/factory/assets/{EmptyState-juw2jci2-vYAzd7Mx.js → EmptyState-juw2jci2-PoiXi1p2.js} +1 -1
- package/dist/factory/assets/FactorySkillEditorDialog-DlBPPSo-.js +2 -0
- package/dist/factory/assets/FactorySkillsPage-BRUXU731.js +1 -0
- package/dist/factory/assets/Field.es-d1x5qTVA.js +1 -0
- package/dist/factory/assets/{GithubIcon.es-C-Qgy6Nz.js → GithubIcon.es-DGJTTitG.js} +1 -1
- package/dist/factory/assets/{GoogleIcon.es-DaB2fAWt.js → GoogleIcon.es-DhsJaQu2.js} +1 -1
- package/dist/factory/assets/{IconSquareArrowTopRight.es-CstF1Gs-.js → IconArrowRight.es-DuFf2QTx.js} +1 -1
- package/dist/factory/assets/IconArrowRotateClockwise.es-Cm6rlHHq.js +1 -0
- package/dist/factory/assets/{IconArrowRotateCounterClockwise.es-Dh2-X4dK.js → IconArrowRotateCounterClockwise.es-DwgpnNS1.js} +1 -1
- package/dist/factory/assets/{IconBuildings.es-CqWpyuuU.js → IconBuildings.es-s5AevMJE.js} +1 -1
- package/dist/factory/assets/{IconChainLink3.es-DUjrTyX2.js → IconChainLink3.es-CNFznS2g.js} +1 -1
- package/dist/factory/assets/{IconChevronRightMedium.es-DYcwXRfK.js → IconChevronRightMedium.es-BjSIsine.js} +1 -1
- package/dist/factory/assets/{IconCircleCheck.es-jA-dYNOs.js → IconCircleCheck.es-e9o_0ikv.js} +1 -1
- package/dist/factory/assets/{IconCircleDashed.es-D4bTM6rC.js → IconCircleDashed.es-Chw6BTXK.js} +1 -1
- package/dist/factory/assets/{IconCircleX.es-12HbcyCF.js → IconCircleX.es-3P8aywDS.js} +1 -1
- package/dist/factory/assets/{IconClipboard2.es-DIRDjMMg.js → IconClipboard2.es-yelKDvfv.js} +1 -1
- package/dist/factory/assets/{IconCodeBrackets.es-BUWa-ptB.js → IconCodeBrackets.es-o1byTuto.js} +1 -1
- package/dist/factory/assets/IconFileBend.es-2E9_cK4k.js +1 -0
- package/dist/factory/assets/IconFormCircle.es-ChAKhSV4.js +1 -0
- package/dist/factory/assets/{IconHashtag.es-D4hsTU7s.js → IconHashtag.es-DPNqJOUe.js} +1 -1
- package/dist/factory/assets/{IconKanbanView.es-BtcFTA_e.js → IconKanbanView.es-CsviBYCf.js} +1 -1
- package/dist/factory/assets/{IconKey2.es-D_4k_Y2E.js → IconKey2.es-BpH7t1TL.js} +1 -1
- package/dist/factory/assets/{IconLock.es-0eb6hipg.js → IconLock.es-9mYeLe9c.js} +1 -1
- package/dist/factory/assets/{IconMerged.es-yVyZYELD.js → IconMerged.es-BudaK6HC.js} +1 -1
- package/dist/factory/assets/{IconMinusMedium.es-CnyT8q0-.js → IconMinusMedium.es-Dd0yb_Wf.js} +1 -1
- package/dist/factory/assets/IconPlugin1.es-jS0AvWmJ.js +1 -0
- package/dist/factory/assets/{IconPlusMedium.es-BtoCFPCD.js → IconPlusMedium.es-QmObHPf-.js} +1 -1
- package/dist/factory/assets/IconRobot.es-CunHAP4r.js +1 -0
- package/dist/factory/assets/IconScript.es-a9mwy7SP.js +1 -0
- package/dist/factory/assets/{IconServer.es-HIB-2FYM.js → IconServer.es-ZVlwcZAW.js} +1 -1
- package/dist/factory/assets/{IconShieldCheck.es-B3i3R9pw.js → IconShieldCheck.es-vPJGxBAr.js} +1 -1
- package/dist/factory/assets/IconSquareArrowTopRight.es-C-xkvcAK.js +1 -0
- package/dist/factory/assets/{IconUser.es-BEU0-Pi9.js → IconUser.es-8QnHQfy-.js} +1 -1
- package/dist/factory/assets/{IconUserDuo.es-BDaCO0PB.js → IconUserDuo.es-X0H45vYw.js} +1 -1
- package/dist/factory/assets/Input-GRxVYRHs.js +1 -0
- package/dist/factory/assets/InputNumber.es-ZjvkV_5N.js +1 -0
- package/dist/factory/assets/IntakeTesterDialog-BPuhOvLO.js +1 -0
- package/dist/factory/assets/KnowledgePage-BnfuKNZN.js +13 -0
- package/dist/factory/assets/KnowledgePageCard.es-CevF12s3.js +1 -0
- package/dist/factory/assets/{LinearIcon.es-T8POvXAB.js → LinearIcon.es-BnTumr4a.js} +1 -1
- package/dist/factory/assets/LoadErrorState-CncA9Y9V.js +1 -0
- package/dist/factory/assets/{Logo.es-DqYFa-ke.js → Logo.es-Cc55x-sI.js} +1 -1
- package/dist/factory/assets/{MarkdownRenderer-De9m5Xru-Bc4g8gee.js → MarkdownRenderer-De9m5Xru-CU6hU8ni.js} +5 -5
- package/dist/factory/assets/MastraGatewayBilling-D51sja_t.js +1 -0
- package/dist/factory/assets/NewBoardPage-BRjXBWCA.js +2 -0
- package/dist/factory/assets/NewPage-Dvv1BaOV.js +1 -0
- package/dist/factory/assets/{useFactories-BFdgddvm.css → Notice-BhWgws6f-CAFdTOs1.css} +1 -1
- package/dist/factory/assets/Notice-BhWgws6f-u2XtThO4.js +55 -0
- package/dist/factory/assets/OnboardingPage-D6H_QFFe.js +1 -0
- package/dist/factory/assets/ProviderBrandIcon-D5YcK4cE.js +1 -0
- package/dist/factory/assets/RadioGroup-BduaxE1J.js +1 -0
- package/dist/factory/assets/RadioGroup.es-BEydfTFj.js +1 -0
- package/dist/factory/assets/RootGuards-CDegjqQE.js +1 -0
- package/dist/factory/assets/RulesPage-g0vWRSBj.js +1 -0
- package/dist/factory/assets/SearchInput.es-CgoNIy1r.js +1 -0
- package/dist/factory/assets/SessionLayout-bRgWECE7.js +4 -0
- package/dist/factory/assets/SessionPage-B1I0OxKe.js +1 -0
- package/dist/factory/assets/SessionSharingPopover-DejsTjUO.js +1 -0
- package/dist/factory/assets/SettingsPage-CRvUszI6.js +3 -0
- package/dist/factory/assets/{SettingsSubsection-C2fAPAzC.js → SettingsSubsection-twCTDNkb.js} +1 -1
- package/dist/factory/assets/Sidebar.es-Bx7dX5pc.js +1 -0
- package/dist/factory/assets/SignInPage-XZ0Qydb7.js +1 -0
- package/dist/factory/assets/SlackConnectionPage-Clz6ivuE.js +1 -0
- package/dist/factory/assets/{SlackIcon.es-Cv7DDqNk.js → SlackIcon.es-DCRKrg7l.js} +1 -1
- package/dist/factory/assets/{StackedDiffs-YCj-4sk5.js → StackedDiffs-yHdFpStX.js} +3 -3
- package/dist/factory/assets/ThinkingLevel.es-BdPld2LD.js +1 -0
- package/dist/factory/assets/Tree-B90XgTY4-DPnOW3Dy.js +1 -0
- package/dist/factory/assets/board-events-DtlmhUQw.js +1 -0
- package/dist/factory/assets/buttons-group-DA_wORqQ-B46Ux5ij.js +1 -0
- package/dist/factory/assets/conditionFields-CYADwcOD.js +1 -0
- package/dist/factory/assets/copy-button-5PzdvEQI-C3QsjfYO.js +1 -0
- package/dist/factory/assets/{createLucideIcon-4HMWrBkV.js → createLucideIcon-B6gALBEh.js} +1 -1
- package/dist/factory/assets/factory-C3HQqacx.js +1 -0
- package/dist/factory/assets/icons-CXrIuTze.js +1 -0
- package/dist/factory/assets/index-CB_NT3wo.css +1 -0
- package/dist/factory/assets/index-CXm1OtvB.js +125 -0
- package/dist/factory/assets/{index.module-CCSPmtYt.js → index.module-D3qeux6j.js} +1 -1
- package/dist/factory/assets/input-DqReKX0A-Ds0Cl3d5.js +3 -0
- package/dist/factory/assets/input-group-CXvse9n7-D6QhMivi.js +1 -0
- package/dist/factory/assets/lib-Z1TxHc5t.js +1 -0
- package/dist/factory/assets/onboardingFlow-cRdUNLZm.js +1 -0
- package/dist/factory/assets/page-header-Maytcmgh--oRyXaDt.js +1 -0
- package/dist/factory/assets/{relativeTime-COInfnNf.js → relativeTime-CYXFEmQ_.js} +1 -1
- package/dist/factory/assets/request-D-8hZhxi.js +1 -0
- package/dist/factory/assets/{selection-control.es-D5jpS2-4.js → selection-control.es-B9lRtuFy.js} +1 -1
- package/dist/factory/assets/settings-B7RMGKgf-GYIOMjOV.js +1 -0
- package/dist/factory/assets/{settingsSections-Cijt0lNE.js → settingsSections-B0_LEh3l.js} +1 -1
- package/dist/factory/assets/spinner-B9ykw74u-DQPO5dzO.js +1 -0
- package/dist/factory/assets/use-isomorphic-layout-effect.es-BlwNoFb0.js +1 -0
- package/dist/factory/assets/useBoardCatalog-oA5VpTLX.js +1 -0
- package/dist/factory/assets/useBoardEditor-C9-FvIWD.js +1 -0
- package/dist/factory/assets/useChatSessionContext-BwIjL0RB.js +1 -0
- package/dist/factory/assets/{useDocumentVisible-Dd6jUYuM.js → useDocumentVisible-b4XBg6N4.js} +1 -1
- package/dist/factory/assets/useDraftModelGuards-DvoV_Eqr.js +29 -0
- package/dist/factory/assets/useFactoryDecisions-CYLYQYZ3.js +1 -0
- package/dist/factory/assets/useGlobalSearchControls-CrQqx-bq.js +1 -0
- package/dist/factory/assets/useInfiniteQuery-D0s8t4mK.js +1 -0
- package/dist/factory/assets/useRouteSessionId-Ikq8FwIr.js +1 -0
- package/dist/factory/assets/useSessionCard-cckqW4-P.js +1 -0
- package/dist/factory/assets/useSessionRepository-BGURs41Z.js +1 -0
- package/dist/factory/assets/useSessionRows-CBR4HSqT.js +1 -0
- package/dist/factory/assets/useThreadWorkspacePath-CVUMjcpv.js +1 -0
- package/dist/factory/assets/workspaces-D7gLNExW.js +2 -0
- package/dist/factory/index.html +65 -68
- package/dist/index.js +1 -1
- package/dist/studio/assets/{index-BcC2uhYF.js → index-DzQW0EuW.js} +2 -2
- package/dist/studio/assets/{main-CPzKOMaf.js → main-DxjtVe-P.js} +63 -63
- package/dist/studio/assets/style-ivTe6uHs.css +3 -0
- package/dist/studio/index.html +2 -2
- package/package.json +7 -7
- package/dist/factory/assets/AlertDialog.es-egsOmf9n.js +0 -1
- package/dist/factory/assets/BoardConfigPage-DrCdd_2V.js +0 -1
- package/dist/factory/assets/BoardIntakePage-DMBi-b3G.js +0 -1
- package/dist/factory/assets/BoardRulesPage-9sB-UCQh.js +0 -1
- package/dist/factory/assets/Breadcrumb.es-C-OUf9fG.js +0 -1
- package/dist/factory/assets/CardDraftPage-DgW17bAo.js +0 -1
- package/dist/factory/assets/CardStageBar-Ds3fg0oY.js +0 -1
- package/dist/factory/assets/CodeBlock.es-1tCbak3S.js +0 -6
- package/dist/factory/assets/Command.es-iW1Xpe0O.js +0 -41
- package/dist/factory/assets/CompositeRoot-CGtydpaf.js +0 -1
- package/dist/factory/assets/ConditionRows-EFziHxkU.js +0 -1
- package/dist/factory/assets/CreateFactoryPage-CCBRJtu9.js +0 -1
- package/dist/factory/assets/FactorySkillEditorDialog-rqcN4Lte.js +0 -2
- package/dist/factory/assets/FactorySkillsPage-CcbqGs5t.js +0 -1
- package/dist/factory/assets/Field.es-NxMTQ8PW.js +0 -1
- package/dist/factory/assets/IconBrain.es-B2dyR6zl.js +0 -35
- package/dist/factory/assets/IconExclamationTriangle.es-Ctfttmav.js +0 -1
- package/dist/factory/assets/IconFormCircle.es-By9owScM.js +0 -1
- package/dist/factory/assets/IconPlugin1.es-CZs2N-e2.js +0 -1
- package/dist/factory/assets/IconScript.es-B46J5wzc.js +0 -1
- package/dist/factory/assets/Input-A03ee_nt.js +0 -1
- package/dist/factory/assets/InputNumber.es-DRYBWKeD.js +0 -1
- package/dist/factory/assets/IntakeTesterDialog-BBLz-WP5.js +0 -1
- package/dist/factory/assets/KnowledgePage-Tqc1tv8-.js +0 -13
- package/dist/factory/assets/LoadErrorState-dfQWbyzw.js +0 -1
- package/dist/factory/assets/MastraGatewayBilling-r-9D2-JX.js +0 -1
- package/dist/factory/assets/NewBoardPage-Cm9kCJeB.js +0 -2
- package/dist/factory/assets/NewPage-DT1N7-0q.js +0 -1
- package/dist/factory/assets/OnboardingPage-DUnLGvlt.js +0 -1
- package/dist/factory/assets/RadioGroup-BOi-Weae.js +0 -1
- package/dist/factory/assets/RadioGroup.es-IC93k6as.js +0 -1
- package/dist/factory/assets/RootGuards-C_trAQNr.js +0 -1
- package/dist/factory/assets/RulesPage-D6GP600o.js +0 -1
- package/dist/factory/assets/SearchInput.es-DIBIV03C.js +0 -1
- package/dist/factory/assets/SessionSharingPopover-C_TkFujd.js +0 -1
- package/dist/factory/assets/SettingsPage-BznQCcMV.js +0 -3
- package/dist/factory/assets/Sidebar.es-DGzeKZbU.js +0 -1
- package/dist/factory/assets/SignInPage-CUXRK4ud.js +0 -1
- package/dist/factory/assets/SlackConnectionPage-Dp87noGZ.js +0 -1
- package/dist/factory/assets/ThinkingLevel.es-BqkSfVEb.js +0 -1
- package/dist/factory/assets/ThreadPage-D8OHUgj0.js +0 -4
- package/dist/factory/assets/Transcript-Doeh0b0A.js +0 -29
- package/dist/factory/assets/Tree-B90XgTY4-CQ1IfQAY.js +0 -1
- package/dist/factory/assets/board-events-eM9UCRV7.js +0 -1
- package/dist/factory/assets/boardCardState-VSEyKo7t.js +0 -1
- package/dist/factory/assets/buttons-group-DA_wORqQ-CgDRdkBU.js +0 -1
- package/dist/factory/assets/cardPrimaryAction-Ck3XJ6Vd.js +0 -1
- package/dist/factory/assets/conditionFields-CZ3o2Z7y.js +0 -1
- package/dist/factory/assets/copy-button-5PzdvEQI-trdw-Qsi.js +0 -1
- package/dist/factory/assets/factory-CLsJ5LZS.js +0 -1
- package/dist/factory/assets/icons-kWCiEOqK.js +0 -1
- package/dist/factory/assets/index-BdgSQitL.js +0 -91
- package/dist/factory/assets/index-BqnDo1fJ.css +0 -1
- package/dist/factory/assets/input-DqReKX0A-2mZo-XW9.js +0 -3
- package/dist/factory/assets/input-group-CXvse9n7-C2R5K-Tq.js +0 -1
- package/dist/factory/assets/isRecord-BeeVavRN.js +0 -1
- package/dist/factory/assets/lib-C4aHsZXk.js +0 -1
- package/dist/factory/assets/mastra-gateway-credits-DF2Pm34A.js +0 -1
- package/dist/factory/assets/onboardingFlow-D5f47o5F.js +0 -1
- package/dist/factory/assets/overlays-eEEsk-kD.js +0 -1
- package/dist/factory/assets/page-header-Maytcmgh-Dm4StKTd.js +0 -1
- package/dist/factory/assets/provider-credential-CjKKQDMe.js +0 -1
- package/dist/factory/assets/remarkKnowledgeLinks.es-ZgDIp52A.js +0 -1
- package/dist/factory/assets/request-CPtLhnSV.js +0 -1
- package/dist/factory/assets/request-DMy_kSf9.css +0 -1
- package/dist/factory/assets/settings-DIrzLcgE-Dbj7eE0R.js +0 -1
- package/dist/factory/assets/spinner-B9ykw74u-DxtuBv70.js +0 -1
- package/dist/factory/assets/string-CA5M0mj_-2jkjD8_7.js +0 -1
- package/dist/factory/assets/use-isomorphic-layout-effect.es-DAeDGRU1.js +0 -1
- package/dist/factory/assets/use-providers-DzG0DbJ3.js +0 -1
- package/dist/factory/assets/useBoardCatalog-Bwbdd2Vb.js +0 -1
- package/dist/factory/assets/useBoardEditor-D_XHmLsE.js +0 -1
- package/dist/factory/assets/useDraftModelGuards-B-60Yg46.js +0 -1
- package/dist/factory/assets/useFactories-B-Om6aVq.js +0 -55
- package/dist/factory/assets/useFactoryDecisions-B_eptAHT.js +0 -1
- package/dist/factory/assets/useInfiniteQuery-B6hRssCo.js +0 -1
- package/dist/factory/assets/useLinearData-DGsFutzP.js +0 -1
- package/dist/factory/assets/useSessionRows-K8nhJELk.js +0 -1
- package/dist/factory/assets/workspaces-_EYMTTLv.js +0 -2
- package/dist/studio/assets/style-DadF3DOw.css +0 -3
- /package/dist/factory/assets/{IconFormCircle-C1AYXK8g.css → useChatSessionContext-C1AYXK8g.css} +0 -0
- /package/dist/factory/assets/{Transcript-Bna6hyHj.css → useDraftModelGuards-Bna6hyHj.css} +0 -0
package/dist/docs/SKILL.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bt as e,Gt as t,Ht as n,It as r,Jt as i,Kt as a,Mi as o,Rt as s,Ut as c,Vt as l,Wt as u,qt as d,zt as f}from"./Notice-BhWgws6f-u2XtThO4.js";import{O as p,T as m}from"./IconChevronRightMedium.es-BjSIsine.js";var h=p();function g(e){return(0,h.jsx)(r,{...e,modal:!0,disablePointerDismissal:!0})}function _({size:e=`sm`,...t}){return(0,h.jsx)(l,{"data-slot":`alert-dialog-content`,size:e,showCloseButton:!1,...t,role:`alertdialog`})}function v({children:t,...n}){return(0,h.jsx)(e,{render:(0,h.jsx)(o,{variant:`primary`,size:`md`,className:m(d,i.md),children:t}),...n})}g.Trigger=a,g.Content=_,g.Header=u,g.Footer=c,g.Body=s,g.Title=t,g.Description=n,g.Action=v,g.Cancel=f;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-0R_XL00x.js";import{t as r}from"./EmptyState-juw2jci2-PoiXi1p2.js";import{Cn as i,D as a,Dr as o,E as s,Fr as c,Lr as l,Pn as u,Sn as d,Tn as f,_n as p,an as m,cn as h,en as g,gn as _,hn as v,in as y,mn as b,nn as x,on as S,pn as C,rn as w,sn as ee,tn as T,un as te,ur as ne,yn as E}from"./index-CXm1OtvB.js";import{a as D,k as O}from"./Sidebar.es-Bx7dX5pc.js";import{d as k,l as A,r as j,t as M,u as N}from"./settings-B7RMGKgf-GYIOMjOV.js";import{O as P,T as F,f as I,i as L,k as re,n as R,s as z,t as ie}from"./IconChevronRightMedium.es-BjSIsine.js";import{t as B}from"./lib-Z1TxHc5t.js";import{c as ae,o as oe,r as se,s as ce,t as le}from"./useBoardEditor-C9-FvIWD.js";import{n as V,t as ue}from"./FactorySkillEditorDialog-DlBPPSo-.js";import{a as de,c as fe,o as pe,r as me}from"./boardConfigPaths-CyCwKxS5.js";import{t as H}from"./AlertDialog.es-D8KrNZz7.js";import{Mi as U,Qn as he,cr as ge,da as W,n as _e,pa as G,t as K,ua as ve}from"./Notice-BhWgws6f-u2XtThO4.js";import{n as ye}from"./useBoardCatalog-oA5VpTLX.js";import{n as be,t as xe}from"./boardCatalog-y-s19dQU.js";import{a as Se,d as Ce,t as we}from"./BoardIcons-GeX8LFoy.js";import{t as q}from"./SettingsSubsection-twCTDNkb.js";import{l as Te,p as Ee}from"./board-events-DtlmhUQw.js";import{E as De,S as Oe,o as ke,t as Ae,x as je}from"./conditionFields-CYADwcOD.js";import{t as Me}from"./CodeEditor-AaW7HgY9-D5UgwB1I.js";import{a as Ne,n as Pe,r as Fe,t as Ie}from"./Field.es-d1x5qTVA.js";import{t as Le}from"./input-DqReKX0A-Ds0Cl3d5.js";import{a as Re,n as ze}from"./input-group-CXvse9n7-D6QhMivi.js";import{a as Be,i as Ve,n as He,r as Ue,t as We}from"./InputNumber.es-ZjvkV_5N.js";import{Y as Ge,a as Ke,i as qe,o as Je,r as Ye}from"./request-D-8hZhxi.js";import{n as Xe}from"./IconPlugin1.es-jS0AvWmJ.js";import{n as Ze,t as Qe}from"./ConditionRows-BLnr6YQo.js";import{t as $e}from"./IconLock.es-9mYeLe9c.js";import{t as et}from"./IconPlusMedium.es-QmObHPf-.js";import{t as tt}from"./IconRobot.es-CunHAP4r.js";import{a as nt}from"./IconClipboard2.es-yelKDvfv.js";import{t as J}from"./page-header-Maytcmgh--oRyXaDt.js";import{r as rt}from"./Input-GRxVYRHs.js";import{t as it}from"./LoadErrorState-CncA9Y9V.js";var Y=e(re(),1),X=P();function at({factoryId:e,board:t}){let n=Ee(e,t.id),r=De(e),{count:i}=je(n.data?.intakeRoutes??[]),a=(r.data?.boards??[]).findIndex(e=>e.boardKey===t.id),o=n.isError||r.isError;return(0,X.jsx)(q,{title:`New items`,action:(0,X.jsx)(U,{size:`sm`,variant:`ghost`,render:(0,X.jsx)(B,{to:de(e,t.id)}),children:`Edit rules`}),children:(0,X.jsx)(R,{as:`p`,variant:`caption`,tone:`muted`,role:o?`alert`:`status`,className:`flex flex-wrap gap-x-3 gap-y-1`,children:n.isPending||r.isPending?`Loading rules…`:o?`Rules didn’t load.`:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:ot(i)}),(0,X.jsx)(`span`,{children:a===-1?`Not in the intake order`:`Checked ${Oe(a+1)}`})]})})})}function ot(e){return e===0?`No rules for new items`:e===1?`1 rule for new items`:`${e} rules for new items`}var st=`Finish or remove unfinished conditions to save.`;function ct({label:e,description:t,rule:n,disabled:r,facts:a=Ae,options:o,schema:s,json:c,onChange:l,onUnfinished:u}){let[p,m]=(0,Y.useState)(void 0),h=c?c.text:p,_=c?c.onChange:m,v=(0,Y.useId)(),y=h===void 0?f(s,n):d(s,h),b=e=>{_(e);let t=i(s,e);`problem`in t?l(n??null,t.problem):l(t.rule,void 0)};return(0,X.jsxs)(Ie,{invalid:y!==void 0,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsx)(Ne,{htmlFor:v,children:e}),(0,X.jsx)(U,{size:`sm`,variant:`ghost`,disabled:r,onClick:()=>{h===void 0?_(n?JSON.stringify(n,null,2):``):(_(void 0),l(n??null,f(s,n)))},children:h===void 0?`Edit as JSON`:`Edit as conditions`})]}),(0,X.jsx)(Pe,{children:t}),h===void 0?r?(0,X.jsx)(R,{id:v,as:`p`,variant:`caption`,tone:`muted`,children:ke(n,o)}):(0,X.jsx)(`div`,{id:v,children:(0,X.jsx)(Qe,{label:e,rule:n,facts:a,options:o,onChange:(e,t)=>{u?.(t),t?l(n??null,st):l(e,f(s,e))}})}):(0,X.jsx)(g,{id:v,"aria-label":`${e} JSON`,value:h,disabled:r,rows:6,onChange:e=>b(e.target.value)}),y&&(0,X.jsx)(Fe,{children:y})]})}var lt=`inline-flex h-8 max-w-48 min-w-0 items-center gap-1.5 rounded-lg border px-2.5`;function ut({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,X.jsx)(`ul`,{"aria-label":`Allowed moves from ${e.name}`,className:`flex flex-wrap gap-1.5`,children:t.map(t=>{let o=(0,X.jsx)(we,{stage:t.key,kind:Se(i,t.kind),decorative:!0});if(t.key===e.key)return(0,X.jsxs)(`li`,{className:F(lt,`border-border-strong bg-card shadow-raised dark:bg-muted`),children:[o,(0,X.jsx)(dt,{children:t.name}),(0,X.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,X.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:F(lt,`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`,z),children:[(0,X.jsx)(`span`,{className:F(`grid place-items-center`,!c&&`opacity-50`),children:o}),(0,X.jsx)(dt,{children:t.name}),(0,X.jsx)(`span`,{className:`text-muted-foreground grid size-3.5 shrink-0 place-items-center`,children:l?(0,X.jsx)($e,{className:`size-icon-sm`,"aria-hidden":!0}):c?(0,X.jsx)(Ge,{className:`size-icon-sm`,"aria-hidden":!0}):!a&&(0,X.jsx)(et,{className:`size-icon-sm invisible group-hover/move:visible group-focus-visible/move:visible`,"aria-hidden":!0})})]});return(0,X.jsx)(`li`,{className:`min-w-0`,children:l?(0,X.jsxs)(ve,{children:[(0,X.jsx)(G,{render:d}),(0,X.jsx)(W,{children:`Factory's code makes this move`})]}):d},t.key)})})}function dt({children:e}){return(0,X.jsx)(R,{as:`span`,variant:`label`,className:`truncate`,children:e})}function ft({label:e,children:t}){return(0,X.jsx)(`ol`,{"aria-label":e,className:`flex flex-col`,children:t})}function Z({icon:e,title:t,description:n,children:r}){let i=(0,Y.useId)();return(0,X.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,X.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,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-7 flex-col justify-center`,children:[(0,X.jsx)(R,{as:`h2`,id:i,variant:`subheading`,tone:`ink`,children:t}),n&&(0,X.jsx)(R,{as:`p`,variant:`caption`,tone:`muted`,children:n})]}),r]})]})}var pt=I(`IconFlag2`,()=>(0,X.jsx)(`path`,{d:`M5 15.0002V4.61942C5 4.24002 5.21411 3.88671 5.56677 3.74679C9.85713 2.0446 13.3106 5.53259 17.4846 4.5523C18.2075 4.38251 19 4.87246 19 5.61508V14.3809C19 14.7603 18.7859 15.1137 18.4332 15.2536C13.6349 17.1573 9.88335 12.5691 5 15.0002ZM5 15.0002V21.0002`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})),mt=`__none__`,ht=`sm:max-w-xs`,gt=(e,t)=>e>=t-200?` ${e}/${t}`:``,_t=`work`;function vt({skill:e,missing:t}){return(0,X.jsxs)(X.Fragment,{children:[t&&(0,X.jsx)(O,{variant:`destructive`,children:`Not found`}),e?.error&&(0,X.jsx)(O,{variant:`destructive`,children:`Failed to load`}),e?.builtIn&&e.origin!==void 0&&e.origin!==`bundled`&&(0,X.jsx)(O,{children:`Overridden by app`}),e?.origin===`project`&&(0,X.jsx)(O,{children:`Custom`}),e?.edited&&(0,X.jsx)(O,{children:`Edited`})]})}function Q({title:e,description:t,error:n,disabled:r,children:i,after:a}){return(0,X.jsxs)(j,{children:[(0,X.jsxs)(Ie,{invalid:!!n,disabled:r,children:[(0,X.jsx)(N,{children:e}),(0,X.jsx)(Pe,{children:t}),i,n&&(0,X.jsx)(Fe,{children:n})]}),a]})}function yt({label:e,value:t,placeholder:n,disabled:r,onChange:i}){return(0,X.jsx)(M,{children:(0,X.jsx)(`div`,{className:`px-4 py-3`,children:(0,X.jsx)(Me,{"aria-label":e,value:t,placeholder:n,editable:!r,onChange:i,language:`markdown`,font:`body`,variant:`inline`,lineNumbers:!1,showCopyButton:!1})})})}function bt({phase:e,phases:t,requiredNextPhases:n,skills:r,skillsEditable:i,factoryId:a,boardId:o,disabled:c,rawRules:l,onChange:d,onRawRule:f,onUnfinished:p,onRemove:h}){let g=Ze(a),_=e.kind===`working`,v=b(e,t),x=e.runner?.instructions??``,C=e.runner?.goal,w=C?.objective??``,ee=e.tools??[],T=e.exitTool?.id??``,E=e.runner?.skill,D=E?r?.find(e=>e.name===E):void 0,O=E!==void 0&&r!==void 0&&D===void 0,[A,j]=(0,Y.useState)(),N=t=>{let n={...e.runner,...t},r=Object.fromEntries(Object.entries(n).filter(([,e])=>e!=null&&e!==``));d({...e,runner:Object.keys(r).length>0?r:null})},P=e=>({text:l[e],onChange:t=>f(e,t)}),F=(0,X.jsx)(ut,{phase:e,phases:t,next:v,required:new Set(n),boardId:o,disabled:c,onChange:t=>d({...e,nextPhases:t})}),I=h&&(0,X.jsx)(`div`,{children:(0,X.jsxs)(U,{variant:`ghost`,icon:(0,X.jsx)(nt,{}),onClick:h,children:[`Remove `,e.name]})});return _?(0,X.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,X.jsxs)(ft,{label:`How ${e.name} runs`,children:[(0,X.jsx)(Z,{icon:(0,X.jsx)(Ce,{}),title:`Starts`,children:(0,X.jsxs)(M,{children:[(0,X.jsx)(k,{label:`Start on its own`,disabled:c,children:(0,X.jsx)(Xe,{"aria-label":`${e.name}: start on its own`,checked:e.autoStart??!1,disabled:c,onCheckedChange:t=>{d({...e,autoStart:t,autoStartWhen:t?e.autoStartWhen:null}),t||f(`autoStartWhen`,void 0)}})}),e.autoStart&&(0,X.jsx)(`div`,{className:`px-4 py-3`,children:(0,X.jsx)(ct,{label:`${e.name}: start only when`,description:`Leave empty to start every card on its own.`,rule:e.autoStartWhen,schema:Te,options:{"source.repository":g},disabled:c,json:P(`autoStartWhen`),onUnfinished:e=>p(`autoStartWhen`,e),onChange:t=>d({...e,autoStartWhen:t})})})]})}),(0,X.jsxs)(Z,{icon:(0,X.jsx)(tt,{}),title:`Agent runs`,children:[(0,X.jsx)(Q,{title:`Instructions`,description:`Added to the agent's prompt when the phase starts.${gt(x.length,y)}`,error:x.length>1e3?`Too long to save.`:void 0,disabled:c,children:(0,X.jsx)(yt,{label:`${e.name} instructions`,value:x,placeholder:`Tell the agent what to do, in Markdown`,disabled:c,onChange:e=>N({instructions:e})})}),(0,X.jsx)(Q,{title:`Goal`,description:`The agent keeps working until a judge finds this objective met. Leave empty for a single run.${gt(w.length,m)}`,error:w.length>2e3?`Too long to save.`:void 0,disabled:c,after:C&&(0,X.jsxs)(Ie,{invalid:!te(C.maxRuns),disabled:c,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(Ne,{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,X.jsx)(We,{className:`w-36`,min:1,max:50,allowOutOfRange:!0,value:C.maxRuns??null,disabled:c,onValueChange:e=>{let{maxRuns:t,...n}=C;N({goal:e===null?n:{...n,maxRuns:e}})},children:(0,X.jsxs)(Ue,{size:`sm`,children:[(0,X.jsx)(Be,{placeholder:`Default`}),(0,X.jsxs)(ze,{align:`inline-end`,variant:`flush`,children:[(0,X.jsx)(Re,{className:`mr-1`,children:`runs`}),(0,X.jsx)(He,{}),(0,X.jsx)(Ve,{})]})]})})]}),!te(C.maxRuns)&&(0,X.jsxs)(Fe,{children:[`Use a whole number from 1 to `,50,`.`]})]}),children:(0,X.jsx)(yt,{label:`${e.name} goal`,value:w,placeholder:`Describe what done looks like`,disabled:c,onChange:e=>N({goal:e.trim()?{...C,objective:e}:void 0})})}),(0,X.jsx)(Q,{title:`Session`,description:`Phases with the same session share one agent session per card.`,disabled:c,children:(0,X.jsx)(Le,{className:ht,"aria-label":`${e.name} session`,value:e.runner?.context??``,placeholder:_t,disabled:c,onChange:e=>N({context:e.target.value})})}),(0,X.jsx)(q,{title:`Skill`,children:(0,X.jsx)(M,{children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 py-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsxs)(Ye,{value:E??mt,disabled:c,onValueChange:e=>N({skill:e===mt?void 0:String(e)}),children:[(0,X.jsx)(Je,{variant:`ghost`,size:`sm`,"aria-label":`${e.name} skill`,className:`-ml-2 w-fit`,children:(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(s,{"aria-hidden":!0,className:`text-muted-foreground size-icon-md shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:E??`No skill`})]})}),(0,X.jsxs)(qe,{children:[(0,X.jsx)(Ke,{value:mt,children:`None`}),(r??[]).map(e=>(0,X.jsx)(Ke,{value:e.name,children:e.name},e.name))]})]}),(0,X.jsx)(vt,{skill:D,missing:O}),D&&(0,X.jsx)(U,{size:`sm`,variant:`ghost`,icon:i?(0,X.jsx)(ne,{}):(0,X.jsx)(_e,{}),"aria-label":`${i?`Edit`:`View`} ${D.name}`,className:`ml-auto`,onClick:()=>j(D),children:i?`Edit`:`View`})]}),D?.error?(0,X.jsxs)(R,{as:`p`,variant:`caption`,role:`alert`,className:`text-destructive-foreground`,children:[`Agents can't load this skill: `,D.error]}):O?(0,X.jsxs)(R,{as:`p`,variant:`caption`,role:`alert`,className:`text-destructive-foreground`,children:[`This factory has no `,E,` skill, so cards entering `,e.name,` fail to start.`]}):D?.description&&(0,X.jsx)(R,{as:`p`,variant:`caption`,tone:`muted`,children:D.description})]})})}),(0,X.jsx)(q,{title:`Factory tools`,description:`Given to the session that works the card in this phase.`,children:(0,X.jsx)(M,{children:S.map(t=>(0,X.jsx)(k,{label:t.label,disabled:c,children:(0,X.jsx)(Xe,{"aria-label":`${e.name}: ${t.label}`,checked:ee.includes(t.id),disabled:c,onCheckedChange:n=>{let r=S.map(({id:e})=>e).filter(e=>e===t.id?n:ee.includes(e));d({...e,tools:r.length>0?r:null})}})},t.id))})})]}),(0,X.jsxs)(Z,{icon:(0,X.jsx)(pt,{}),title:`Ends`,children:[(0,X.jsx)(Q,{title:`Exit tool`,description:`Ends the phase when it succeeds. Leave empty for none.`,disabled:c,children:(0,X.jsx)(Le,{className:ht,"aria-label":`${e.name} exit tool`,value:T,disabled:c,onChange:t=>{let n=t.target.value.trim();d({...e,exitTool:n?{...e.exitTool,id:n}:null}),n||f(`autoApproveWhen`,void 0)}})}),T!==``&&(0,X.jsxs)(M,{children:[(0,X.jsx)(k,{label:`Approve on its own`,disabled:c,children:(0,X.jsx)(Xe,{"aria-label":`${e.name}: approve ${T} on its own`,checked:e.exitTool?.autoApprove??!1,disabled:c,onCheckedChange:t=>{d({...e,exitTool:{...e.exitTool,id:T,autoApprove:t,autoApproveWhen:t?e.exitTool?.autoApproveWhen:void 0}}),t||f(`autoApproveWhen`,void 0)}})}),e.exitTool?.autoApprove&&(0,X.jsx)(`div`,{className:`px-4 py-3`,children:(0,X.jsx)(ct,{label:`${e.name}: approve only when`,description:`Leave empty to approve for every card.`,rule:e.exitTool.autoApproveWhen,schema:Te,options:{"source.repository":g},disabled:c,json:P(`autoApproveWhen`),onUnfinished:e=>p(`autoApproveWhen`,e),onChange:t=>d({...e,exitTool:{...e.exitTool,id:T,autoApprove:!0,autoApproveWhen:t??void 0}})})})]})]}),(0,X.jsx)(Z,{icon:(0,X.jsx)(u,{}),title:`Allowed moves`,children:F})]}),I,A&&(0,X.jsx)(ue,{skill:A,factoryId:a,canEdit:i,onClose:()=>j(void 0)})]}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,X.jsx)(q,{title:`Allowed moves`,children:F}),I]})}var xt=[`autoStartWhen`,`autoApproveWhen`];function St(e){return e.conflicts.length>0?e.conflicts.join(` `):e.message}function Ct({factory:e,boardId:t,phaseKey:n,response:i,skills:o,skillsEditable:c,sidebarHidden:l,onReload:u}){let{board:d,canEdit:f}=i,{draft:m,rawRules:g,locked:y,setDraft:b,setRawRule:S,discard:C}=x(e.id,t,d),[w,T]=(0,Y.useState)(0),te=()=>{C(),T(e=>e+1)},ne=ye(e.id),E=ne.data?.find(e=>e.id===t),D=ge(),O=ae(e.id,t),A=ce(e.id,t),j=(0,Y.useRef)(!1),N=oe(e.id,t,()=>{j.current=!0,C();let n=be(ne.data??[]).find(e=>e.id!==t);D(n?xe(e.id,n.id):`/factories/${e.id}`,{replace:!0})}),P=!f||!d.editable,F=n?m.phases.find(e=>e.key===n):void 0,I=F&&`${F.key}:${d.revision??`code`}:${w}`,[L,re]=(0,Y.useState)({page:I,fields:[]});L.page!==I&&re({page:I,fields:[]});let z=L.page===I?L.fields:[],se=(e,t)=>re(n=>{let r=n.fields.filter(t=>t!==e);return{...n,fields:t?[...r,e]:r}}),le=!P&&(h(m,d)||Object.keys(g).length>0||z.length>0),V=m.phases.filter(e=>v(e,g)||e===F&&z.length>0),ue=m.name.trim()===``,de=O.error?.code===`revision_mismatch`,W=he(({nextLocation:n})=>{if(!le||j.current)return!1;let r=fe(n.pathname);return r?.factoryId!==e.id||r.boardId!==t||r.skills===!0||r.rules===!0||r.intake===!0}),_e=me(e.id,t),G;return G=n&&!F?(0,X.jsx)(r,{titleSlot:(0,X.jsxs)(`span`,{role:`alert`,children:[d.name,` has no such phase.`]}),actionSlot:(0,X.jsx)(U,{size:`sm`,render:(0,X.jsx)(B,{to:_e}),children:`Back to general`})}):F?(0,X.jsx)(bt,{phase:F,phases:m.phases,requiredNextPhases:d.codeBehaviour?.[F.key]?.requiredNextPhases??[],skills:o,skillsEditable:c,factoryId:e.id,boardId:t,disabled:P||y,rawRules:{autoStartWhen:g[_(F.key,`autoStartWhen`)],autoApproveWhen:g[_(F.key,`autoApproveWhen`)]},onRawRule:(e,t)=>{S(_(F.key,e),t),se(e,!1)},onUnfinished:se,onRemove:P||y||!ee(m.phases,F.key,d.codeBehaviour)?void 0:()=>{for(let e of xt)S(_(F.key,e),void 0);b(e=>({...e,phases:p(e.phases,F.key)})),D(_e)},onChange:e=>b(t=>({...t,phases:t.phases.map(t=>t.key===e.key?e:t)}))},I):(0,X.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[l&&(0,X.jsxs)(q,{title:`Phases`,children:[(0,X.jsx)(M,{children:(0,X.jsx)(`ul`,{children:m.phases.map(n=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(B,{to:me(e.id,t,n.key),className:`hover:bg-fill focus-visible:bg-fill flex items-center gap-3 px-4 py-3 focus-visible:outline-hidden`,children:[(0,X.jsx)(we,{stage:n.key,kind:Se(t,n.kind),decorative:!0}),(0,X.jsx)(R,{as:`span`,variant:`label`,className:`min-w-0 flex-1 truncate`,children:n.name}),(0,X.jsx)(ie,{className:`text-muted-foreground size-icon-md`,"aria-hidden":!0})]})},n.key))})}),!P&&(0,X.jsx)(a,{factoryId:e.id,boardId:t,board:d,disabled:y})]}),l&&(0,X.jsx)(q,{title:`Factory`,children:(0,X.jsx)(M,{children:(0,X.jsxs)(B,{to:pe(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,X.jsx)(s,{className:`text-muted-foreground size-icon-md`,"aria-hidden":!0}),(0,X.jsx)(R,{as:`span`,variant:`label`,className:`min-w-0 flex-1 truncate`,children:`Skills`}),(0,X.jsx)(ie,{className:`text-muted-foreground size-icon-md`,"aria-hidden":!0})]})})}),E&&(0,X.jsx)(at,{factoryId:e.id,board:E}),d.source!==`stored`&&!P&&(0,X.jsxs)(q,{title:`Default`,children:[(0,X.jsx)(M,{children:(0,X.jsx)(k,{label:`Reset to default`,description:`Go back to Factory's version of this board.`,children:(0,X.jsxs)(H,{children:[(0,X.jsx)(H.Trigger,{render:(0,X.jsx)(U,{size:`sm`,disabled:A.isPending,children:`Reset`})}),(0,X.jsxs)(H.Content,{children:[(0,X.jsxs)(H.Header,{children:[(0,X.jsxs)(H.Title,{children:[`Reset `,d.name,` to default?`]}),(0,X.jsx)(H.Description,{children:`Every change made to this board's name and phases is replaced with Factory's version.`})]}),(0,X.jsxs)(H.Footer,{children:[(0,X.jsx)(H.Cancel,{children:`Cancel`}),(0,X.jsx)(H.Action,{onClick:()=>A.mutate(d.revision??0),children:`Reset`})]})]})]})})}),A.error&&(0,X.jsx)(K,{variant:`destructive`,role:`alert`,children:(0,X.jsxs)(K.Message,{children:[`The board was not reset. `,St(A.error)]})})]}),d.source!==`builtin`&&!P&&(0,X.jsxs)(q,{title:`Delete`,children:[(0,X.jsx)(M,{children:(0,X.jsx)(k,{label:`Delete board`,description:`A board that still has cards cannot be deleted.`,children:(0,X.jsxs)(H,{children:[(0,X.jsx)(H.Trigger,{render:(0,X.jsx)(U,{size:`sm`,variant:`destructive`,disabled:N.isPending,children:`Delete`})}),(0,X.jsxs)(H.Content,{children:[(0,X.jsxs)(H.Header,{children:[(0,X.jsxs)(H.Title,{children:[`Delete `,d.name,`?`]}),(0,X.jsx)(H.Description,{children:`The board and its phases are removed from this project.`})]}),(0,X.jsxs)(H.Footer,{children:[(0,X.jsx)(H.Cancel,{children:`Cancel`}),(0,X.jsx)(H.Action,{onClick:()=>N.mutate(d.revision??0),children:`Delete`})]})]})]})})}),N.error&&(0,X.jsx)(K,{variant:`destructive`,role:`alert`,children:(0,X.jsxs)(K.Message,{children:[`The board was not deleted. `,St(N.error)]})})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-8 pb-4`,children:[d.editable?!f&&(0,X.jsx)(K,{variant:`info`,children:`Only organization admins can change this board.`}):(0,X.jsx)(K,{variant:`info`,children:`This board is defined in code, so it can't be changed here.`}),!F&&d.problems.length>0&&(0,X.jsx)(K,{variant:`warning`,title:`This board has problems`,children:(0,X.jsx)(K.Message,{children:d.problems.join(` `)})}),G,le&&(0,X.jsxs)(`div`,{className:`rounded-card bg-card shadow-overlay dark:bg-muted sticky bottom-4 z-10 flex flex-col gap-3 p-3`,children:[de&&(0,X.jsx)(K,{variant:`warning`,title:`Someone else changed this board`,action:(0,X.jsx)(K.Button,{onClick:u,children:`Reload`}),children:(0,X.jsx)(K.Message,{children:`Reload to see their version. Your unsaved changes will be lost.`})}),O.error&&!de&&(0,X.jsx)(K,{variant:`destructive`,role:`alert`,children:(0,X.jsxs)(K.Message,{children:[`The board was not saved. `,St(O.error)]})}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(R,{variant:`body-sm`,tone:`muted`,className:`min-w-0 flex-1`,role:`status`,children:ue?`Name the board to save.`:V.length>0?`Fix ${V.map(e=>e.name||e.key).join(`, `)} to save.`:`Unsaved changes`}),(0,X.jsx)(U,{size:`sm`,variant:`ghost`,disabled:O.isPending,onClick:te,children:`Discard`}),(0,X.jsx)(U,{size:`sm`,variant:`primary`,disabled:O.isPending||ue||V.length>0,onClick:()=>O.mutate({name:m.name,description:m.description,phases:m.phases,expectedRevision:d.revision??0}),children:O.isPending?`Saving…`:`Save`})]})]}),(0,X.jsx)(H,{open:W.state===`blocked`,onOpenChange:e=>!e&&W.reset?.(),children:(0,X.jsxs)(H.Content,{children:[(0,X.jsxs)(H.Header,{children:[(0,X.jsxs)(H.Title,{children:[`Discard changes to `,d.name,`?`]}),(0,X.jsx)(H.Description,{children:`Your unsaved changes to this board will be lost.`})]}),(0,X.jsxs)(H.Footer,{children:[(0,X.jsx)(H.Cancel,{children:`Keep editing`}),(0,X.jsx)(U,{variant:`destructive`,size:`md`,onClick:()=>{C(),W.proceed?.()},children:`Discard`})]})]})})]})}function wt({value:e,label:t,placeholder:n,required:r=!1,multiline:i=!1,readOnly:a,variant:o,tone:s,className:c,onChange:l}){let u=(0,Y.useRef)(e),d=(0,Y.useRef)(!1);if(a)return e?(0,X.jsx)(`span`,{className:c,children:e}):null;let f=i?`textarea`:`input`,p=L({variant:o,tone:s}),m=(0,X.jsx)(f,{"aria-label":t,value:e,placeholder:n,rows:i?1:void 0,...rt,onFocus:()=>{u.current=e},onChange:e=>l(e.currentTarget.value),onBlur:()=>{if(d.current){d.current=!1;return}let t=e.trim();r&&t===``?l(u.current):t!==e&&l(t)},onKeyDown:e=>{e.key===`Escape`&&(d.current=!0,l(u.current)),(e.key===`Enter`&&!e.shiftKey||e.key===`Escape`)&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.blur())},className:F(p,`placeholder:text-muted-foreground resize-none rounded-md bg-transparent px-1.5`,i?`field-sizing-content -mx-1.5`:`absolute inset-0 w-full min-w-0`,`hover:bg-fill`,z,i&&c)});return i?m:(0,X.jsxs)(`span`,{className:F(`relative -mx-1.5 inline-block max-w-[calc(100%+--spacing(3))] min-w-0`,c),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:F(p,`invisible block overflow-hidden px-1.5 whitespace-pre`),children:e||n||` `}),m]})}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.`}},Tt=[`resting`,`working`,`terminal`];function Et({label:e,meaning:t,children:n}){return(0,X.jsxs)(ve,{children:[(0,X.jsx)(G,{render:(0,X.jsx)(`span`,{role:`img`,tabIndex:0,"aria-label":`${e}. ${t}`,className:F(`inline-flex rounded-sm`,z),children:n})}),(0,X.jsx)(W,{side:`bottom`,className:`max-w-72`,children:t})]})}function Dt({factoryId:e,boardId:t,phaseKey:n,response:r}){let{board:i,canEdit:a}=r,{draft:o,locked:s,setDraft:c,setRawRule:l}=x(e,t,i),u=!a||!i.editable||s,d=n?o.phases.find(e=>e.key===n):void 0;if(n&&!d)return null;let f=e=>c(t=>({...t,phases:t.phases.map(t=>t.key===n?{...t,...e}:t)})),p=e=>{d&&(l(_(d.key,`autoStartWhen`),void 0),l(_(d.key,`autoApproveWhen`),void 0),c(t=>({...t,phases:t.phases.map(n=>n.key===d.key?E(n,e,t.phases):n)})))},m=d?d.name:o.name,h=(d?d.description:o.description)??``,g=d!==void 0&&!u&&!C(o.phases,d.key,i.codeBehaviour);return(0,X.jsxs)(J,{children:[(0,X.jsxs)(J.Title,{className:`gap-2.5`,children:[d&&(0,X.jsx)(we,{stage:d.key,kind:Se(t,d.kind),decorative:!0}),(0,X.jsx)(wt,{value:m,label:d?`Phase name`:`Board name`,required:!0,readOnly:u,variant:`heading`,tone:`ink`,onChange:e=>d?f({name:e}):c(t=>({...t,name:e}))})]}),(d||i.revision!=null)&&(0,X.jsx)(J.Meta,{beside:!0,children:d&&g?(0,X.jsxs)(Ye,{value:d.kind,onValueChange:e=>{let t=Tt.find(t=>t===e);t&&p(t)},children:[(0,X.jsx)(Je,{size:`sm`,"aria-label":`Phase kind`,children:$[d.kind].label}),(0,X.jsx)(qe,{children:Tt.map(e=>(0,X.jsx)(Ke,{value:e,children:$[e].label},e))})]}):d?(0,X.jsx)(Et,{label:$[d.kind].label,meaning:$[d.kind].meaning,children:(0,X.jsx)(O,{children:$[d.kind].label})}):(0,X.jsxs)(Et,{label:`Revision ${i.revision}`,meaning:`Goes up each time the board is saved. If someone else saves first, you're asked to reload before saving.`,children:[`Revision `,i.revision]})}),(h||!u)&&(0,X.jsx)(J.Description,{children:(0,X.jsx)(wt,{value:h,label:d?`Phase description`:`Board description`,placeholder:`Add a description`,multiline:!0,readOnly:u,variant:`caption`,tone:`muted`,className:`zoom-safe-text w-full`,onChange:e=>d?f({description:e||null}):c(t=>({...t,description:e||null}))})})]})}var Ot=`mx-auto w-full max-w-2xl`;function kt(){let e=o(),i=T(),a=i?.boardId??``,s=i?.phaseKey,{isMobile:u,desktopState:d}=D(),f=u||d===`collapsed`,p=se(e.id,a),m=V(e.id),h=p.data?.board,g=w(e.id,a,h),_=s?g?.phases.find(e=>e.key===s):void 0,v=me(e.id,a),y=c({breadcrumbs:f&&h?(0,X.jsxs)(n,{label:`Breadcrumb`,className:`min-w-0 flex-1 overflow-hidden`,children:[(0,X.jsx)(t,{as:B,to:xe(e.id,a),children:g?.name||h.name}),s?(0,X.jsx)(t,{as:B,to:v,children:`Configure`}):(0,X.jsx)(t,{as:`span`,isCurrent:!0,children:`Configure`}),_&&(0,X.jsx)(t,{as:`span`,isCurrent:!0,children:_.name})]}):void 0}),b=p.isSuccess&&(!s||_)?(0,X.jsx)(`div`,{className:F(Ot,`pb-8`),children:(0,X.jsx)(Dt,{factoryId:e.id,boardId:a,phaseKey:s,response:p.data},`${a}:${p.data.board.revision??`code`}`)}):void 0;return(0,X.jsx)(l,{variant:`narrow`,header:b,...y,children:(0,X.jsx)(`div`,{className:Ot,children:p.isPending?(0,X.jsx)(M,{children:(0,X.jsx)(A,{label:`Loading board`,rows:3})}):p.isError&&p.error instanceof le&&p.error.code===`board_not_found`?(0,X.jsx)(r,{variant:`fill`,titleSlot:(0,X.jsx)(`span`,{role:`alert`,children:`Board unavailable: this board is not installed.`})}):p.isError?(0,X.jsx)(it,{title:`Couldn’t load this board`,error:p.error,onRetry:()=>void p.refetch(),retrying:p.isFetching}):(0,X.jsx)(Ct,{factory:e,boardId:a,phaseKey:s,response:p.data,skills:m.data?.skills,skillsEditable:m.data?.canEdit??!1,sidebarHidden:f,onReload:()=>void p.refetch()},`${a}:${p.data.board.revision??`code`}`)})})}export{kt as BoardConfigPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./GithubIcon.es-
|
|
1
|
+
import{t as e}from"./GithubIcon.es-DGJTTitG.js";import{t}from"./LinearIcon.es-BnTumr4a.js";import{t as n}from"./SlackIcon.es-DCRKrg7l.js";import{O as r,T as i,f as a}from"./IconChevronRightMedium.es-BjSIsine.js";import{s as o}from"./useBoardCatalog-oA5VpTLX.js";import{c as s,i as c,n as l,o as u,r as d,t as f}from"./IconClipboard2.es-yelKDvfv.js";import{n as p,r as m,t as h}from"./icons-CXrIuTze.js";import{t as g}from"./IconCircleDashed.es-Chw6BTXK.js";import{t as _}from"./IconCircleX.es-3P8aywDS.js";import{S as v}from"./Sidebar.es-Bx7dX5pc.js";import{t as y}from"./IconCircleCheck.es-e9o_0ikv.js";var b=r();function x({size:e=16,className:t}){return(0,b.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,b.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 S=a(`IconPlay`,()=>(0,b.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`})),C=a(`IconHammer`,()=>(0,b.jsxs)(b.Fragment,{children:[(0,b.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,b.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`})]})),w={"github-issue":{icon:e,className:`text-foreground`},"github-pr":{icon:d,className:`text-muted-foreground`},"gitlab-issue":{icon:h,className:`text-badge-red-indicator`},"gitlab-pr":{icon:h,className:`text-badge-red-indicator`},"linear-issue":{icon:t,className:`text-badge-blue-indicator`},"jira-issue":{icon:m,className:`text-badge-blue-indicator`},"incidentio-follow-up":{icon:p,className:`text-badge-red-indicator`},"slack-thread":{icon:n,className:``},manual:{icon:c,className:`text-muted-foreground`}};function T({source:e,className:t}){let{icon:n,className:r}=w[e];return(0,b.jsx)(n,{"data-source":e,className:i(`size-4 shrink-0`,r,t),"aria-hidden":!0})}var E={Investigate:v,Build:C,"Prepare approval":f,Review:l};function D(e){let t=E[e]??S;return(0,b.jsx)(t,{"aria-hidden":!0})}var O={resting:`neutral`,working:`info`,terminal:`success`},k={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 A({source:e,className:t}){return(0,b.jsx)(`span`,{"aria-hidden":!0,style:{maskImage:`url(${e})`},className:i(`size-4 shrink-0 bg-current mask-center mask-no-repeat mask-contain`,t)})}var j=2.25,M=2*Math.PI*j;function N({progress:e,className:t}){return(0,b.jsxs)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,className:i(`shrink-0`,t),children:[(0,b.jsx)(`circle`,{cx:8,cy:8,r:6,stroke:`currentColor`,strokeWidth:1.5}),(0,b.jsx)(`circle`,{cx:8,cy:8,r:j,stroke:`currentColor`,strokeWidth:j*2,strokeDasharray:`${e*M} ${M}`,transform:`rotate(-90 8 8)`})]})}function P(e,t){return t?void 0:u(e)}function F(e,t){return e===`work`||e===`review`?void 0:t}function I(e,t){let n=o(e,t);return e&&n?F(e.id,n):void 0}function L(e,t){let n=P(e,t);return n?s(n):O[t??`resting`]}function R({stage:e,kind:t,className:n}){let r=i(`shrink-0`,n);switch(P(e,t)??t??`resting`){case`intake`:return(0,b.jsx)(x,{className:r});case`triage`:return(0,b.jsx)(A,{source:`/factory-stage-icons/triage.svg`,className:n});case`planning`:return(0,b.jsx)(N,{progress:.25,className:n});case`execute`:case`working`:return(0,b.jsx)(N,{progress:.5,className:n});case`review`:case`pr-review`:return(0,b.jsx)(A,{source:`/factory-stage-icons/review.svg`,className:n});case`done`:case`terminal`:return(0,b.jsx)(y,{"aria-hidden":!0,className:i(`size-icon-md`,r)});case`canceled`:return(0,b.jsx)(_,{"aria-hidden":!0,className:i(`size-icon-md`,r)});case`resting`:return(0,b.jsx)(g,{"aria-hidden":!0,className:i(`size-icon-md`,r)})}}function z(e,t){return k[L(e,t)].tint}function B(e,t){return i(`bg-fill-subtle dark:bg-card bg-linear-to-r to-transparent`,k[L(e,t)].gradientFrom)}function V(e,t){return k[L(e,t)].strongTint}function H(e,t){return k[L(e,t)].icon}var U=`opacity-30`;function W({stage:e,kind:t,decorative:n=!1}){let r=(0,b.jsx)(R,{stage:e,kind:t,className:k[L(e,t)].icon});return n||!t?r:(0,b.jsx)(`span`,{role:`img`,"aria-label":`${t} phase`,className:`inline-flex shrink-0`,children:r})}export{F as a,V as c,S as d,x as f,I as i,z as l,T as n,H as o,D as r,B as s,W as t,U as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./Breadcrumb.es-0R_XL00x.js";import{t as r}from"./page-header-Maytcmgh--oRyXaDt.js";import{Dr as i,Fr as a,Lr as o,tn as s}from"./index-CXm1OtvB.js";import{a as c,k as l}from"./Sidebar.es-Bx7dX5pc.js";import{O as u,T as d,k as f,n as p}from"./IconChevronRightMedium.es-BjSIsine.js";import{t as m}from"./lib-Z1TxHc5t.js";import{r as h}from"./useBoardEditor-C9-FvIWD.js";import{a as g,n as _,r as v,t as y}from"./boardConfigPaths-CyCwKxS5.js";import{Mi as b,t as x}from"./Notice-BhWgws6f-u2XtThO4.js";import{X as S}from"./request-D-8hZhxi.js";import{a as C,l as w,n as T,o as E,t as D}from"./settings-B7RMGKgf-GYIOMjOV.js";import{a as O,i as k,n as A,r as j,t as M}from"./IntakeTesterDialog-BPuhOvLO.js";import{D as N,E as P,O as F,k as I,x as L}from"./conditionFields-CYADwcOD.js";import{g as R}from"./board-events-DtlmhUQw.js";import{t as z}from"./SettingsSubsection-twCTDNkb.js";import{n as B}from"./useBoardCatalog-oA5VpTLX.js";import{s as V}from"./settingsSections-B0_LEh3l.js";var H=e(f(),1),U=u(),W=d(`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 G({factoryId:e}){let t=P(e);return(0,U.jsx)(z,{id:y,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; no board taking it leaves it Not routed.`,children:t.isPending?(0,U.jsx)(D,{children:(0,U.jsx)(w,{label:`Loading intake order`,variant:`item`,rows:3})}):t.isError?(0,U.jsx)(x,{variant:`destructive`,children:`The intake order didn’t load.`}):(0,U.jsx)(K,{factoryId:e,order:t.data},e)})}function K({factoryId:e,order:t}){let n=R(e),r=I(e),[i,a]=(0,H.useState)(),o=t.boards.map(e=>e.boardKey),s=i&&Y(i,o)?i:void 0,c=s??o,l=new Map(t.boards.map(e=>[e.boardKey,e.name])),u=s!==void 0&&s.some((e,t)=>e!==o[t]),f=(e,t)=>{let n=[...c],[r]=n.splice(e,1);r!==void 0&&(n.splice(t,0,r),a(n))},h=A({min:0,max:c.length-1,onDrop:f}),_=()=>r.mutate(c,{onSuccess:()=>{a(void 0),S.success(`Intake order saved.`)},onError:e=>S.error(e.message)}),v=t.canEdit&&c.length>1,y=v&&!r.isPending;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(J,{order:t,changed:u}),n.isError&&(0,U.jsx)(x,{variant:`warning`,children:`Rule counts didn’t load.`}),(0,U.jsx)(D,{role:`list`,"aria-label":`Intake order`,children:c.map((t,r)=>{let i=h.drag?.from===r,a=l.get(t)??t;return(0,U.jsx)(C,{role:`listitem`,"data-drop":h.dropAt(r),style:i?{transform:`translateY(${h.drag?.offset??0}px)`}:void 0,onPointerDown:y?e=>h.onPointerDown(e,r):void 0,onKeyDown:y?e=>h.onKeyDown(e,r):void 0,className:d(W,i&&`z-10 opacity-90`),media:(0,U.jsx)(E,{children:(0,U.jsx)(p,{as:`span`,variant:`caption`,className:`tabular-nums`,children:r+1})}),title:a,description:(0,U.jsx)(q,{routes:n.data?.intakeRoutes,boardKey:t}),children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[v&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{"data-grip":!0,"aria-hidden":!0,className:`text-icon3 hidden cursor-grab touch-none pointer-fine:inline-flex`,children:(0,U.jsx)(j,{className:`size-icon-md`})}),(0,U.jsx)(b,{size:`icon-sm`,variant:`ghost`,tooltip:`Check earlier`,disabled:!y||r===0,onClick:()=>f(r,r-1),children:(0,U.jsx)(k,{})}),(0,U.jsx)(b,{size:`icon-sm`,variant:`ghost`,tooltip:`Check later`,disabled:!y||r===c.length-1,onClick:()=>f(r,r+1),children:(0,U.jsx)(O,{})})]}),(0,U.jsx)(b,{size:`sm`,variant:`ghost`,render:(0,U.jsx)(m,{to:g(e,t)}),children:`Edit rules`})]})},t)})}),t.canEdit&&u&&(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(b,{size:`sm`,variant:`ghost`,onClick:()=>a(void 0),disabled:r.isPending,children:`Discard`}),(0,U.jsx)(b,{size:`sm`,variant:`primary`,onClick:_,disabled:r.isPending,children:`Save order`})]})]})}function q({routes:e,boardKey:t}){if(!e)return null;let{count:n,catchesAll:r}=L(e.filter(e=>e.target.boardKey===t));return(0,U.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`span`,{children:n===0?`No rules for new items`:n===1?`1 rule`:`${n} rules`}),r&&(0,U.jsx)(l,{children:`Ends in catch-all`})]})}function J({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,U.jsx)(x,{variant:`info`,children:(0,U.jsx)(`span`,{className:`flex flex-col gap-1`,children:a.map(e=>(0,U.jsx)(`span`,{children:e},e))})})}function Y(e,t){let n=new Set(t);return e.length===t.length&&e.every(e=>n.has(e))}function X({factoryId:e}){let t=N(e),n=F(e),r=new Map((B(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=>S.success(`Filing “${e.title}” on ${r.get(t.boardKey)??t.boardKey}.`),onError:e=>S.error(e.message)});return(0,U.jsx)(z,{id:_,scope:`factory`,title:`Not routed`,description:`New issues and pull requests no board's rules took. Change a board's rules, then route the item again.`,children:t.isPending?(0,U.jsx)(D,{children:(0,U.jsx)(w,{label:`Loading items not routed`,variant:`item`,rows:2})}):t.isError?(0,U.jsx)(x,{variant:`destructive`,children:`Items not routed didn’t load.`}):(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a.length===0?(0,U.jsx)(D,{children:(0,U.jsx)(T,{children:`Every new item found a board.`})}):(0,U.jsx)(D,{role:`list`,"aria-label":`Not routed`,children:a.map(t=>(0,U.jsxs)(C,{role:`listitem`,title:t.url?(0,U.jsx)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,className:`hover:underline`,children:t.title}):t.title,description:(0,U.jsxs)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:[t.sourceKey&&(0,U.jsx)(`span`,{children:t.sourceKey}),(0,U.jsx)(`span`,{children:t.reason??`No board’s rules match it.`}),(0,U.jsx)(`time`,{dateTime:t.decidedAt,children:Z(t.decidedAt)})]}),children:[(0,U.jsx)(M,{factoryProjectId:e,itemId:t.id,label:`Why?`}),o&&(0,U.jsx)(b,{size:`sm`,variant:`ghost`,onClick:()=>s(t),disabled:n.isPending&&n.variables===t.id,children:`Route again`})]},t.id))}),t.hasNextPage&&(0,U.jsx)(`div`,{className:`flex justify-center`,children:(0,U.jsx)(b,{size:`sm`,variant:`ghost`,onClick:()=>void t.fetchNextPage(),disabled:t.isFetchingNextPage,children:t.isFetchingNextPage?`Loading…`:`Load more`})})]})})}function Z(e){return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}var Q=`mx-auto w-full max-w-2xl`;function $(){let e=i(),l=s()?.boardId??``,{isMobile:u,desktopState:f}=c(),p=u||f===`collapsed`,g=h(e.id,l).data?.board,_=a({breadcrumbs:p&&g?(0,U.jsxs)(n,{label:`Breadcrumb`,className:`min-w-0 flex-1 overflow-hidden`,children:[(0,U.jsx)(t,{as:m,to:v(e.id,l),children:g.name}),(0,U.jsx)(t,{as:`span`,isCurrent:!0,children:`Routing`})]}):void 0});return(0,U.jsx)(o,{variant:`narrow`,header:(0,U.jsx)(`div`,{className:d(Q,`pb-8`),children:(0,U.jsxs)(r,{children:[(0,U.jsx)(r.Title,{children:`Routing`}),(0,U.jsxs)(r.Description,{children:[`The order boards are offered new issues and pull requests. What comes in is chosen in`,` `,(0,U.jsx)(m,{to:V(e.id,`intake`),className:`underline`,children:`Settings → Work Intake`}),`.`]})]})}),..._,children:(0,U.jsxs)(`div`,{className:d(Q,`flex flex-col gap-8`),children:[(0,U.jsx)(G,{factoryId:e.id}),(0,U.jsx)(X,{factoryId:e.id})]})})}export{$ as BoardIntakePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./Breadcrumb.es-0R_XL00x.js";import{t as r}from"./page-header-Maytcmgh--oRyXaDt.js";import{Dr as i,Fr as a,Lr as o,tn as s}from"./index-CXm1OtvB.js";import{A as c,a as l,p as u}from"./Sidebar.es-Bx7dX5pc.js";import{O as d,T as f,k as p,n as m}from"./IconChevronRightMedium.es-BjSIsine.js";import{t as h}from"./lib-Z1TxHc5t.js";import{r as g,t as _}from"./useBoardEditor-C9-FvIWD.js";import{i as v,r as y}from"./boardConfigPaths-CyCwKxS5.js";import{Gt as b,It as x,Mi as S,Rt as C,Ut as w,Vt as T,Wt as ee,t as E}from"./Notice-BhWgws6f-u2XtThO4.js";import{X as D}from"./request-D-8hZhxi.js";import{n as O}from"./useBoardCatalog-oA5VpTLX.js";import{A as k,C as te,E as A,T as ne,_ as j,a as re,b as ie,c as ae,d as M,g as N,h as oe,m as se,o as P,p as F,v as I,w as L,y as R}from"./conditionFields-CYADwcOD.js";import{a as ce,h as z,o as B,p as V,t as le,u as H}from"./board-events-DtlmhUQw.js";import{t as ue}from"./input-DqReKX0A-Ds0Cl3d5.js";import{n as U,t as W}from"./RadioGroup.es-BEydfTFj.js";import{t as G}from"./createLucideIcon-B6gALBEh.js";import{n as de,t as fe}from"./ConditionRows-BLnr6YQo.js";import{a as pe,t as me}from"./BoardIcons-GeX8LFoy.js";import{n as K}from"./IconPlugin1.es-jS0AvWmJ.js";import{a as q,i as he,n as ge,r as _e,t as J}from"./IntakeTesterDialog-BPuhOvLO.js";var ve={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};ve.node;var ye=G(ve),be={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};be.node;var xe=G(be),Se={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Se.node;var Ce=G(Se),we={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`]};we.node;var Te=G(we),Ee={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`]};Ee.node;var De=G(Ee),Oe={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Oe.node;var ke=G(Oe),Ae={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`]};Ae.node;var je=G(Ae),Me={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`]};Me.node;var Y=G(Me),X=e(p(),1);function Ne(e,t){if(!e)return;let n=t??e.initialPhase,r=e.phases.find(e=>e.id===n);return r?r.name??r.title:void 0}function Pe(e){return e.name??e.title}function Fe(e){return e?{"closedIssue.phase":e.phases.map(e=>({value:e.id,label:e.name??e.title}))}:{}}function Ie(e,t,n,r){let i=[...t],[a]=i.splice(n,1);if(a===void 0)return e.map(e=>e.id);i.splice(r,0,a);let o=new Set(t),s=0;return e.map(e=>o.has(e.id)?i[s++]??e.id:e.id)}var Z=d(),Le=`flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors`,Re=`border-border-focus bg-fill-hover`,ze=`border-border bg-fill-subtle hover:border-border-hover hover:bg-fill-hover`;function Be({selected:e,disabled:t,onClick:n,children:r}){return(0,Z.jsx)(`button`,{type:`button`,role:`checkbox`,"aria-checked":e,disabled:t,onClick:n,className:f(Le,`disabled:opacity-50`,e?Re:ze),children:r})}function Q({value:e,selected:t,disabled:n,onClick:r,children:i}){let a=(0,X.useId)();return(0,Z.jsxs)(`label`,{onClick:r,className:f(Le,`has-[[role=radio]:focus-visible]:outline-border-focus has-[[role=radio]:focus-visible]:outline-1 has-[[role=radio]:focus-visible]:outline-solid`,t?Re:ze,n?`cursor-not-allowed opacity-50`:`cursor-pointer`),children:[(0,Z.jsx)(U,{value:e,disabled:n,"aria-labelledby":a,className:`sr-only`}),(0,Z.jsx)(`span`,{id:a,className:`flex min-w-0 items-start gap-3`,children:i})]})}function Ve({boards:e,ownBoard:t,boardKey:n,phaseKey:r}){let i=e.find(e=>e.id===n);if(!i)return(0,Z.jsxs)(m,{as:`span`,variant:`caption`,tone:`muted`,children:[n,` (not installed)`]});let a=r??i.initialPhase,o=i.phases.find(e=>e.id===a);return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[i.id!==t&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(m,{as:`span`,variant:`caption`,className:`truncate`,children:Pe(i)}),(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`muted`,children:`›`})]}),o&&(0,Z.jsx)(me,{stage:o.id,kind:pe(i.id,o.kind),decorative:!0}),(0,Z.jsx)(m,{as:`span`,variant:`caption`,className:`truncate`,children:Ne(i,a)??a})]})}var He=120,Ue=H(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 We(e,t){let n=e?.phases??[];return t?n.filter(e=>e.kind!==`terminal`):n}function Ge(e,t){if(t){let e=Ue.safeParse(t);if(!e.success)return e.error.issues[0]?.message}return B(e,t)??void 0}function Ke(e,t,n){let r=`When ${e.map(e=>R(e).label.toLowerCase()).join(` or `)}${t?`, ${P(t).charAt(0).toLowerCase()}${P(t).slice(1)}`:``}, move to ${n}`;return r.length>He?`${r.slice(0,119)}…`:r}function qe({factoryId:e,board:t,boards:n,initial:r,initialEvent:i,initialStep:a,readOnly:o,saving:s,error:c,onSave:l,onClose:u}){let d=de(e),[p,h]=(0,X.useState)(()=>r?.on??(i?[i]:[])),[g,_]=(0,X.useState)(()=>r?.when??null),[v,y]=(0,X.useState)(()=>(r?.when?.conditions.length??0)>0),[D,O]=(0,X.useState)(!1),[k,A]=(0,X.useState)(()=>r?.target.moveToBoardKey??t.id),[ne,j]=(0,X.useState)(()=>r?r.target.phaseKey??void 0:void 0),[re,ie]=(0,X.useState)(()=>r?.name),[M,N]=(0,X.useState)(a),[oe,se]=(0,X.useState)(0),F=te(p),I=n.find(e=>e.id===k),L=We(I,F),z=L.find(e=>e.id===(ne??I?.initialPhase)),B=v?g:null,V=p.length?Ge(p,B):void 0,le=z&&I?`${Pe(I)} › ${Ne(I,z.id)}`:``,H=re??(z?Ke(p,B,le):``),U={trigger:p.length>0,conditions:p.length>0&&!(v&&D)&&!V,action:z!==void 0,review:H.trim().length>0},G=!o&&U.trigger&&U.conditions&&U.action&&U.review,K=$.findIndex(e=>e.id===M),q=$[K]??$[0],he=e=>{h(e),te(e)&&k!==t.id&&(A(t.id),j(void 0))},ge=()=>{G&&z&&l({name:H.trim(),on:p,when:B,target:{phaseKey:z.id,moveToBoardKey:k===t.id?null:k}})},_e=()=>{let e={field:`pullRequest.trusted`,operator:`equals`,value:!0};_(B===null?{operator:`AND`,conditions:[e]}:B.operator===`AND`?{...B,conditions:[...B.conditions,e]}:{operator:`AND`,conditions:[B,e]}),y(!0),O(!1),se(e=>e+1)},J={trigger:p.length?p.map(e=>R(e).label).join(`, `):void 0,conditions:p.length?P(B,Fe(t)):void 0,action:z?(0,Z.jsx)(Ve,{boards:n,ownBoard:t.id,boardKey:k,phaseKey:z.id}):void 0,review:void 0};return(0,Z.jsx)(x,{open:!0,onOpenChange:e=>!e&&u(),children:(0,Z.jsxs)(T,{size:`xl`,children:[(0,Z.jsx)(ee,{children:(0,Z.jsx)(b,{children:o?`Rule`:r?`Edit rule`:`Add rule`})}),(0,Z.jsx)(C,{children:(0,Z.jsxs)(`div`,{className:`grid min-h-105 grid-cols-1 gap-6 sm:grid-cols-[12rem_1fr]`,children:[(0,Z.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=>U[e.id]),r=U[e.id]&&e.id!==`review`;return(0,Z.jsxs)(`button`,{type:`button`,disabled:!n,"aria-current":M===e.id?`step`:void 0,onClick:()=>N(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`,M===e.id?`bg-fill-hover`:`hover:bg-fill-subtle`),children:[(0,Z.jsx)(m,{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,Z.jsx)(xe,{className:`size-icon-xs`,"aria-hidden":!0}):t+1}),(0,Z.jsxs)(`span`,{className:`min-w-0`,children:[(0,Z.jsx)(m,{as:`span`,variant:`label`,tone:`ink`,className:`block`,children:e.title}),J[e.id]&&(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`muted`,className:`hidden truncate sm:block`,children:J[e.id]})]})]},e.id)})}),(0,Z.jsxs)(`section`,{"aria-label":q.title,className:`flex min-w-0 flex-col gap-4`,children:[(0,Z.jsx)(m,{as:`h3`,variant:`heading`,children:q.question}),M===`trigger`&&(0,Z.jsx)(Xe,{value:p,disabled:o,onChange:he}),M===`conditions`&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(W,{"aria-label":`Which items`,value:v?`matching`:`every`,disabled:o,onValueChange:e=>{y(e===`matching`),O(!1)},className:`grid-cols-1 sm:grid-cols-2`,children:[(0,Z.jsx)(Q,{value:`every`,selected:!v,disabled:o,children:(0,Z.jsx)(Je,{title:F?`Every item`:`Every card`,hint:`Run whenever this happens.`})}),(0,Z.jsx)(Q,{value:`matching`,selected:v,disabled:o,children:(0,Z.jsx)(Je,{title:`Only ones that match`,hint:`Narrow it down by repository, label, author and more.`})})]}),v&&(0,Z.jsx)(`div`,{className:`border-border bg-fill-subtle rounded-xl border p-3`,children:(0,Z.jsx)(fe,{label:`Conditions`,rule:g,facts:ae(p),options:{...Fe(t),"source.repository":d},onChange:(e,t)=>{_(e),O(t)}},oe)}),V&&(0,Z.jsx)(E,{variant:`warning`,children:V}),!r?.outsiderPullRequestsGated&&ce(p,B)&&(0,Z.jsx)(E,{variant:`info`,children:(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{children:`Also matches pull requests from outside authors.`}),!o&&(0,Z.jsx)(`button`,{type:`button`,onClick:_e,className:`shrink-0 underline`,children:`Add: Pull request trusted is yes`})]})})]}),M===`action`&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[F?(0,Z.jsx)(m,{as:`p`,variant:`caption`,tone:`muted`,children:`An item with no card yet can only be filed on this board.`}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(m,{as:`span`,variant:`eyebrow`,tone:`muted`,children:`Board`}),(0,Z.jsx)(W,{"aria-label":`Board`,value:k,disabled:o,onValueChange:e=>{typeof e==`string`&&e!==k&&(A(e),j(void 0))},className:`grid-cols-1 sm:grid-cols-3`,children:n.map(e=>(0,Z.jsx)(Q,{value:e.id,selected:e.id===k,disabled:o,children:(0,Z.jsxs)(m,{as:`span`,variant:`label`,tone:`ink`,children:[Pe(e),e.id===t.id?` (this board)`:``]})},e.id))})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(m,{as:`span`,variant:`eyebrow`,tone:`muted`,children:`Phase`}),(0,Z.jsx)(W,{"aria-label":`Phase`,value:z?.id??null,disabled:o,onValueChange:e=>typeof e==`string`&&j(e),className:`grid-cols-1 sm:grid-cols-2`,children:I&&L.map(e=>(0,Z.jsx)(Q,{value:e.id,selected:e.id===z?.id,disabled:o,onClick:()=>{j(e.id),N(`review`)},children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(me,{stage:e.id,kind:pe(I.id,e.kind),decorative:!0}),(0,Z.jsx)(m,{as:`span`,variant:`label`,tone:`ink`,children:Ne(I,e.id)})]})},e.id))})]})]}),M===`review`&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(m,{as:`span`,variant:`label`,tone:`muted`,children:`Name`}),(0,Z.jsx)(ue,{value:H,maxLength:He,disabled:o,onChange:e=>ie(e.target.value)})]}),(0,Z.jsxs)(`div`,{className:`border-border bg-fill-subtle rounded-xl border p-4`,children:[(0,Z.jsx)(m,{as:`span`,variant:`eyebrow`,tone:`muted`,className:`mb-3 block`,children:`This rule reads as`}),(0,Z.jsxs)(`ol`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(Ye,{label:`When`,children:J.trigger}),(0,Z.jsx)(Ye,{label:`Only if`,children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Z.jsx)(De,{className:`text-muted-foreground size-icon-sm`,"aria-hidden":!0}),J.conditions]})}),(0,Z.jsx)(Ye,{label:`Then`,children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Move to `,(0,Z.jsx)(ye,{className:`size-icon-sm`,"aria-hidden":!0}),` `,J.action]})})]})]})]}),c&&(0,Z.jsx)(E,{variant:`destructive`,role:`alert`,children:c})]})]})}),(0,Z.jsxs)(w,{children:[(0,Z.jsx)(S,{variant:`ghost`,onClick:u,children:o?`Close`:`Cancel`}),(0,Z.jsx)(`div`,{className:`flex-1`}),K>0&&(0,Z.jsx)(S,{variant:`default`,onClick:()=>N($[K-1].id),children:`Back`}),!o&&(M===`review`||r&&G?(0,Z.jsx)(S,{variant:`primary`,disabled:!G||s,onClick:ge,children:s?`Saving…`:r?`Save rule`:`Create rule`}):(0,Z.jsx)(S,{variant:`primary`,disabled:!U[M],onClick:()=>N($[K+1]?.id??`review`),children:`Continue`}))]})]})})}function Je({title:e,hint:t}){return(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(m,{as:`span`,variant:`label`,tone:`ink`,className:`block`,children:e}),(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`muted`,className:`block`,children:t})]})}function Ye({label:e,children:t}){return(0,Z.jsxs)(`li`,{className:`grid grid-cols-[4.5rem_1fr] items-start gap-3`,children:[(0,Z.jsx)(m,{as:`span`,variant:`body-sm`,tone:`muted`,children:e}),(0,Z.jsx)(m,{as:`span`,variant:`body-sm`,children:t})]})}function Xe({value:e,disabled:t,onChange:n}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.includes(`work_item.created`)&&(0,Z.jsxs)(E,{variant:`info`,children:[`Also listens on “`,R(`work_item.created`).label,`”, which takes new work items and pull requests. Saving keeps it.`]}),M.map(r=>(0,Z.jsxs)(`div`,{role:`group`,"aria-label":r.title,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(m,{as:`span`,variant:`eyebrow`,tone:`muted`,children:r.title}),(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`,children:r.events.map(r=>{let i=R(r),a=i.icon,o=e.includes(r);return(0,Z.jsxs)(Be,{selected:o,disabled:t||o&&e.length===1,onClick:()=>n(o?e.filter(e=>e!==r):[...e,r]),children:[(0,Z.jsx)(a,{className:`text-badge-amber-indicator mt-0.5 size-4 shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(Je,{title:i.label,hint:i.description})]},r)})})]},r.title))]})}function Ze({when:e,options:t,everything:n}){let r=re(e,t);return!e||!r?(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`muted`,children:n}):(0,Z.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,Z.jsxs)(`span`,{className:`contents`,children:[n>0&&(0,Z.jsx)(m,{as:`span`,variant:`meta`,tone:`muted`,children:r.join}),a?(0,Z.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,Z.jsx)(m,{as:`span`,variant:`meta`,tone:`muted`,children:a.operator===`OR`?`any of`:`all of`}),(0,Z.jsx)(Qe,{children:t.replace(/^\((.*)\)$/,`$1`)})]}):(0,Z.jsx)(Qe,{children:t})]},n)})})}function Qe({children:e}){return(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`muted`,className:`bg-fill max-w-full truncate rounded-sm px-1.5 py-0.5`,children:e})}var $e=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 et({event:e,rules:t,board:n,boards:r,phaseOptions:i,canEdit:a,skips:o,note:s,footer:c,onEdit:l,onAdd:d,onMove:p,onToggle:h,onDelete:g,onUngate:_}){let v=R(e),y=v.icon,b=se(t,e),x=j(e),C=ge({min:0,max:t.length-1,onDrop:p}),w=c??(t.length?`Otherwise, the card stays where it is`:`No rules: the card stays where it is`);return(0,Z.jsxs)(`section`,{"aria-label":v.label,className:f(`grid grid-cols-1 gap-3 rounded-xl border border-border bg-card p-4 md:grid-cols-[13rem_1fr] md:gap-6`,!t.length&&`opacity-60 focus-within:opacity-100 hover:opacity-100`),children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 md:pt-1.5`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(y,{className:`text-badge-amber-indicator size-3.5 shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(m,{as:`h3`,variant:`label`,tone:`ink`,children:v.label})]}),v.description&&(0,Z.jsx)(m,{as:`p`,variant:`caption`,tone:`muted`,children:v.description}),s]}),(0,Z.jsxs)(`ol`,{"aria-label":`${v.label} rules`,className:`flex min-w-0 flex-col`,children:[t.map((s,c)=>{let d=L(t,e,c),v=d>=0,y=!s.enabled||v,w=C.drag?.from===c,T=o?.get(s.id);return(0,Z.jsxs)(`li`,{"aria-label":s.name,"data-drop":C.dropAt(c),style:w?{transform:`translateY(${C.drag?.offset??0}px)`}:void 0,onPointerDown:a&&t.length>1?e=>C.onPointerDown(e,c):void 0,className:f(`group flex flex-col`,$e,w&&`z-10 opacity-90`),children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Edit conditions of ${s.name}`,onClick:()=>l(s,`conditions`),onKeyDown:a?e=>C.onKeyDown(e,c):void 0,className:f(`flex w-full shrink-0 items-start gap-2.5 rounded-lg border bg-fill-subtle px-3 py-2 text-left transition-colors hover:border-border-hover sm:w-80`,y?`border-dashed border-border opacity-50`:`border-border`),children:[(0,Z.jsx)(m,{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:c+1}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(De,{className:`text-muted-foreground size-icon-xs shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`ink`,className:`truncate font-medium`,children:s.name})]}),(0,Z.jsx)(Ze,{when:s.when,options:i,everything:x?`Every new item`:`Every card`})]})]}),(0,Z.jsxs)(`div`,{className:f(`flex min-w-0 flex-1 items-center gap-2`,y&&`opacity-40`),children:[(0,Z.jsx)(m,{as:`span`,variant:`meta`,tone:`muted`,children:`yes`}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:f(`h-px min-w-6 flex-1`,y?`border-t border-dashed border-border-strong`:`bg-muted-foreground`)}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Edit where ${s.name} moves the card`,onClick:()=>l(s,`action`),className:`border-border bg-fill-subtle hover:border-border-hover flex w-40 shrink-0 rounded-lg border px-3 py-2 text-left sm:w-48`,children:(0,Z.jsx)(Ve,{boards:r,ownBoard:n.id,boardKey:s.target.moveToBoardKey??s.target.boardKey,phaseKey:s.target.phaseKey})})]}),a&&(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-0.5`,children:[(0,Z.jsxs)(`div`,{className:`flex transition-opacity pointer-fine:opacity-0 pointer-fine:group-focus-within:opacity-100 pointer-fine:group-hover:opacity-100`,children:[t.length>1&&(0,Z.jsx)(`span`,{"data-grip":!0,"aria-hidden":!0,className:`text-muted-foreground hidden cursor-grab touch-none items-center px-1 pointer-fine:flex`,children:(0,Z.jsx)(_e,{className:`size-icon-sm`})}),(0,Z.jsx)(S,{variant:`ghost`,size:`icon-sm`,tooltip:`Check earlier`,disabled:c===0,onClick:()=>p(c,c-1),children:(0,Z.jsx)(he,{})}),(0,Z.jsx)(S,{variant:`ghost`,size:`icon-sm`,tooltip:`Check later`,disabled:c===t.length-1,onClick:()=>p(c,c+1),children:(0,Z.jsx)(q,{})})]}),(0,Z.jsx)(K,{"aria-label":`${s.name} on`,checked:s.enabled,onCheckedChange:e=>h(s,e)}),(0,Z.jsxs)(u,{children:[(0,Z.jsx)(u.Trigger,{render:(0,Z.jsx)(S,{variant:`ghost`,size:`icon-sm`,tooltip:`More for ${s.name}`,children:(0,Z.jsx)(Te,{})})}),(0,Z.jsx)(u.Content,{align:`end`,children:(0,Z.jsxs)(u.Item,{variant:`destructive`,onClick:()=>g(s),children:[(0,Z.jsx)(je,{}),`Delete rule`]})})]})]})]}),y&&(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3 flex items-center gap-1.5`,children:v?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{className:`text-warning-indicator size-icon-xs`,"aria-hidden":!0}),`Never reached: rule `,d+1,` above matches every `,x?`item`:`card`,`.`]}):`Off, skipped`}),s.problems.map(e=>(0,Z.jsxs)(m,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3 flex items-center gap-1.5`,children:[(0,Z.jsx)(Y,{className:`text-warning-indicator size-icon-xs shrink-0`,"aria-hidden":!0}),e]},e)),T&&(0,Z.jsx)(nt,{skips:T}),ne(s,e)&&(0,Z.jsxs)(m,{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).`,a&&(0,Z.jsx)(`button`,{type:`button`,onClick:()=>_(s),className:`underline`,children:`Let outside authors match`})]}),ie(s,e)&&(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3`,children:`Moves cards only: files no new pull requests`}),x&&N(s)&&(0,Z.jsx)(m,{as:`span`,variant:`caption`,tone:`muted`,className:`mt-1 ml-3`,children:R(`work_item.created`).label}),c!==b&&(0,Z.jsxs)(`div`,{"aria-hidden":!0,className:`flex h-7 items-center pl-5.5`,children:[(0,Z.jsx)(`span`,{className:`bg-border-strong h-full w-px`}),(0,Z.jsx)(m,{as:`span`,variant:`meta`,tone:`muted`,className:`ml-2`,children:`no`})]})]},s.id)}),(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3`,children:[b<0&&(0,Z.jsxs)(m,{as:`span`,variant:`caption`,tone:`muted`,className:`flex items-center gap-2.5 px-3 py-1.5 sm:w-80`,children:[(0,Z.jsx)(Ce,{className:`size-icon-md shrink-0`,"aria-hidden":!0}),w]}),a&&(0,Z.jsx)(S,{variant:`ghost`,size:`sm`,icon:(0,Z.jsx)(ke,{}),onClick:d,children:`Add rule`})]})]})]})}function tt(e){return e?.match(/was skipped: (.+?)\.?$/)?.[1]??e??`its target couldn’t take the card`}function nt({skips:e}){let{count:t,latest:n}=e;return(0,Z.jsxs)(m,{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,Z.jsx)(Y,{className:`text-warning-indicator size-icon-xs shrink-0`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[`Skipped `,t===1?`once`:`${t} times`,` in the last 30 days: `,tt(n.reason),`.`]}),n.url?(0,Z.jsxs)(`a`,{href:n.url,target:`_blank`,rel:`noreferrer`,className:`underline`,children:[`Latest: `,n.title]}):(0,Z.jsxs)(`span`,{children:[`Latest: `,n.title]})]})}var rt=new Set([`revision_mismatch`,`intake_route_set_mismatch`,`intake_route_not_found`]);function it(e){return e instanceof _&&e.code!==void 0&&rt.has(e.code)}function at(e){return it(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=O(e),r=n.data?.find(e=>e.id===t);return n.isPending?(0,Z.jsx)(c,{className:`h-64 w-full`}):n.isError?(0,Z.jsx)(E,{variant:`destructive`,children:`Boards didn’t load.`}):r?(0,Z.jsx)(st,{factoryId:e,board:r,boards:n.data},`${e}:${r.id}`):(0,Z.jsx)(E,{variant:`warning`,children:`This board isn’t installed.`})}function st({factoryId:e,board:t,boards:n}){let r=V(e,t.id),i=A(e),a=k(e),o=z(e),[s,l]=(0,X.useState)(),u=(0,X.useRef)(void 0),d=e=>{u.current=e,l(e)},[f,p]=(0,X.useState)(),g=r.data?.intakeRoutes??[],_=r.data?.canEdit??!1,y=Fe(t),b=new Map(a.data?.skipped.map(e=>[e.routeId,e]));if(r.isPending)return(0,Z.jsx)(c,{className:`h-64 w-full`});if(r.isError)return(0,Z.jsx)(E,{variant:`destructive`,children:`This board’s rules didn’t load.`});let x=e=>o.mutateAsync(e).catch(e=>D.error(at(e))),S=(e,n,r)=>{let i=I(g,e).map(e=>e.id);x([{kind:`reorder`,boardKey:t.id,ids:Ie(g,i,n,r)}])},C=e=>{p(void 0),d(e)},w=async e=>{let n=u.current,r=n?.rule,i=()=>n!==void 0&&u.current===n;p(void 0);try{if(r)await o.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[n]=await o.mutateAsync([{kind:`create`,route:{...e,target:{boardKey:t.id,...e.target}}}]);i()&&d(void 0),n&&await ee(n,e.on).catch(e=>D.error(at(e)));return}i()&&d(void 0)}catch(e){if(!i())return;if(r&&it(e))return T(r);p(at(e))}},T=async e=>{let t=u.current,n=(await r.refetch()).data?.intakeRoutes.find(t=>t.id===e.id);t&&u.current===t&&(n?(d({...t,rule:n}),p(`Someone else changed this rule first. It now shows their version; make your change again.`)):(d(void 0),D.error(`Someone else deleted this rule first.`)))},ee=async(e,n)=>{if(e.target.boardKey!==t.id)return;let i=(await r.refetch()).data?.intakeRoutes??[],a=i.map(e=>e.id),s=a.indexOf(e.id),c=n.flatMap(t=>{let n=I(i,t),r=n[L(n,t,n.findIndex(t=>t.id===e.id))];return r?[a.indexOf(r.id)]:[]}),l=Math.min(...c);s<0||!(l<s)||await o.mutateAsync([{kind:`reorder`,boardKey:t.id,ids:Ie(i,a,s,l)}])},O=i.data?oe(i.data.boards,t.id):void 0,te=F(i.data?.boards,t.id);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[M.map(r=>(0,Z.jsxs)(`section`,{"aria-label":r.title,className:`flex flex-col gap-3`,children:[(0,Z.jsx)(m,{as:`h2`,variant:`subheading`,tone:`ink`,children:r.title}),r.events.map(r=>{let i=j(r),a=I(g,r);return(0,Z.jsx)(et,{event:r,rules:a,board:t,boards:n,phaseOptions:y,canEdit:_,skips:b,note:i?(0,Z.jsxs)(m,{as:`p`,variant:`caption`,tone:`muted`,children:[`Creates new work items:`,` `,O&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(h,{to:v(e,t.id,`intake-order`),className:`underline`,children:O.charAt(0).toLowerCase()+O.slice(1)}),`;`,` `]}),`first matching rule files it on this board.`]}):void 0,footer:i?te:void 0,onEdit:(e,t)=>C({rule:e,step:t}),onAdd:()=>C({event:r,step:`conditions`}),onMove:(e,t)=>S(r,e,t),onToggle:(e,t)=>void x([{kind:`update`,id:e.id,patch:{enabled:t,expectedRevision:e.revision}}]),onDelete:e=>void x([{kind:`delete`,id:e.id,expectedRevision:e.revision}]).then(t=>t&&D.success(`Deleted “${e.name}”`)),onUngate:e=>void x([{kind:`update`,id:e.id,patch:{outsiderPullRequestsGated:!1,expectedRevision:e.revision}}]).then(t=>t&&D.success(`“${e.name}” now matches outside authors’ pull requests`))},r)})]},r.title)),s&&(0,Z.jsx)(qe,{factoryId:e,board:t,boards:n,initial:s.rule,initialEvent:s.event,initialStep:s.step,readOnly:!_,saving:o.isPending,error:f,onSave:e=>void w(e),onClose:()=>d(void 0)},s.rule?`${s.rule.id}:${s.rule.revision}`:`new-${s.event}`)]})}var ct=`w-full`;function lt(){let e=i(),c=s()?.boardId??``,{isMobile:u,desktopState:d}=l(),p=u||d===`collapsed`,m=g(e.id,c).data?.board,_=a({breadcrumbs:p&&m?(0,Z.jsxs)(n,{label:`Breadcrumb`,className:`min-w-0 flex-1 overflow-hidden`,children:[(0,Z.jsx)(t,{as:h,to:y(e.id,c),children:m.name}),(0,Z.jsx)(t,{as:`span`,isCurrent:!0,children:`Rules`})]}):void 0});return(0,Z.jsx)(o,{variant:`narrow`,header:(0,Z.jsxs)(`div`,{className:f(ct,`pb-8`),children:[(0,Z.jsxs)(r,{children:[(0,Z.jsx)(r.Title,{children:`Rules`}),(0,Z.jsx)(r.Description,{children:`What happens to work items and pull requests on this board. In each lane the first matching rule wins. Only Work item opened and Pull request opened create work items; every other lane only sees work items already on this board, so a rule there can safely take every card.`})]}),(0,Z.jsx)(`div`,{className:`mt-3`,children:(0,Z.jsx)(J,{factoryProjectId:e.id,label:`Test an item`})})]}),..._,children:(0,Z.jsx)(`div`,{className:ct,children:(0,Z.jsx)(ot,{factoryId:e.id,boardId:c})})})}export{lt as BoardRulesPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ca as t,cn as n,na as r,sn as i}from"./Notice-BhWgws6f-u2XtThO4.js";import{O as a,T as o,k as s,o as c}from"./IconChevronRightMedium.es-BjSIsine.js";import{A as l}from"./Sidebar.es-Bx7dX5pc.js";import{Er as u}from"./index-CXm1OtvB.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,isCurrent:l,action:m,switcher:g,icon:_,isLoading:v,children:y,...b})=>{let x=a||`span`,S=!(!g||!l&&s),C=d.useRef(null);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`li`,{ref:C,className:o(`group flex h-control-sm min-w-0 items-center`,l?`shrink`:`shrink-0`,S&&`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)(x,{"aria-current":l?`page`:void 0,className:o(`inline-flex min-w-0 items-center gap-2 overflow-hidden rounded-full px-[.9em]`,r.sm,c,l?`max-w-xs cursor-default text-foreground`:S?o(n,`max-w-48`):o(i,`max-w-48 cursor-pointer hover:bg-fill-subtle active:bg-fill`),e),to:s,...b,children:[_&&(0,f.jsx)(t,{className:o(`ml-[-.3em] shrink-0 opacity-50 group-hover:opacity-100`,`transition-opacity duration-normal ease-out-custom`),children:_}),v?(0,f.jsx)(h,{}):(0,f.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:y})]}),g&&(0,f.jsx)(`span`,{"data-slot":`crumb-switcher`,className:o(`-ml-1 flex h-control-sm shrink-0 items-center`,S&&`[&_button]:bg-transparent! [&_button:enabled]:after:absolute [&_button:enabled]:after:inset-0 [&_button:enabled]:after:rounded-full`),children:(0,f.jsx)(u,{value:C,children:g})}),m&&(0,f.jsx)(`span`,{className:`-ml-1 flex h-control-sm shrink-0 items-center`,children:m})]}),!l&&(0,f.jsx)(`li`,{role:`separator`,className:`flex h-full items-center`,children:(0,f.jsx)(t,{className:`text-placeholder`,children:(0,f.jsx)(p,{})})})]})};export{g as n,m 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,k as a,m as o,o as s,s as c,u as l,v as u}from"./IconChevronRightMedium.es-BjSIsine.js";import{Ao as d,As as f,Bs as p,Eo as m,Ii as h,Is as g,Kn as _,Ls as v,Ma as y,Ms as b,No as x,Ps as S,Ri as C,Vi as w,an as T,ba as E,da as D,ds as O,fa as k,fc as A,fo as j,nc as M,ns as ee,pa as N,sn as P,ta as F,tc as I,ua as L,wn as te,zs as R}from"./Notice-BhWgws6f-u2XtThO4.js";import{a as ne,i as re,o as z,r as B,s as V}from"./request-D-8hZhxi.js";import{c as H,l as U,p as W,s as ie,v as ae}from"./Sidebar.es-Bx7dX5pc.js";import{n as oe,t as se}from"./CompositeRoot-Cd7voRpR.js";import{t as ce}from"./copy-button-5PzdvEQI-C3QsjfYO.js";import{n as le}from"./index.module-D3qeux6j.js";import{a as G,i as ue,m as de,n as fe}from"./dist-6WNNvkM4.js";import{t as K}from"./preload-helper-BLdHbfdN.js";var q=e(a(),1),J=t(),pe=y();function Y(e){let t=S(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=R(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(m(n)!==a||m(r)!==o)&&(n=a,r=o),{width:n,height:r}}var me=q.createContext(void 0);function he(){let e=q.useContext(me);if(e===void 0)throw Error(I(65));return e}var ge=q.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:s,nativeButton:c=!0,style:l,...u}=e,{value:p,getTabPanelIdByValue:m,onValueChange:h,orientation:g,tabActivationDirection:_}=U(),{activateOnFocus:v,registerTabResizeObserverElement:y,tabsListElement:S}=he(),{highlightedIndex:T,onHighlightedIndexChange:D}=w(),k=E(s),A=q.useMemo(()=>({disabled:r,id:k,value:a}),[r,k,a]),{compositeProps:j,compositeRef:N,index:P}=ae({metadata:A}),F=a===p,I=q.useRef(!1),L=q.useRef(null),te=x(e=>{L.current?.(),L.current=e?y(e):null});M(()=>{if(I.current){I.current=!1;return}if(!(F&&P>-1&&T!==P))return;let e=S;if(e!=null){let t=f(d(e));if(t&&b(e,t))return}r||D(P)},[F,P,T,D,r,S]);let{getButtonProps:R,buttonRef:ne}=C({disabled:r,native:c,focusableWhenDisabled:!0}),re=m(a),z=q.useRef(!1),B=q.useRef(!1);function V(e){h(a,O(ee,e.nativeEvent,void 0,{activationDirection:`none`}))}function W(e){F||r||V(e)}function ie(e){F||r||v&&(!z.current||B.current)&&V(e)}function se(e){if(F||r)return;z.current=!0,B.current=e.button===0;let t=d(e.currentTarget);function n(){z.current=!1,B.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return o(`button`,e,{state:{disabled:r,active:F,orientation:g,tabActivationDirection:_},ref:[t,ne,N,te],props:[j,{role:`tab`,"aria-controls":re,"aria-selected":F,id:k,onClick:W,onFocus:ie,onPointerDown:se,[oe]:F?``:void 0,onKeyDownCapture(){I.current=!0}},u,R],stateAttributesMapping:H})}),_e=()=>()=>{},ve=()=>!0,ye=()=>!1;function be(){return(0,pe.useSyncExternalStore)(_e,ve,ye)}function xe(){let[e,t]=q.useState(!1);return q.useEffect(()=>{t(!0)},[]),e}var Se=u(18)?be:xe;function Ce(){return!Se()}function we(e){let{script:t}=e,{nonce:n}=T();return Ce()?(0,J.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var Te=`--active-tab-left`,Ee=`--active-tab-right`,De=`--active-tab-top`,Oe=`--active-tab-bottom`,ke=`--active-tab-width`,Ae=`--active-tab-height`,je,Me={...H,activeTabPosition:()=>null,activeTabSize:()=>null},Ne=2,Pe=q.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...s}=e,{getTabElementBySelectedValue:c,orientation:l,tabActivationDirection:u,value:d}=U(),{tabsListElement:f,registerIndicatorUpdateListener:p}=he(),m=j();q.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}=Y(e),{width:r,height:i}=Y(f),a=e.getBoundingClientRect(),o=f.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1,l=Fe(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=Le(e);Math.abs(u-p.x-h)<=Ne&&Math.abs(d-p.y-_)<=Ne&&(h=u,_=d),y=t,b=n,g=f.scrollWidth-h-y,v=f.scrollHeight-_-b}}let S=x?{left:h,right:g,top:_,bottom:v}:null,C=x?{width:y,height:b}:null,w=x?{[Te]:`${h}px`,[Ee]:`${g}px`,[De]:`${_}px`,[Oe]:`${v}px`,[ke]:`${y}px`,[Ae]:`${b}px`}:void 0,T=o(`span`,e,{state:{orientation:l,activeTabPosition:S,activeTabSize:C,tabActivationDirection:u},ref:t,props:[{role:`presentation`,style:w,hidden:!(x&&y>0&&b>0)},s,{suppressHydrationWarning:!0}],stateAttributesMapping:Me});return d==null?null:(0,J.jsxs)(q.Fragment,{children:[T,i&&(je||=(0,J.jsx)(we,{script:``}))]})});function Fe(e,t){let n=Ie(e),r=Ie(t),i=n.left-r.left-t.clientLeft,a=n.top-r.top-t.clientTop,o=g(e);for(;R(o)&&o!==t&&!p(o);)i-=o.scrollLeft,a-=o.scrollTop,o=g(o);return{left:i,top:a}}function Ie(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 Le(e){let t=v(e).getComputedStyle(e),{x:n,y:r}=te(e,t),i=n,a=r,{translate:o}=t;if(o&&o!==`none`){let t=o.split(` `);i+=Re(t[0],e.offsetWidth),a+=Re(t[1],e.offsetHeight)}return{x:i,y:a}}function Re(e,t){if(!e)return 0;let n=parseFloat(e);return Number.isFinite(n)?e.endsWith(`%`)?n/100*t:n:0}var ze=q.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]=q.useState(0),[m,h]=q.useState(null),g=q.useRef(new Set),_=q.useRef(new Set),v=q.useRef(null);M(()=>{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 y=x(e=>(g.current.add(e),()=>{g.current.delete(e)})),b=x(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=q.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:m}),[n,y,b,m]);return(0,J.jsx)(me.Provider,{value:w,children:(0,J.jsx)(se,{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})})}),X=(0,q.createContext)(null),Be=(0,q.createContext)(null),Ve=A(`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 He(e,t){return e===`pill`?t?`h-[calc(100%-0.5rem)]`:`h-[calc(100%-0.25rem)]`:`h-full`}var Ue=({children:e,className:t,variant:r,size:a=`md`,sticky:o,style:s})=>{let c=r??`pill`,u=(0,q.useContext)(X),d=(0,q.useRef)(null),f=(0,q.useRef)(new Map),p=(0,q.useRef)(new Map),m=(0,q.useRef)(u?.value),[h,g]=(0,q.useState)(null),[v,y]=(0,q.useState)([]),b=(0,q.useCallback)(e=>{y(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)})},[]),x=(0,q.useCallback)(e=>y(t=>t.filter(t=>t.value!==e)),[]),S=u?.appearance===`contained`,C=c===`pill`&&!S,w=He(c,S);(0,q.useLayoutEffect)(()=>{let e=d.current;if(!e||!S)return;let t=()=>g(e.clientWidth);if(t(),!(`ResizeObserver`in globalThis))return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[S]);let T=S?4:0,E=S?30:0,O=(0,q.useMemo)(()=>{let e=new Set;if(!S||h===null||v.reduce((e,t)=>e+t.width,0)+T*Math.max(v.length-1,0)+E<=h)return e;let t=h-E-48,n=v.find(e=>e.value===u?.value);n&&(t-=n.width+T);let r=!1;for(let i of v)i!==n&&(r||i.width+T>t?(r=!0,e.add(i.value)):t-=i.width+T);return e},[S,h,v,T,E,u?.value]),A=v.filter(e=>O.has(e.value)),j=v.filter(e=>!O.has(e.value)).reduce((e,t)=>e+t.width+T,S?4:0),M=v.filter(e=>!O.has(e.value)&&e.onClose),ee=(0,q.useMemo)(()=>({variant:c,size:a,hiddenValues:O,register:b,unregister:x}),[c,a,O,b,x]);return(0,q.useLayoutEffect)(()=>{let e=new Map(p.current),t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;for(let n of v){if(O.has(n.value))continue;let r=n.element.offsetLeft,i=p.current.get(n.value),a=f.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!==u?.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())v.some(e=>e.value===t)||e.delete(t);p.current=e},[O,v,u?.value]),(0,q.useLayoutEffect)(()=>{let e=m.current;m.current=u?.value;let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;if(!S||e===u?.value||t)return;let n=d.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)`})},[S,u?.value]),(0,J.jsx)(Be.Provider,{value:ee,children:(0,J.jsx)(k,{delay:200,children:(0,J.jsxs)(`div`,{ref:d,"data-slot":`tabs-list-scroll`,className:n(`relative w-full overflow-x-auto`,o&&`sticky top-0 z-10 bg-background`),children:[(0,J.jsxs)(ze,{"data-slot":`tabs-list`,"data-overflow":A.length>0||void 0,"data-variant":c,"data-size":a,className:n(`group/tabs-list`,Ve({variant:c}),C&&n(F[a],`items-stretch p-0.5`),t),style:s,children:[e,(0,J.jsx)(Pe,{className:n(`absolute top-1/2 left-0 z-0 rounded-full bg-[var(--tab-indicator-color,var(--fill-hover))]`,w,`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,J.jsx)(`div`,{"data-slot":`tabs-close-actions`,children:M.map(e=>(0,J.jsx)(`div`,{ref:t=>{t?f.current.set(e.value,t):f.current.delete(e.value)},"data-slot":`tab-close-item`,"data-visible":u?.value===e.value||void 0,children:(0,J.jsxs)(L,{children:[(0,J.jsxs)(N,{render:(0,J.jsx)(`button`,{type:`button`,tabIndex:u?.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`,l.colors)}),children:[(0,J.jsxs)(`span`,{className:`sr-only`,children:[`Close `,e.label]}),(0,J.jsx)(_,{"aria-hidden":`true`,className:`size-icon-xs`})]}),(0,J.jsxs)(D,{children:[`Close `,e.label]})]})},e.value))}),A.length>0&&(0,J.jsx)(`div`,{"data-slot":`tabs-overflow`,style:{transform:`translateX(${j}px)`},className:`tabs-overflow`,children:(0,J.jsxs)(W,{children:[(0,J.jsxs)(W.Trigger,{"aria-label":`${A.length} more tabs`,variant:`ghost`,size:`sm`,className:`tabular-nums`,children:[`+`,A.length,(0,J.jsx)(i,{"aria-hidden":`true`,className:`size-icon-xs`})]}),(0,J.jsx)(W.Content,{children:A.map((e,t)=>(0,J.jsxs)(q.Fragment,{children:[(0,J.jsx)(W.Item,{"data-slot":`tabs-overflow-tab`,disabled:e.disabled,className:e.onClose?`pr-9`:void 0,style:{gridArea:`${t+1} / 1`},onClick:()=>{u?.select(e.value),e.onClick?.()},children:e.label}),e.onClose?(0,J.jsxs)(L,{children:[(0,J.jsxs)(N,{render:(0,J.jsx)(W.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,J.jsxs)(`span`,{className:`sr-only`,children:[`Close `,e.label]}),(0,J.jsx)(_,{"aria-hidden":`true`,className:`size-icon-xs`})]}),(0,J.jsxs)(D,{side:`right`,children:[`Close `,e.label]})]}):null]},e.value))})]})})]})})})},We=({children:e,defaultTab:t,value:r,onValueChange:i,appearance:a=`default`,frame:o=`inset`,className:s,...c})=>{let[l,u]=(0,q.useState)(t),d=r??l,f=e=>{u(e),i?.(e)};return(0,J.jsx)(X.Provider,{value:{appearance:a,value:d,select:f},children:(0,J.jsx)(ie,{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})})},Ge=({children:e,value:t,onClick:r,onClose:i,disabled:a,disabledTooltip:o,tooltip:l,attention:u=!1,className:d})=>{let f=(0,q.useContext)(Be),p=(0,q.useRef)(null),m=f?.register,g=f?.unregister,_=f?.hiddenValues.has(t)??!1;(0,q.useEffect)(()=>{let n=p.current;if(!n||!m)return;let o=()=>m({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()},[m,t,e,a,r,i]),(0,q.useEffect)(()=>()=>g?.(t),[g,t]);let v=f?.size??`md`,y=f?.variant===`pill-ghost`?n(h({variant:`ghost`,size:v}),`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`,P,u&&`relative`,`flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap outline-none`,s,c,`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),b=(0,J.jsxs)(ge,{ref:p,render:(0,J.jsx)(`div`,{}),nativeButton:!1,"data-overflowed":_||void 0,"aria-hidden":_||void 0,value:t,disabled:a||_,"data-slot":`tab`,"data-base-ui-swipe-ignore":``,"data-closable":i?``:void 0,className:y,onClick:r,children:[e,u&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`tab-attention`}),(0,J.jsx)(`span`,{className:`sr-only`,children:` Needs attention`})]})]});return a&&o?(0,J.jsxs)(L,{children:[(0,J.jsx)(N,{render:(0,J.jsx)(`span`,{tabIndex:0,className:`inline-flex`}),children:b}),(0,J.jsx)(D,{children:o})]}):l&&!a?(0,J.jsxs)(L,{children:[(0,J.jsx)(N,{render:b}),(0,J.jsx)(D,{children:l})]}):b},Ke={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 Z(e){let[{StreamLanguage:t},n]=await Promise.all([K(()=>import(`./dist-Sr6WSEaV.js`).then(e=>e.h),__vite__mapDeps([0,1,2])),e]);return t.define(n).parser}async function Q(e){let{javascript:t}=await K(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 qe={javascript:()=>Q({}),jsx:()=>Q({jsx:!0}),typescript:()=>Q({typescript:!0}),tsx:()=>Q({jsx:!0,typescript:!0}),json:()=>K(()=>import(`./dist-DtnqB3m_.js`).then(e=>e.t).then(e=>e.jsonLanguage.parser),__vite__mapDeps([5,1,4,2,0])),markdown:()=>K(()=>import(`./dist-CMX7_OjZ.js`).then(e=>e.t).then(e=>e.markdownLanguage.parser),__vite__mapDeps([6,1,0,2,3,4])),bash:()=>Z(K(()=>import(`./shell-DwuoZtxw.js`).then(e=>e.shell),[])),python:()=>Z(K(()=>import(`./python-DIWH3FmR.js`).then(e=>e.python),[])),yaml:()=>Z(K(()=>import(`./yaml-BEzOWJ7L.js`).then(e=>e.yaml),[])),diff:()=>Z(K(()=>import(`./diff-ChtP43wD.js`).then(e=>e.diff),[])),css:()=>Z(K(()=>import(`./css-CIHhKeSF.js`).then(e=>e.css),[])),html:()=>Z(K(()=>import(`./xml-aKzObEic.js`).then(e=>e.html),[])),xml:()=>Z(K(()=>import(`./xml-aKzObEic.js`).then(e=>e.xml),[])),sql:()=>Z(K(()=>import(`./sql-DrH7SW3s.js`).then(e=>e.standardSQL),[]))},$=new Map;function Je(e){let t=$.get(e);return t||(t=qe[e](),t.catch(()=>$.delete(e)),$.set(e,t)),t}var Ye=ue([{tag:[G.comment,G.bracket],class:`syntax-comment`},{tag:[G.string,G.meta,G.regexp,G.name,G.quote,G.standard(G.tagName)],class:`syntax-string`},{tag:[G.atom,G.bool,G.special(G.variableName)],class:`syntax-literal`},{tag:[G.keyword,G.operator,G.tagName,G.deleted],class:`syntax-keyword`},{tag:[G.function(G.propertyName),G.propertyName,G.variableName,G.number],class:`syntax-name`},{tag:[G.definition(G.variableName),G.function(G.variableName),G.className,G.attributeName,G.url],class:`syntax-definition`},{tag:G.link,class:`syntax-link`},{tag:G.heading,class:`syntax-heading`},{tag:G.emphasis,class:`syntax-emphasis`},{tag:G.strong,class:`syntax-strong`},{tag:G.strikethrough,class:`syntax-strike`},{tag:G.invalid,class:`syntax-invalid`}]);function Xe(e,t){if(!t||!e.startsWith(t.code))return;let n=t.code.length;return de.applyChanges(de.addTree(t.tree),[{fromA:n,toA:n,fromB:n,toB:e.length}])}async function Ze(e,t,n){let r=Ke[t?.toLowerCase()];if(!r)return null;let i=(await Je(r)).parse(e,Xe(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 fe(i,Ye,(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 Qe(e){let t=e?.split(`.`).pop()?.toLowerCase();return t?Ke[t]:void 0}var $e=75;function et(e,t){let[n,r]=(0,q.useState)(null),i=(0,q.useRef)(null),[a,o]=le(e,$e,{leading:!0,maxWait:$e});return(0,q.useEffect)(()=>()=>o.cancel(),[o]),(0,q.useEffect)(()=>{if(!t)return;let e=!1,n=i.current?.lang===t?i.current:void 0;return Ze(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 tt(e,t,n){return!e||e.lang!==n?null:t.startsWith(e.code)?e:null}var nt=q.memo(function({code:e,lang:t,lineClassName:n,...r}){let i=tt(et(e,t),e,t);if(!i){if(!n)return(0,J.jsx)(`pre`,{...r,children:e});let t=e.split(`
|
|
4
|
+
`);return(0,J.jsx)(`pre`,{...r,children:t.map((e,r)=>(0,J.jsxs)(q.Fragment,{children:[(0,J.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,J.jsx)(`pre`,{...r,children:(0,J.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,J.jsx)(`span`,{className:e.className,children:e.content},t)});return o=a+1,(0,J.jsxs)(q.Fragment,{children:[n?(0,J.jsx)(`span`,{"data-line":t,className:n(t,e.map(e=>e.content).join(``)),children:s}):(0,J.jsx)(`span`,{children:s}),t!==i.tokens.length-1&&`
|
|
6
|
+
`]},r)}),a]})})});function rt({code:e,options:t,value:r,onValueChange:i,selector:a=`select`,fileName:o,lang:s,overflow:c=`wrap`,copyMessage:u,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,J.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,J.jsx)(We,{defaultTab:_.value,value:v,onValueChange:i??(()=>{}),children:(0,J.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,J.jsx)(Ue,{children:t.map(e=>(0,J.jsx)(Ge,{value:e.value,children:e.label},e.value))})}),f&&(0,J.jsx)(`div`,{className:`flex shrink-0 items-center border-b border-border pr-2 pl-3`,children:f})]})}),g&&t&&(0,J.jsxs)(`div`,{className:`flex items-center border-b border-border px-2 py-1.5`,children:[(0,J.jsxs)(B,{value:v,onValueChange:i,children:[(0,J.jsx)(z,{size:`sm`,variant:`ghost`,className:`w-auto`,children:(0,J.jsx)(V,{})}),(0,J.jsx)(re,{children:t.map(e=>(0,J.jsx)(ne,{value:e.value,children:e.label},e.value))})]}),f&&(0,J.jsx)(`div`,{className:`ml-auto flex items-center`,children:f})]}),!m&&o&&(0,J.jsxs)(`div`,{className:`flex items-center border-b border-border px-4 py-2`,children:[(0,J.jsx)(`figcaption`,{className:`font-mono text-caption text-muted-foreground`,children:o}),f&&(0,J.jsx)(`div`,{className:`ml-auto flex items-center`,children:f})]}),!m&&!o&&f&&(0,J.jsx)(`div`,{className:`flex items-center justify-end border-b border-border px-2 py-1.5`,children:f}),(0,J.jsxs)(`div`,{className:`relative`,children:[(0,J.jsx)(nt,{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,J.jsx)(ce,{content:e,copyMessage:u,tooltip:d,className:n(`absolute top-2 right-2 opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 pointer-fine:opacity-0`,l.opacity)})]})]})}export{Ye as a,We as c,Qe as i,X as l,nt as n,Ge as o,et as r,Ue as s,rt as t};
|