@gobing-ai/spur 0.3.95 → 0.3.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/config/plugin-scripts.json +0 -54
  3. package/config/rules/boundary/sp-script-placement.yaml +19 -0
  4. package/config/rules/strict/runtime-boundaries.yaml +5 -0
  5. package/config/rules/structure/test-location.yaml +2 -0
  6. package/config/rules/typescript/no-syscall-emulation-in-boundary-mock.yaml +1 -1
  7. package/config/rules/typescript/output-boundaries.yaml +15 -2
  8. package/config/script-placement-baseline.json +51 -0
  9. package/config/workflows/feature-verification.yaml +1 -1
  10. package/config/workflows/history-anatomy.yaml +23 -11
  11. package/config/workflows/idea-pipeline.yaml +80 -85
  12. package/config/workflows/pr-review.yaml +18 -9
  13. package/config/workflows/task-pipeline.yaml +42 -95
  14. package/config/workflows/wrapup-pipeline.yaml +89 -37
  15. package/package.json +1 -1
  16. package/plugins/sp/README.md +8 -10
  17. package/plugins/sp/agents/super-reviewer.md +43 -18
  18. package/plugins/sp/commands/dev-fixgha.md +83 -0
  19. package/plugins/sp/commands/dev-gitmsg.md +8 -6
  20. package/plugins/sp/commands/dev-gtd.md +2 -2
  21. package/plugins/sp/commands/dev-idea.md +22 -12
  22. package/plugins/sp/commands/dev-plan.md +8 -9
  23. package/plugins/sp/commands/dev-review.md +22 -13
  24. package/plugins/sp/commands/dev-verifyall.md +1 -1
  25. package/plugins/sp/commands/spur-init.md +2 -2
  26. package/plugins/sp/lib/history-anatomy.generated.d.mts +112 -0
  27. package/plugins/sp/lib/history-anatomy.generated.mjs +686 -0
  28. package/plugins/sp/lib/idea-handoff.generated.mjs +5 -4
  29. package/plugins/sp/lib/inline-run.generated.d.mts +11 -0
  30. package/plugins/sp/lib/inline-run.generated.mjs +25 -8
  31. package/plugins/sp/lib/quality-gate.generated.d.mts +104 -0
  32. package/plugins/sp/lib/quality-gate.generated.mjs +438 -0
  33. package/plugins/sp/lib/residual-scan.generated.d.mts +62 -0
  34. package/plugins/sp/lib/residual-scan.generated.mjs +210 -0
  35. package/plugins/sp/lib/spur-bin.ts +36 -0
  36. package/plugins/sp/lib/step-profile.generated.d.mts +71 -0
  37. package/plugins/sp/lib/step-profile.generated.mjs +174 -0
  38. package/plugins/sp/plugin.json +1 -1
  39. package/plugins/sp/references/roles.md +1 -1
  40. package/plugins/sp/scripts/history-anatomy-cache.mjs +20 -19
  41. package/plugins/sp/scripts/history-anatomy-cache.ts +23 -928
  42. package/plugins/sp/scripts/inline-run-setup.mjs +85 -320
  43. package/plugins/sp/scripts/inline-run-setup.ts +104 -667
  44. package/plugins/sp/scripts/quality-gate.mjs +34 -19
  45. package/plugins/sp/scripts/quality-gate.ts +12 -658
  46. package/plugins/sp/scripts/residual-scan.mjs +135 -156
  47. package/plugins/sp/scripts/residual-scan.ts +102 -499
  48. package/plugins/sp/scripts/script-root.mjs +5 -1
  49. package/plugins/sp/scripts/script-root.ts +5 -1
  50. package/plugins/sp/scripts/workflow-step-profile.mjs +25 -17
  51. package/plugins/sp/scripts/workflow-step-profile.ts +21 -315
  52. package/plugins/sp/scripts/wrapup-drift-probe.mjs +8 -2
  53. package/plugins/sp/scripts/wrapup-drift-probe.ts +3 -2
  54. package/plugins/sp/scripts/wrapup-steps.mjs +10 -32
  55. package/plugins/sp/scripts/wrapup-steps.ts +8 -36
  56. package/plugins/sp/skills/code-improvement/SKILL.md +5 -4
  57. package/plugins/sp/skills/code-verification/SKILL.md +34 -9
  58. package/plugins/sp/skills/code-verification/references/verdict-schema.md +3 -3
  59. package/plugins/sp/skills/functional-review/SKILL.md +7 -4
  60. package/plugins/sp/skills/functional-review/references/verdict-schema.md +1 -1
  61. package/plugins/sp/skills/history-anatomy/references/modes.md +2 -1
  62. package/plugins/sp/skills/next-feature/references/handoff-routing.md +1 -1
  63. package/plugins/sp/skills/next-router/references/routing-table.md +1 -1
  64. package/plugins/sp/skills/spur-cli/SKILL.md +3 -3
  65. package/plugins/sp/skills/spur-cli/references/agent.md +10 -10
  66. package/plugins/sp/skills/spur-cli/references/features.md +17 -6
  67. package/plugins/sp/skills/spur-cli/references/init.md +17 -16
  68. package/plugins/sp/skills/spur-cli/references/self.md +3 -2
  69. package/plugins/sp/skills/spur-cli/references/serve.md +10 -10
  70. package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +21 -6
  71. package/plugins/sp/skills/spur-cli/references/tasks.md +14 -8
  72. package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +4 -3
  73. package/plugins/sp/skills/spur-dev/references/cross-cutting.md +11 -9
  74. package/plugins/sp/skills/spur-dev/references/decision-brief.md +1 -1
  75. package/plugins/sp/skills/spur-dev/references/dev-operations.md +86 -70
  76. package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +3 -3
  77. package/plugins/sp/skills/spur-dev/references/execution-batch.md +77 -34
  78. package/plugins/sp/skills/spur-dev/references/execution-workflow.md +5 -9
  79. package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +3 -3
  80. package/plugins/sp/skills/spur-dev/references/flag-glossary.md +31 -21
  81. package/plugins/sp/skills/spur-dev/references/gate-checklists.md +19 -19
  82. package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +4 -3
  83. package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +29 -3
  84. package/plugins/sp/skills/spur-doctor/SKILL.md +1 -1
  85. package/plugins/sp/skills/sys-architecture/SKILL.md +3 -2
  86. package/spur.js +1495 -369
  87. package/web/_astro/{BoardApp.Cpxntzad.js → BoardApp.BIjMatT1.js} +1 -1
  88. package/web/_astro/{BoardApp.BxJuwD7I.js → BoardApp.GvjIe9Z6.js} +42 -42
  89. package/web/_astro/{TaskDetail.C5bW4WGV.js → TaskDetail.BZM3EAFx.js} +1 -1
  90. package/web/_astro/{arc.CyjRvNMY.js → arc.HkRiZnoI.js} +1 -1
  91. package/web/_astro/{architectureDiagram-3BPJPVTR.B4lWRzJA.js → architectureDiagram-3BPJPVTR.BDdK-tgZ.js} +1 -1
  92. package/web/_astro/{blockDiagram-GPEHLZMM.Be38USQ2.js → blockDiagram-GPEHLZMM.CZ9kOBxx.js} +1 -1
  93. package/web/_astro/{c4Diagram-AAUBKEIU.DT9Fj5Qx.js → c4Diagram-AAUBKEIU.DXK9qeRD.js} +1 -1
  94. package/web/_astro/channel.DlhX2MEt.js +1 -0
  95. package/web/_astro/{chunk-2J33WTMH.SeSBWLg5.js → chunk-2J33WTMH.BTD2WeX5.js} +1 -1
  96. package/web/_astro/{chunk-4BX2VUAB.DoO4VE14.js → chunk-4BX2VUAB.Ci6Qbcvk.js} +1 -1
  97. package/web/_astro/{chunk-55IACEB6.DrmTFA53.js → chunk-55IACEB6.yl3zsj7p.js} +1 -1
  98. package/web/_astro/{chunk-727SXJPM.Bi-TUb_V.js → chunk-727SXJPM.ClXZsfyR.js} +1 -1
  99. package/web/_astro/{chunk-AQP2D5EJ.B-xp8Uhi.js → chunk-AQP2D5EJ.BmKWZBcP.js} +1 -1
  100. package/web/_astro/{chunk-FMBD7UC4.DGWrDnUU.js → chunk-FMBD7UC4.By30fcb7.js} +1 -1
  101. package/web/_astro/{chunk-ND2GUHAM._BagvPDy.js → chunk-ND2GUHAM.24NmrD-k.js} +1 -1
  102. package/web/_astro/{chunk-QZHKN3VN.VOboYWQ0.js → chunk-QZHKN3VN.BN4sKdcS.js} +1 -1
  103. package/web/_astro/{classDiagram-4FO5ZUOK.D_apfHS7.js → classDiagram-4FO5ZUOK.CJpoMPb5.js} +1 -1
  104. package/web/_astro/{classDiagram-v2-Q7XG4LA2.D_apfHS7.js → classDiagram-v2-Q7XG4LA2.CJpoMPb5.js} +1 -1
  105. package/web/_astro/{cose-bilkent-S5V4N54A.DNLU_L-x.js → cose-bilkent-S5V4N54A.BraxQ2Nt.js} +1 -1
  106. package/web/_astro/{cynefin-OW5HDTMX.D8borhV-.js → cynefin-OW5HDTMX.gzoU73oL.js} +1 -1
  107. package/web/_astro/{dagre-BM42HDAG.Uc0lvjcV.js → dagre-BM42HDAG.wyDfWySU.js} +1 -1
  108. package/web/_astro/{diagram-2AECGRRQ.DDIxtDBo.js → diagram-2AECGRRQ.h2_EbMxV.js} +1 -1
  109. package/web/_astro/{diagram-5GNKFQAL.DVoDnD3H.js → diagram-5GNKFQAL.Db6dcs89.js} +1 -1
  110. package/web/_astro/{diagram-KO2AKTUF.CRubTJ-0.js → diagram-KO2AKTUF.NVwzxu_U.js} +1 -1
  111. package/web/_astro/{diagram-LMA3HP47.m9SeYcXQ.js → diagram-LMA3HP47.B-eNgDQk.js} +1 -1
  112. package/web/_astro/{diagram-OG6HWLK6.C6s2ZjV5.js → diagram-OG6HWLK6.Bsa8ZRbJ.js} +1 -1
  113. package/web/_astro/{erDiagram-TEJ5UH35.nSzr5KTj.js → erDiagram-TEJ5UH35.BospRE5Q.js} +1 -1
  114. package/web/_astro/{flowDiagram-I6XJVG4X.DrZcys16.js → flowDiagram-I6XJVG4X.DMzvHwAA.js} +1 -1
  115. package/web/_astro/{ganttDiagram-6RSMTGT7.Do4M1b-K.js → ganttDiagram-6RSMTGT7.Dmdxgd-M.js} +1 -1
  116. package/web/_astro/{gitGraphDiagram-PVQCEYII.BWc9oJ4l.js → gitGraphDiagram-PVQCEYII.CaqdO0rL.js} +1 -1
  117. package/web/_astro/index.EoZlzLK-.css +1 -0
  118. package/web/_astro/{infoDiagram-5YYISTIA.BIdOctFk.js → infoDiagram-5YYISTIA.DDVD9Wn7.js} +1 -1
  119. package/web/_astro/{ishikawaDiagram-YF4QCWOH.CV5SuG2t.js → ishikawaDiagram-YF4QCWOH.EKyCUFsL.js} +1 -1
  120. package/web/_astro/{journeyDiagram-JHISSGLW.CxE-rEJ-.js → journeyDiagram-JHISSGLW.By2-RkYB.js} +1 -1
  121. package/web/_astro/{kanban-definition-UN3LZRKU.BPRdKWs_.js → kanban-definition-UN3LZRKU.ar-WmlyR.js} +1 -1
  122. package/web/_astro/{linear.zRsuuDTE.js → linear.BnzMBgo_.js} +1 -1
  123. package/web/_astro/{mermaid.core.jAJTcMKc.js → mermaid.core.DSqeFu2Y.js} +4 -4
  124. package/web/_astro/{mindmap-definition-RKZ34NQL.BffJxfCr.js → mindmap-definition-RKZ34NQL.1XcF8Wh2.js} +1 -1
  125. package/web/_astro/{pieDiagram-4H26LBE5.CacwWaE3.js → pieDiagram-4H26LBE5.DnItHOdK.js} +1 -1
  126. package/web/_astro/{quadrantDiagram-W4KKPZXB.hXELD06-.js → quadrantDiagram-W4KKPZXB.BQQyrnBt.js} +1 -1
  127. package/web/_astro/{requirementDiagram-4Y6WPE33.DdEbPcqT.js → requirementDiagram-4Y6WPE33.Dmzxun82.js} +1 -1
  128. package/web/_astro/{sankeyDiagram-5OEKKPKP.DgaDocKv.js → sankeyDiagram-5OEKKPKP.BBIeRKYB.js} +1 -1
  129. package/web/_astro/{sequenceDiagram-3UESZ5HK.B0KScnAu.js → sequenceDiagram-3UESZ5HK.CUNVdBBf.js} +1 -1
  130. package/web/_astro/{stateDiagram-AJRCARHV.CV9M_WNc.js → stateDiagram-AJRCARHV.DlFf2sJm.js} +1 -1
  131. package/web/_astro/{stateDiagram-v2-BHNVJYJU.BOAo74Et.js → stateDiagram-v2-BHNVJYJU.DXR7I1H5.js} +1 -1
  132. package/web/_astro/{timeline-definition-PNZ67QCA.CqqepUMe.js → timeline-definition-PNZ67QCA.BcO-GyX2.js} +1 -1
  133. package/web/_astro/{vennDiagram-CIIHVFJN.DDqe4dOG.js → vennDiagram-CIIHVFJN.ChCECmmW.js} +1 -1
  134. package/web/_astro/{wardleyDiagram-YWT4CUSO.B3R9OPdO.js → wardleyDiagram-YWT4CUSO.CRaT12mD.js} +1 -1
  135. package/web/_astro/{xychartDiagram-2RQKCTM6.B3SvgXpQ.js → xychartDiagram-2RQKCTM6.B3lsHVpj.js} +1 -1
  136. package/web/index.html +2 -2
  137. package/plugins/sp/lib/artifact-digest.generated.d.mts +0 -7
  138. package/plugins/sp/lib/artifact-digest.generated.mjs +0 -48
  139. package/plugins/sp/scripts/feature-sync-bounded.mjs +0 -301
  140. package/plugins/sp/scripts/feature-sync-bounded.ts +0 -481
  141. package/plugins/sp/scripts/idea-coverage-check.ts +0 -168
  142. package/plugins/sp/scripts/inline-pipeline-parity-check.ts +0 -298
  143. package/plugins/sp/scripts/record-feature-sync.mjs +0 -63
  144. package/plugins/sp/scripts/record-feature-sync.ts +0 -84
  145. package/plugins/sp/scripts/script-contract-check.ts +0 -506
  146. package/plugins/sp/scripts/stage-registry-adapter.ts +0 -1533
  147. package/plugins/sp/scripts/surface-drift-inventory.ts +0 -989
  148. package/plugins/sp/scripts/task-evidence-precheck.ts +0 -189
  149. package/plugins/sp/scripts/task-size-precheck.ts +0 -212
  150. package/plugins/sp/scripts/transition-shim-check.ts +0 -238
  151. package/plugins/sp/scripts/validate-commands.ts +0 -689
  152. package/plugins/sp/scripts/validate-flag-contracts.ts +0 -890
  153. package/plugins/sp/scripts/verify-answer-lint.ts +0 -549
  154. package/web/_astro/channel.CI6N_tCg.js +0 -1
  155. package/web/_astro/index.CENnIEqT.css +0 -1
@@ -1 +1 @@
1
- import{j as e}from"./jsx-runtime.DWOiEOII.js";import{u as ne,a as m,t as K,B as l,b as E,L as le,M as ie,c as de,S as ce,C as oe}from"./BoardApp.BxJuwD7I.js";import{r}from"./index.5dn-Zm-2.js";const xe={backlog:["refine","start","cancel"],todo:["plan","run","decompose","add-subtask","link-feature","block","cancel"],wip:["run","add-subtask","link-feature","block","cancel"],testing:["verify","complete","block","cancel"],blocked:["refine","unblock","cancel"],done:["reopen"],cancelled:[]},D={refine:"Refine",plan:"Plan",run:"Run",verify:"Verify",decompose:"Decompose","add-subtask":"+ Subtask","link-feature":"Link Feature",start:"Start",complete:"Complete",reopen:"Reopen",block:"Block",unblock:"Unblock",cancel:"Cancel"},ue={start:"todo",complete:"done",reopen:"wip",block:"blocked",unblock:"todo",cancel:"cancelled"},g=["backlog","todo","wip","testing","done"],pe=new Set(["blocked","cancelled"]);function be({task:a,onTransition:z,onClose:M}){const[f,h]=r.useState(""),[j,o]=r.useState(""),[T,x]=r.useState("preview"),[I,L]=r.useState(!1),[v,A]=r.useState(!1),[i,H]=r.useState({}),[b,U]=r.useState(!1),[w,B]=r.useState(null),[V,u]=r.useState(!1),[d,p]=r.useState(null),[_,W]=r.useState("claude"),[F,Y]=r.useState(!1),{setTasks:q}=ne(),N=a?.wbs;if(r.useEffect(()=>{if(!N){h(""),o(""),x("preview");return}let s=!1;return L(!0),m.task.show({wbs:N}).then(t=>{if(s)return;const{content:c,frontmatter:n}=t.data;h(c),o(c),H(n)}).catch(t=>{if(s)return;const c=t instanceof Error?t.message:"Failed to load task body";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:c}}))}).finally(()=>{s||L(!1)}),()=>{s=!0}},[N]),!a)return e.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Select a task to view details"});const G=()=>{o(f),x("edit")},J=()=>{o(f),x("preview")},Q=async()=>{A(!0);try{await m.task.body({wbs:a.wbs,body:j}),h(j),x("preview");const t=(await m.task.show({wbs:a.wbs})).data.content;h(t),o(t)}catch(s){o(f),x("preview");const t=s instanceof Error?s.message:"Save failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{A(!1)}},X=s=>{const t=ue[s];if(t!==void 0){if(s==="cancel"&&a){u(!0);return}a&&z(a.wbs,t);return}p(s)},Z=async()=>{if(!(!d||!a)){B(d),p(null);try{await m.task.action({wbs:a.wbs,action:d,channel:_,skipDeps:F});const s=await m.task.list({});q(s.data??[])}catch(s){const t=s instanceof Error?s.message:"Action failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{B(null)}}},ee=s=>{const t=g.indexOf(s);return t>=0?t:-1},P=s=>{if(!s)return"";try{const t=new Date(s);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}},R=s=>{if(!s)return"";try{const t=new Date(s);if(Number.isNaN(t.getTime()))return"";const c=Date.now()-t.getTime(),n=Math.floor(c/864e5);return n===0?"today":n===1?"yesterday":n<30?`${n}d ago`:n<365?`${Math.floor(n/30)}mo ago`:`${Math.floor(n/365)}y ago`}catch{return""}},y=Array.isArray(i.tags)?i.tags:[],k=P(i.created_at),se=R(i.created_at),C=P(i.updated_at),te=R(i.updated_at),$=ee(a.status),O=i.estimated_hours,S=i.impl_progress,ae=["planning","design","implementation","review","testing"],re=s=>s==="done"?"bg-spur-success":s==="in_progress"?"bg-spur-warning":"bg-spur-border";return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 p-3 border-b border-spur-border shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-1 overflow-hidden",children:[e.jsxs("h3",{className:"text-sm font-semibold text-spur-text truncate",children:[a.wbs," — ",a.name]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"header-chips",children:[e.jsxs("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted","data-testid":"status-pill",children:[K(a.status)," ",a.status]}),a.priority&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-surface-2 border border-spur-border text-xs text-spur-text-muted",children:a.priority}),a.featureId&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-surface-2 border border-spur-border text-xs text-spur-text-muted",children:a.featureId}),y.map(s=>e.jsx("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted",children:s},s))]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-1 shrink-0",children:[(xe[a.status]??[]).map(s=>e.jsx(l,{variant:s==="cancel"?"error":"accent",size:"xs",onClick:()=>X(s),disabled:w===s,"aria-label":D[s],children:w===s?"…":D[s]},s)),M&&e.jsx(l,{variant:"ghost",size:"xs",className:"text-spur-text-muted",onClick:M,"aria-label":"Close detail",children:"✕"})]})]}),e.jsxs("div",{className:"border-b border-spur-border shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>U(s=>!s),className:"flex items-center justify-between w-full p-3 text-xs font-semibold text-spur-text-muted uppercase tracking-wide hover:text-spur-text transition-colors","aria-expanded":b,children:[e.jsx("span",{children:"Metadata"}),e.jsxs("svg",{className:`w-3 h-3 transition-transform ${b?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("title",{children:b?"Collapse metadata":"Expand metadata"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),b&&e.jsxs("div",{className:"px-3 pb-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Status"}),e.jsxs("span",{className:"text-sm text-spur-text","data-testid":"metadata-status",children:[K(a.status)," ",a.status]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Progress"}),S?e.jsx("div",{className:"space-y-1",children:ae.map(s=>{const t=S[s]??"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-spur-text-muted w-20 shrink-0",children:s}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-spur-border overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${re(t)}`,style:{width:t==="done"?"100%":t==="in_progress"?"50%":"0%"}})}),e.jsx("span",{className:"text-[10px] text-spur-text-muted w-16 shrink-0",children:t})]},s)})}):pe.has(a.status)?e.jsx(E,{variant:"warning",size:"xs",children:a.status}):e.jsx("div",{className:"flex items-center gap-1",children:g.map((s,t)=>{const c=t<=$,n=t===$;return e.jsxs("div",{className:"flex items-center gap-1 flex-1 last:flex-none",children:[e.jsx("div",{className:`h-1.5 rounded-full flex-1 ${c?"bg-spur-accent":"bg-spur-border"} ${n?"ring-1 ring-spur-accent/50":""}`,title:s}),t<g.length-1&&e.jsx("span",{className:"text-[10px] text-spur-text-muted w-0"})]},s)})}),!S&&e.jsx("div",{className:"flex justify-between mt-0.5",children:g.map(s=>e.jsx("span",{className:"text-[10px] text-spur-text-muted",children:s},s))})]}),(k||C)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs text-spur-text-muted block",children:"Dates"}),k&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Created"}),e.jsx("span",{className:"text-spur-text",children:k}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",se,")"]})]}),C&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Updated"}),e.jsx("span",{className:"text-spur-text",children:C}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",te,")"]})]})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(s=>e.jsx(E,{variant:"outline",size:"xs",className:"text-spur-text-muted",children:s},s))})]}),e.jsxs("div",{className:"space-y-1.5",children:[a.priority&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Priority"}),e.jsx(E,{variant:"outline",size:"xs",children:a.priority})]}),O!==void 0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Est. Hours"}),e.jsxs("span",{className:"text-spur-text",children:[O,"h"]})]}),a.featureId&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Feature"}),e.jsx("span",{className:"text-spur-text",children:a.featureId})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"File"}),e.jsx("span",{className:"text-spur-text font-mono truncate",children:a.filePath})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-3","data-testid":"task-body-section",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 shrink-0",children:[e.jsx("span",{className:"text-xs font-semibold text-spur-text-muted uppercase tracking-wide",children:"Body"}),e.jsx("div",{className:"flex gap-1",children:T==="preview"?e.jsx(l,{variant:"ghost",size:"xs",onClick:G,disabled:I,"aria-label":"Edit body",children:"Edit"}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"primary",size:"xs",onClick:Q,disabled:v,"aria-label":"Save body",children:v?"Saving…":"Save"}),e.jsx(l,{variant:"ghost",size:"xs",onClick:J,disabled:v,"aria-label":"Cancel edit",children:"Cancel"})]})})]}),I?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-spur-text-muted",children:[e.jsx(le,{size:"xs",className:"text-spur-accent"}),"Loading body…"]}):T==="edit"?e.jsx("div",{className:"flex-1 min-h-0","data-testid":"body-editor",children:e.jsx(ie,{value:j,onChange:s=>o(s??""),height:"100%","data-color-mode":"light"})}):e.jsx("div",{className:"flex-1 overflow-y-auto","data-testid":"body-preview",children:e.jsx(de,{source:f})})]}),V&&e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Confirm cancel task",tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s=>{s.target===s.currentTarget&&u(!1)},onKeyDown:s=>{s.key==="Escape"&&u(!1)},children:e.jsxs("div",{className:"bg-spur-surface border border-spur-border rounded-xl shadow-xl p-4 mx-4 max-w-xs w-full",children:[e.jsxs("p",{className:"text-sm text-spur-text mb-4",children:["Cancel task ",e.jsx("strong",{children:a.wbs}),"? This marks it as cancelled and cannot be undone from the board."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>u(!1),children:"Keep"}),e.jsx(l,{variant:"error",size:"xs",onClick:()=>{u(!1),z(a.wbs,"cancelled")},children:"Cancel task"})]})]})}),d&&a&&e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":`Configure ${d} action`,tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s=>{s.target===s.currentTarget&&p(null)},onKeyDown:s=>{s.key==="Escape"&&p(null)},children:e.jsxs("div",{className:"bg-spur-surface border border-spur-border rounded-xl shadow-xl p-4 mx-4 max-w-sm w-full",children:[e.jsxs("h4",{className:"text-sm font-semibold text-spur-text mb-3",children:[D[d]??d," — Select Channel"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(ce,{variant:"bordered",size:"sm",className:"w-full bg-spur-bg text-spur-text",value:_,onChange:s=>W(s.target.value),children:["claude","codex","gemini","pi","opencode","antigravity","openclaw"].map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsxs("label",{htmlFor:"skip-deps",className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(oe,{id:"skip-deps",size:"xs",checked:F,onChange:s=>Y(s.target.checked)}),e.jsx("span",{className:"text-xs text-spur-text",children:"Skip dependencies"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>p(null),children:"Cancel"}),e.jsx(l,{variant:"primary",size:"xs",onClick:Z,children:w===d?"Dispatching…":"Dispatch"})]})]})})]})}export{be as default};
1
+ import{j as e}from"./jsx-runtime.DWOiEOII.js";import{u as ne,a as m,t as K,B as l,b as E,L as le,M as ie,c as de,S as ce,C as oe}from"./BoardApp.GvjIe9Z6.js";import{r}from"./index.5dn-Zm-2.js";const xe={backlog:["refine","start","cancel"],todo:["plan","run","decompose","add-subtask","link-feature","block","cancel"],wip:["run","add-subtask","link-feature","block","cancel"],testing:["verify","complete","block","cancel"],blocked:["refine","unblock","cancel"],done:["reopen"],cancelled:[]},D={refine:"Refine",plan:"Plan",run:"Run",verify:"Verify",decompose:"Decompose","add-subtask":"+ Subtask","link-feature":"Link Feature",start:"Start",complete:"Complete",reopen:"Reopen",block:"Block",unblock:"Unblock",cancel:"Cancel"},ue={start:"todo",complete:"done",reopen:"wip",block:"blocked",unblock:"todo",cancel:"cancelled"},g=["backlog","todo","wip","testing","done"],pe=new Set(["blocked","cancelled"]);function be({task:a,onTransition:z,onClose:M}){const[f,h]=r.useState(""),[j,o]=r.useState(""),[T,x]=r.useState("preview"),[I,L]=r.useState(!1),[v,A]=r.useState(!1),[i,H]=r.useState({}),[b,U]=r.useState(!1),[w,B]=r.useState(null),[V,u]=r.useState(!1),[d,p]=r.useState(null),[_,W]=r.useState("claude"),[F,Y]=r.useState(!1),{setTasks:q}=ne(),N=a?.wbs;if(r.useEffect(()=>{if(!N){h(""),o(""),x("preview");return}let s=!1;return L(!0),m.task.show({wbs:N}).then(t=>{if(s)return;const{content:c,frontmatter:n}=t.data;h(c),o(c),H(n)}).catch(t=>{if(s)return;const c=t instanceof Error?t.message:"Failed to load task body";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:c}}))}).finally(()=>{s||L(!1)}),()=>{s=!0}},[N]),!a)return e.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Select a task to view details"});const G=()=>{o(f),x("edit")},J=()=>{o(f),x("preview")},Q=async()=>{A(!0);try{await m.task.body({wbs:a.wbs,body:j}),h(j),x("preview");const t=(await m.task.show({wbs:a.wbs})).data.content;h(t),o(t)}catch(s){o(f),x("preview");const t=s instanceof Error?s.message:"Save failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{A(!1)}},X=s=>{const t=ue[s];if(t!==void 0){if(s==="cancel"&&a){u(!0);return}a&&z(a.wbs,t);return}p(s)},Z=async()=>{if(!(!d||!a)){B(d),p(null);try{await m.task.action({wbs:a.wbs,action:d,channel:_,skipDeps:F});const s=await m.task.list({});q(s.data??[])}catch(s){const t=s instanceof Error?s.message:"Action failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{B(null)}}},ee=s=>{const t=g.indexOf(s);return t>=0?t:-1},P=s=>{if(!s)return"";try{const t=new Date(s);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}},R=s=>{if(!s)return"";try{const t=new Date(s);if(Number.isNaN(t.getTime()))return"";const c=Date.now()-t.getTime(),n=Math.floor(c/864e5);return n===0?"today":n===1?"yesterday":n<30?`${n}d ago`:n<365?`${Math.floor(n/30)}mo ago`:`${Math.floor(n/365)}y ago`}catch{return""}},y=Array.isArray(i.tags)?i.tags:[],k=P(i.created_at),se=R(i.created_at),C=P(i.updated_at),te=R(i.updated_at),$=ee(a.status),O=i.estimated_hours,S=i.impl_progress,ae=["planning","design","implementation","review","testing"],re=s=>s==="done"?"bg-spur-success":s==="in_progress"?"bg-spur-warning":"bg-spur-border";return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 p-3 border-b border-spur-border shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-1 overflow-hidden",children:[e.jsxs("h3",{className:"text-sm font-semibold text-spur-text truncate",children:[a.wbs," — ",a.name]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"header-chips",children:[e.jsxs("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted","data-testid":"status-pill",children:[K(a.status)," ",a.status]}),a.priority&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-surface-2 border border-spur-border text-xs text-spur-text-muted",children:a.priority}),a.featureId&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-surface-2 border border-spur-border text-xs text-spur-text-muted",children:a.featureId}),y.map(s=>e.jsx("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted",children:s},s))]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-1 shrink-0",children:[(xe[a.status]??[]).map(s=>e.jsx(l,{variant:s==="cancel"?"error":"accent",size:"xs",onClick:()=>X(s),disabled:w===s,"aria-label":D[s],children:w===s?"…":D[s]},s)),M&&e.jsx(l,{variant:"ghost",size:"xs",className:"text-spur-text-muted",onClick:M,"aria-label":"Close detail",children:"✕"})]})]}),e.jsxs("div",{className:"border-b border-spur-border shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>U(s=>!s),className:"flex items-center justify-between w-full p-3 text-xs font-semibold text-spur-text-muted uppercase tracking-wide hover:text-spur-text transition-colors","aria-expanded":b,children:[e.jsx("span",{children:"Metadata"}),e.jsxs("svg",{className:`w-3 h-3 transition-transform ${b?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("title",{children:b?"Collapse metadata":"Expand metadata"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),b&&e.jsxs("div",{className:"px-3 pb-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Status"}),e.jsxs("span",{className:"text-sm text-spur-text","data-testid":"metadata-status",children:[K(a.status)," ",a.status]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Progress"}),S?e.jsx("div",{className:"space-y-1",children:ae.map(s=>{const t=S[s]??"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-spur-text-muted w-20 shrink-0",children:s}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-spur-border overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${re(t)}`,style:{width:t==="done"?"100%":t==="in_progress"?"50%":"0%"}})}),e.jsx("span",{className:"text-[10px] text-spur-text-muted w-16 shrink-0",children:t})]},s)})}):pe.has(a.status)?e.jsx(E,{variant:"warning",size:"xs",children:a.status}):e.jsx("div",{className:"flex items-center gap-1",children:g.map((s,t)=>{const c=t<=$,n=t===$;return e.jsxs("div",{className:"flex items-center gap-1 flex-1 last:flex-none",children:[e.jsx("div",{className:`h-1.5 rounded-full flex-1 ${c?"bg-spur-accent":"bg-spur-border"} ${n?"ring-1 ring-spur-accent/50":""}`,title:s}),t<g.length-1&&e.jsx("span",{className:"text-[10px] text-spur-text-muted w-0"})]},s)})}),!S&&e.jsx("div",{className:"flex justify-between mt-0.5",children:g.map(s=>e.jsx("span",{className:"text-[10px] text-spur-text-muted",children:s},s))})]}),(k||C)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs text-spur-text-muted block",children:"Dates"}),k&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Created"}),e.jsx("span",{className:"text-spur-text",children:k}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",se,")"]})]}),C&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Updated"}),e.jsx("span",{className:"text-spur-text",children:C}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",te,")"]})]})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(s=>e.jsx(E,{variant:"outline",size:"xs",className:"text-spur-text-muted",children:s},s))})]}),e.jsxs("div",{className:"space-y-1.5",children:[a.priority&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Priority"}),e.jsx(E,{variant:"outline",size:"xs",children:a.priority})]}),O!==void 0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Est. Hours"}),e.jsxs("span",{className:"text-spur-text",children:[O,"h"]})]}),a.featureId&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Feature"}),e.jsx("span",{className:"text-spur-text",children:a.featureId})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"File"}),e.jsx("span",{className:"text-spur-text font-mono truncate",children:a.filePath})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-3","data-testid":"task-body-section",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 shrink-0",children:[e.jsx("span",{className:"text-xs font-semibold text-spur-text-muted uppercase tracking-wide",children:"Body"}),e.jsx("div",{className:"flex gap-1",children:T==="preview"?e.jsx(l,{variant:"ghost",size:"xs",onClick:G,disabled:I,"aria-label":"Edit body",children:"Edit"}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"primary",size:"xs",onClick:Q,disabled:v,"aria-label":"Save body",children:v?"Saving…":"Save"}),e.jsx(l,{variant:"ghost",size:"xs",onClick:J,disabled:v,"aria-label":"Cancel edit",children:"Cancel"})]})})]}),I?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-spur-text-muted",children:[e.jsx(le,{size:"xs",className:"text-spur-accent"}),"Loading body…"]}):T==="edit"?e.jsx("div",{className:"flex-1 min-h-0","data-testid":"body-editor",children:e.jsx(ie,{value:j,onChange:s=>o(s??""),height:"100%","data-color-mode":"light"})}):e.jsx("div",{className:"flex-1 overflow-y-auto","data-testid":"body-preview",children:e.jsx(de,{source:f})})]}),V&&e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Confirm cancel task",tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s=>{s.target===s.currentTarget&&u(!1)},onKeyDown:s=>{s.key==="Escape"&&u(!1)},children:e.jsxs("div",{className:"bg-spur-surface border border-spur-border rounded-xl shadow-xl p-4 mx-4 max-w-xs w-full",children:[e.jsxs("p",{className:"text-sm text-spur-text mb-4",children:["Cancel task ",e.jsx("strong",{children:a.wbs}),"? This marks it as cancelled and cannot be undone from the board."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>u(!1),children:"Keep"}),e.jsx(l,{variant:"error",size:"xs",onClick:()=>{u(!1),z(a.wbs,"cancelled")},children:"Cancel task"})]})]})}),d&&a&&e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":`Configure ${d} action`,tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s=>{s.target===s.currentTarget&&p(null)},onKeyDown:s=>{s.key==="Escape"&&p(null)},children:e.jsxs("div",{className:"bg-spur-surface border border-spur-border rounded-xl shadow-xl p-4 mx-4 max-w-sm w-full",children:[e.jsxs("h4",{className:"text-sm font-semibold text-spur-text mb-3",children:[D[d]??d," — Select Channel"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(ce,{variant:"bordered",size:"sm",className:"w-full bg-spur-bg text-spur-text",value:_,onChange:s=>W(s.target.value),children:["claude","codex","gemini","pi","opencode","antigravity","openclaw"].map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsxs("label",{htmlFor:"skip-deps",className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(oe,{id:"skip-deps",size:"xs",checked:F,onChange:s=>Y(s.target.checked)}),e.jsx("span",{className:"text-xs text-spur-text",children:"Skip dependencies"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>p(null),children:"Cancel"}),e.jsx(l,{variant:"primary",size:"xs",onClick:Z,children:w===d?"Dispatching…":"Dispatch"})]})]})})]})}export{be as default};
@@ -1 +1 @@
1
- import{$ as ln,a0 as an,a1 as G,a2 as q,a3 as z,a4 as un,a5 as y,a6 as tn,a7 as K,a8 as _,a9 as rn,aa as o,ab as on,ac as sn,ad as fn}from"./mermaid.core.jAJTcMKc.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,B,a){var O=I-l,i=D-h,n=B-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function V(l,h,I,D,v,A,B){var a=l-I,O=h-D,i=(B?A:-A)/K(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,C=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*K(on(0,T*T*R-P*P)),$=(P*g-m*S)/R,j=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=$-C,e=j-t,r=w-C,F=p-t;return x*x+e*e>r*r+F*F&&($=w,j=p),{cx:$,cy:j,x01:-n,y01:-d,x11:$*(v/T-1),y11:j*(v/T-1)}}function hn(){var l=cn,h=yn,I=z(0),D=null,v=gn,A=dn,B=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,C=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(C>tn-y)a.moveTo(s*G(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*G(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=C,S=C,$=B.apply(this,arguments)/2,j=$>y&&(D?+D.apply(this,arguments):K(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(j>y){var F=sn(j/u*q($)),L=sn(j/s*q($));(P-=F*2)>y?(F*=t?1:-1,R+=F,T-=F):(P=0,R=T=(f+c)/2),(S-=L*2)>y?(L*=t?1:-1,m+=L,g-=L):(S=0,m=g=(f+c)/2)}var H=s*G(m),J=s*q(m),M=u*G(T),N=u*q(T);if(w>y){var Q=s*G(g),U=s*q(g),W=u*G(R),X=u*q(R),E;if(C<an)if(E=pn(H,J,W,X,Q,U,M,N)){var Y=H-E[0],Z=J-E[1],b=Q-E[0],k=U-E[1],nn=1/q(fn((Y*b+Z*k)/(K(Y*Y+Z*Z)*K(b*b+k*k)))/2),en=K(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=V(W,X,H,J,s,x,t),r=V(Q,U,M,N,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(H,J),a.arc(0,0,s,m,g,!t)):a.moveTo(H,J),!(u>y)||!(P>y)?a.lineTo(M,N):p>y?(e=V(M,N,Q,U,u,-p,t),r=V(H,J,W,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[G(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:z(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:z(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:z(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:z(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:z(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:z(+n),i):A},i.padAngle=function(n){return arguments.length?(B=typeof n=="function"?n:z(+n),i):B},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{$ as ln,a0 as an,a1 as G,a2 as q,a3 as z,a4 as un,a5 as y,a6 as tn,a7 as K,a8 as _,a9 as rn,aa as o,ab as on,ac as sn,ad as fn}from"./mermaid.core.DSqeFu2Y.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,B,a){var O=I-l,i=D-h,n=B-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function V(l,h,I,D,v,A,B){var a=l-I,O=h-D,i=(B?A:-A)/K(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,C=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*K(on(0,T*T*R-P*P)),$=(P*g-m*S)/R,j=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=$-C,e=j-t,r=w-C,F=p-t;return x*x+e*e>r*r+F*F&&($=w,j=p),{cx:$,cy:j,x01:-n,y01:-d,x11:$*(v/T-1),y11:j*(v/T-1)}}function hn(){var l=cn,h=yn,I=z(0),D=null,v=gn,A=dn,B=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,C=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(C>tn-y)a.moveTo(s*G(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*G(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=C,S=C,$=B.apply(this,arguments)/2,j=$>y&&(D?+D.apply(this,arguments):K(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(j>y){var F=sn(j/u*q($)),L=sn(j/s*q($));(P-=F*2)>y?(F*=t?1:-1,R+=F,T-=F):(P=0,R=T=(f+c)/2),(S-=L*2)>y?(L*=t?1:-1,m+=L,g-=L):(S=0,m=g=(f+c)/2)}var H=s*G(m),J=s*q(m),M=u*G(T),N=u*q(T);if(w>y){var Q=s*G(g),U=s*q(g),W=u*G(R),X=u*q(R),E;if(C<an)if(E=pn(H,J,W,X,Q,U,M,N)){var Y=H-E[0],Z=J-E[1],b=Q-E[0],k=U-E[1],nn=1/q(fn((Y*b+Z*k)/(K(Y*Y+Z*Z)*K(b*b+k*k)))/2),en=K(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=V(W,X,H,J,s,x,t),r=V(Q,U,M,N,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(H,J),a.arc(0,0,s,m,g,!t)):a.moveTo(H,J),!(u>y)||!(P>y)?a.lineTo(M,N):p>y?(e=V(M,N,Q,U,u,-p,t),r=V(H,J,W,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[G(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:z(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:z(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:z(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:z(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:z(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:z(+n),i):A},i.padAngle=function(n){return arguments.length?(B=typeof n=="function"?n:z(+n),i):B},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};