@kabmo-labs/kabmo 0.54.0 → 0.55.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.
Files changed (130) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +445 -445
  3. package/dist/client/static/js/{Body-x5grdps8.js → Body-a4dwe3hh.js} +1 -1
  4. package/dist/client/static/js/{CsvGrid-248v9yzf.js → CsvGrid-ppj80brw.js} +1 -1
  5. package/dist/client/static/js/{DocxView-5we92k2h.js → DocxView-ef0bd2pg.js} +1 -1
  6. package/dist/client/static/js/{DrawioView-c6xmw4qq.js → DrawioView-44tpkzbd.js} +1 -1
  7. package/dist/client/static/js/{HtmlPreview-r3qxgqg6.js → HtmlPreview-w654aykz.js} +1 -1
  8. package/dist/client/static/js/{ImageView-cr4fea18.js → ImageView-kg0skt5s.js} +1 -1
  9. package/dist/client/static/js/{LayoutWrapper-j12z0djx.js → LayoutWrapper-qepkrtd8.js} +1 -1
  10. package/dist/client/static/js/MergeDiffView-n2h8vv0j.js +1 -0
  11. package/dist/client/static/js/{Modal-cqceypcn.js → Modal-8d299emm.js} +16 -16
  12. package/dist/client/static/js/{PdfView-xdgn31cm.js → PdfView-eq7fnqa2.js} +1 -1
  13. package/dist/client/static/js/{SessionsView-ms6z44e2.js → SessionsView-tedh2es3.js} +1 -1
  14. package/dist/client/static/js/{SheetView-peqm9vft.js → SheetView-5xm33kgk.js} +1 -1
  15. package/dist/client/static/js/{SvgPreview-rdf4wbzr.js → SvgPreview-tp1m8r4t.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-48z2x5vg.js → abnfDiagram-O67JEVCF-xppr9jf1.js} +1 -1
  17. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-n1pr5s6j.js → architectureDiagram-NJMV4G6O-s23e6vtk.js} +1 -1
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-p19shaft.js → blockDiagram-BEXU5L5S-7ws8yq9e.js} +1 -1
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-qcd46ts2.js → c4Diagram-YGBWAQC7-517yhfzj.js} +1 -1
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-scyhe133.js → classDiagram-v2-NBCMYWYE-tcad3rst.js} +1 -1
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-srnnj3f7.js → cose-bilkent-JH36ORCC-a76vf82p.js} +1 -1
  22. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-1zfrnyay.js → cynefinDiagram-VND7K2PF-9kety453.js} +1 -1
  23. package/dist/client/static/js/{dagre-6A5THRUB-hepk25pz.js → dagre-6A5THRUB-6g6gsp6b.js} +1 -1
  24. package/dist/client/static/js/{diagram-22UHCM2B-wy2y0323.js → diagram-22UHCM2B-ngj4fyg3.js} +1 -1
  25. package/dist/client/static/js/{diagram-3UASUU5V-j904f93p.js → diagram-3UASUU5V-xw2m99qa.js} +1 -1
  26. package/dist/client/static/js/{diagram-ATOU4E4O-2mmxccm2.js → diagram-ATOU4E4O-hz3bd083.js} +1 -1
  27. package/dist/client/static/js/{diagram-CDSNMT55-cfhk73ty.js → diagram-CDSNMT55-vfhtemve.js} +1 -1
  28. package/dist/client/static/js/{diagram-MLGK6HIB-ryf8j6hf.js → diagram-MLGK6HIB-22cjvj5g.js} +1 -1
  29. package/dist/client/static/js/{diagram-MPIPVDR6-8k5e36sd.js → diagram-MPIPVDR6-xv8fsecp.js} +1 -1
  30. package/dist/client/static/js/{dockerfile-1e7deann.js → dockerfile-491tyqmj.js} +1 -1
  31. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-5kkbbbhv.js → ebnfDiagram-ZINNZB2B-m6mkn986.js} +1 -1
  32. package/dist/client/static/js/{elk-276RUBZZ-jqc4mzvc.js → elk-276RUBZZ-jccw706n.js} +1 -1
  33. package/dist/client/static/js/{erDiagram-OPXOYQCR-kx15t6f0.js → erDiagram-OPXOYQCR-rxk86jsf.js} +1 -1
  34. package/dist/client/static/js/flowDiagram-KWPJA3E3-aegwx04w.js +1 -0
  35. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-3hv8pej4.js → ganttDiagram-FUAMR5RP-veweech7.js} +1 -1
  36. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-a4mq8vwz.js → gitGraphDiagram-X574FWY7-7dyqcj8r.js} +1 -1
  37. package/dist/client/static/js/{index-1ye834yz.js → index-088gwjbz.js} +1 -1
  38. package/dist/client/static/js/{index-k4kwrze2.js → index-0ak5wdz1.js} +1 -1
  39. package/dist/client/static/js/{index-937bn0d2.js → index-0qmpqtp2.js} +1 -1
  40. package/dist/client/static/js/{index-40fdtqvw.js → index-0xh8402w.js} +1 -1
  41. package/dist/client/static/js/{index-0z7kerp1.js → index-2asa0faw.js} +1 -1
  42. package/dist/client/static/js/{index-w4dep7k6.js → index-2cfw7wem.js} +1 -1
  43. package/dist/client/static/js/{index-0j5ng1qc.js → index-39mr4tym.js} +1 -1
  44. package/dist/client/static/js/{index-kvker1ps.js → index-3x88fxzj.js} +1 -1
  45. package/dist/client/static/js/{index-8hnem33f.js → index-4m94cbms.js} +1 -1
  46. package/dist/client/static/js/{index-9gddw5qy.js → index-5701gj1f.js} +1 -1
  47. package/dist/client/static/js/{index-m85c740p.js → index-60fjqzdw.js} +1 -1
  48. package/dist/client/static/js/{index-exyg9sna.js → index-637my5h0.js} +1 -1
  49. package/dist/client/static/js/{index-jvn2xfpt.js → index-7ckzdf4r.js} +153 -151
  50. package/dist/client/static/js/{index-317v49ey.js → index-7ehep28z.js} +1 -1
  51. package/dist/client/static/js/{index-br27jz2t.js → index-bfy437re.js} +1 -1
  52. package/dist/client/static/js/{index-vxe4e903.js → index-bhst1c2x.js} +1 -1
  53. package/dist/client/static/js/{index-9cr6p86f.js → index-cz80n8yc.js} +1 -1
  54. package/dist/client/static/js/{index-demg0p74.js → index-d9dz0wt0.js} +1 -1
  55. package/dist/client/static/js/{index-51wzt3ma.js → index-dg714jam.js} +1 -1
  56. package/dist/client/static/js/{index-n3cts2j1.js → index-e6tjaccf.js} +1 -1
  57. package/dist/client/static/js/{index-eb43hnd3.js → index-gsw1zh30.js} +1 -1
  58. package/dist/client/static/js/{index-3kenmzbe.js → index-j0qt8gaj.js} +1 -1
  59. package/dist/client/static/js/{index-pszsxhjr.js → index-kfcpkx7h.js} +1 -1
  60. package/dist/client/static/js/{index-v90zd3sq.js → index-na95tr1k.js} +1 -1
  61. package/dist/client/static/js/{index-g3x4w48f.js → index-nzjc24v9.js} +1 -1
  62. package/dist/client/static/js/{index-n5194pe6.js → index-pqmvhqmj.js} +2 -2
  63. package/dist/client/static/js/{index-e2y4hkps.js → index-r51fqzb5.js} +1 -1
  64. package/dist/client/static/js/{index-40ydm28n.js → index-sx5x2q80.js} +1 -1
  65. package/dist/client/static/js/{index-p8bta9ae.js → index-tk1vr8q2.js} +1 -1
  66. package/dist/client/static/js/{index-x5c5yxhj.js → index-trpn9gxs.js} +1 -1
  67. package/dist/client/static/js/{index-01rdknec.js → index-twjq786a.js} +1 -1
  68. package/dist/client/static/js/{index-fanhvjk8.js → index-wa234c7k.js} +1 -1
  69. package/dist/client/static/js/{index-rtfw07hy.js → index-wp7tsava.js} +1 -1
  70. package/dist/client/static/js/{index-kz5d00m5.js → index-wvqwzgpx.js} +1 -1
  71. package/dist/client/static/js/{index-xhcbaaga.js → index-xbvjpa60.js} +2 -2
  72. package/dist/client/static/js/{index-n4pm0hrh.js → index-xm3691yp.js} +1 -1
  73. package/dist/client/static/js/{index-kevqayd9.js → index-xq78fj64.js} +1 -1
  74. package/dist/client/static/js/{index-bf54x0w8.js → index-zjc8yfbe.js} +1 -1
  75. package/dist/client/static/js/{infoDiagram-VRGFBTTK-wtnqb06v.js → infoDiagram-VRGFBTTK-ksz9cvq3.js} +1 -1
  76. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-eta0jnvr.js → ishikawaDiagram-OU5B5YK6-g8symmrp.js} +1 -1
  77. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-4e572kkp.js → journeyDiagram-ZHPQQLJL-qs2e3hdf.js} +1 -1
  78. package/dist/client/static/js/{kanban-definition-PNTS6WVX-yrtnn4zy.js → kanban-definition-PNTS6WVX-pzef80sz.js} +1 -1
  79. package/dist/client/static/js/{mermaid.core-195b0fb6.js → mermaid.core-chfcvkkc.js} +2 -2
  80. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-pphjnkvt.js → mindmap-definition-NLK3R4M7-sds2e243.js} +1 -1
  81. package/dist/client/static/js/one-dark-pro-5fvhpb1t.js +1 -0
  82. package/dist/client/static/js/one-light-pwj40vbr.js +1 -0
  83. package/dist/client/static/js/{pegDiagram-GJSIUBJH-kgffb9p3.js → pegDiagram-GJSIUBJH-m8199cy0.js} +1 -1
  84. package/dist/client/static/js/{pieDiagram-5QR66LMP-efech3mm.js → pieDiagram-5QR66LMP-wqz5k5w6.js} +1 -1
  85. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-khf9cv3t.js → quadrantDiagram-O4NWA36T-rjszd8an.js} +1 -1
  86. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-ye68kdx2.js → railroadDiagram-XR7U4H2S-qv0be7dh.js} +1 -1
  87. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-3s4smnme.js → requirementDiagram-PLB6GJNP-b87kqbr7.js} +1 -1
  88. package/dist/client/static/js/{rust-tdrnaxp3.js → rust-m7ma3tq9.js} +1 -1
  89. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-9pqd25mc.js → sankeyDiagram-IPEJSGJF-dh5we479.js} +1 -1
  90. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-rka8ct43.js → sequenceDiagram-PO4LG4MO-e6fg0x45.js} +1 -1
  91. package/dist/client/static/js/{sizeCapture-INFHLROL-g5wkzry8.js → sizeCapture-INFHLROL-mam6cagq.js} +1 -1
  92. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-gy1zab2j.js → stateDiagram-v2-GCMORJYK-htwar22v.js} +1 -1
  93. package/dist/client/static/js/{swimlanes-2SLR337P-kr35nmd2.js → swimlanes-2SLR337P-5g26cnkr.js} +1 -1
  94. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-qnhxxmjr.js → swimlanesDiagram-TC7HE7FX-rseba3zs.js} +1 -1
  95. package/dist/client/static/js/{timeline-definition-EJHVYXUP-sg151mkc.js → timeline-definition-EJHVYXUP-5km8n8mj.js} +1 -1
  96. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-f91g61p3.js → usecaseDiagram-POWQR4AR-0vt6ms5g.js} +1 -1
  97. package/dist/client/static/js/{vennDiagram-UO4OBE2U-zbhr4eqf.js → vennDiagram-UO4OBE2U-k425105a.js} +1 -1
  98. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-6302414n.js → wardleyDiagram-VNRHLVJA-s0gd4jg1.js} +1 -1
  99. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-0a47th65.js → xychartDiagram-PMCCYNJV-2nrdzp7p.js} +1 -1
  100. package/package.json +5 -5
  101. package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +2 -0
  102. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.test.tsx +67 -0
  103. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.tsx +89 -0
  104. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.test.tsx +91 -0
  105. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +8 -2
  106. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +9 -0
  107. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +16 -1
  108. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.test.tsx +59 -0
  109. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.tsx +11 -1
  110. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.test.ts +119 -0
  111. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.ts +174 -0
  112. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/task-rows.ts +14 -2
  113. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts +22 -0
  114. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +14 -0
  115. package/src/client/data/settings/omp-schema.json +445 -165
  116. package/src/server/routes/fs/raw.test.ts +33 -0
  117. package/src/server/routes/fs/raw.ts +31 -11
  118. package/src/shared/lib/chat/timeline/tool-phrases.test.ts +4 -0
  119. package/src/shared/lib/chat/timeline/tool-phrases.ts +2 -0
  120. package/src/shared/lib/models/provider/glyph.test.ts +13 -11
  121. package/src/shared/lib/models/provider/glyph.ts +1 -0
  122. package/src/shared/lib/models/provider/label.ts +3 -0
  123. package/src/shared/lib/omp/config/schema-releases-19-3.test.ts +64 -0
  124. package/src/shared/lib/omp/config/schema-releases.test.ts +6 -4
  125. package/src/shared/lib/omp/session/wait-idle.test.ts +12 -2
  126. package/src/shared/lib/omp/session/wait-idle.ts +11 -6
  127. package/dist/client/static/js/MergeDiffView-y0we0194.js +0 -1
  128. package/dist/client/static/js/flowDiagram-KWPJA3E3-dpjz82p8.js +0 -1
  129. package/dist/client/static/js/one-dark-pro-asy2qj2p.js +0 -1
  130. package/dist/client/static/js/one-light-fya1pbbx.js +0 -1
@@ -1,4 +1,4 @@
1
- import{d,n,o,K,i,u,a,Dr,e,s,ro,_e,ao,p,Kn,Ne,Q,I,dt,f,E,ue,pt,ae,fe,de,Jn,mn,Zn,F,S,Ra,U,La,vn,h,Mr,Lo,sr,Bm,Te,T,_m,Jg,xr,wr,xt,nt,he,_d,Ei,X,mt,ft,On,rn,gt,wl,We,be,J}from"./index-jvn2xfpt.js";import{wm,Tr}from"./index-eb43hnd3.js";var jt={name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]},Ve=s(jt);var Ut={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]},Ye=s(Ut);function Xe({message:t,hasStagedChanges:l,isBusy:c=!1,amend:r=!1,seeded:m=!1,isGenerating:g=!1,suggestion:x=null,generated:v=!1,onToggleAmend:N,onChangeMessage:P,onCommit:w,onGenerate:C,onUseSuggestion:R,onDismissSuggestion:G}){let M=t.trim().length>0&&!c&&(r||l),k=(r||l)&&!c&&!g,b=r?"Rewrite the previous commit with this message":l?"Commit staged changes":"Stage changes first",y=g?"Generating…":r||l?"Generate a commit message from the staged changes":"Stage changes first";return e("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[x&&e("div",{className:"rounded border border-ink/20 bg-paper p-2.5 space-y-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-ink/45",children:"Generated message"}),e("div",{className:"flex items-center gap-1",children:[e("button",{type:"button",onClick:R,className:"px-2 py-0.5 rounded bg-ink text-canvas text-[10px] font-medium hover:bg-ink/90 transition-colors cursor-pointer",children:"Use"}),e("button",{type:"button",onClick:G,className:"px-2 py-0.5 rounded border border-ink/20 text-ink/70 text-[10px] font-medium hover:bg-ink/5 transition-colors cursor-pointer",children:"Dismiss"})]})]}),e("pre",{className:"whitespace-pre-wrap break-words text-[11px] text-ink/80 font-mono max-h-32 overflow-y-auto",children:x})]}),e("textarea",{value:t,onChange:(L)=>P(L.currentTarget.value),onKeyDown:(L)=>{if(L.key==="Enter"&&(L.metaKey||L.ctrlKey)&&M)L.preventDefault(),w()},placeholder:r?"New message for the previous commit (⌘/Ctrl+Enter to commit)":"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),v&&t.trim().length>0&&e("div",{className:"flex items-center gap-1 text-[10px] text-ink/40",children:[e(Ne,{size:10})," Generated from staged changes"]}),e("div",{className:"flex flex-wrap items-center gap-2",children:[e("label",{className:"flex items-center gap-1.5 text-[11px] text-ink/70 cursor-pointer select-none",children:[e("input",{type:"checkbox",checked:r,onChange:(L)=>N?.(L.currentTarget.checked),className:`${be} accent-ink cursor-pointer`}),"Amend"]}),r&&m&&e("span",{className:"text-[10px] text-ink/40",title:"The previous commit's message, loaded as an editable starting point",children:"previous message loaded"}),e("button",{type:"button",onClick:C,disabled:!k,title:y,"aria-label":"Generate commit message with AI",className:"ml-auto flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[g?e(p,{size:12,className:"animate-spin"}):e(Ne,{size:12}),g?"Generating…":"Generate"]}),e("button",{type:"button",onClick:w,disabled:!M,title:b,className:"flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(f,{size:12}),r?"Amend commit":"Commit"]})]})]})}function Qe({operation:t,conflicts:l,isBusy:c,onAbort:r,onContinue:m}){let g=Lo[t],x=l.length,v=x===0,N=t!=="stash-pop";return e("div",{className:"border-t border-warning/30 bg-warning/5 p-3 flex flex-col gap-2",children:[e("div",{className:"flex items-center gap-2 text-xs text-ink",children:[e(I,{size:13,className:"text-warning flex-shrink-0"}),e("span",{className:"font-medium",children:[g.charAt(0).toUpperCase()+g.slice(1)," in progress"]}),e("span",{className:`font-mono tabular-nums text-[10px] ${v?"text-success":"text-warning"}`,children:v?"all conflicts resolved":`${x} conflict${x===1?"":"s"} left`})]}),!v&&e("div",{className:"max-h-20 overflow-y-auto scrollbar-overlay-container font-mono text-[10px] text-warning/90 space-y-0.5",children:l.map((P)=>e("div",{className:"truncate",title:P,children:P},P))}),e("div",{className:"flex items-stretch gap-2",children:[e("button",{type:"button",onClick:r,disabled:c,title:`Abort the ${g} and restore the previous state`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(vn,{size:12}),"Abort ",g]}),N&&e("button",{type:"button",onClick:m,disabled:c||!v,title:v?`Conclude the ${g}`:`Resolve all ${x} conflict(s) first`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-transparent bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(Jn,{size:12}),"Continue ",g]})]})]})}function Ze({branchRef:t,showBranchMenu:l,setShowBranchMenu:c,branch:r,branches:m,remoteBranches:g,onCheckout:x,onMerge:v,onOpenBranchPrompt:N,onManageBranches:P,optionsRef:w,showOptions:C,setShowOptions:R,onHistory:G,onGraph:M,viewMode:k,setViewMode:b,isBusy:y=!1,syncCount:L={ahead:0,behind:0},syncing:B=!1,onSync:z,onFetch:q,detached:A=!1}){let[V,Y]=n("");o(()=>{if(!l)Y("")},[l]);let _=V.trim(),H=u(()=>m.filter((D)=>rn(D,_)),[m,_]),O=u(()=>g.filter((D)=>rn(D,_)),[g,_]);return e("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[e("div",{className:"relative",ref:t,children:[e("button",{onClick:()=>c(!l),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",title:A?`Detached HEAD at ${r}`:`On branch ${r}`,children:[e(de,{size:12,className:A?"text-warning":"text-ink/60"}),e("span",{className:`truncate max-w-[140px] ${A?"font-mono text-warning":""}`,children:r}),e(E,{size:12,className:"text-ink/40"})]}),l&&e("div",{className:"glass-popover absolute top-full left-0 mt-1 w-64 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[e(On,{value:V,onChange:Y,ariaLabel:"Search branches",placeholder:"Search branches…"}),e("div",{className:"max-h-48 scrollbar-overlay-container py-1",children:[H.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),H.map((D)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{x(D),c(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:D}),r===D&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==D&&e("button",{type:"button",onClick:()=>{v(D),c(!1)},title:`Merge ${D} into ${r}`,"aria-label":`Merge ${D} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Jn,{size:12})})]},D))]}),O.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),O.map((D)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{x(D),c(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:D}),r===D&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==D&&e("button",{type:"button",onClick:()=>{v(D),c(!1)},title:`Merge ${D} into ${r}`,"aria-label":`Merge ${D} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Jn,{size:12})})]},D))]}),H.length===0&&O.length===0&&e("div",{className:"px-3 py-2 text-ink/40 italic",children:["No match for “",_,"”"]}),e("div",{className:"w-full h-px bg-ink/10 my-1"}),e("button",{onClick:()=>{N(),c(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[e(F,{size:12}),e("span",{children:"Create new branch..."})]}),e("button",{onClick:P,className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80",children:[e(La,{size:12}),e("span",{children:"Manage branches..."})]})]})]})]}),e("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:w,children:[e("button",{type:"button",onClick:q,disabled:y,title:"Fetch from all remotes and prune deleted branches","aria-label":"Fetch",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e(ro,{size:13})}),e("button",{type:"button",onClick:z,disabled:y,title:B?"Syncing with upstream…":L.ahead>0&&L.behind>0?`Pull ${L.behind} then push ${L.ahead} commit(s)`:L.ahead>0?`Push ${L.ahead} commit(s)`:L.behind>0?`Pull ${L.behind} commit(s)`:"Up to date — sync anyway","aria-label":"Sync with upstream","aria-busy":B,className:`flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:cursor-not-allowed ${B?"":"disabled:opacity-40"}`,children:[e(S,{size:13,className:B?"animate-spin":"","aria-hidden":"true"}),e("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",L.ahead," ↓",L.behind]})]}),e("button",{type:"button",onClick:G,title:"Commit History","aria-label":"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Kn,{size:13})}),e("button",{type:"button",onClick:M,title:"Git Graph","aria-label":"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Jn,{size:13})}),e("button",{type:"button",onClick:()=>R(!C),title:"View Options","aria-label":"View Options","aria-expanded":C,className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(_e,{size:13})}),C&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[e("button",{type:"button",onClick:()=>{b("flat"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(Ye,{size:12,className:"text-ink/60"}),e("span",{children:"View as List"})]}),k==="flat"&&e(f,{size:12,className:"text-ink"})]}),e("button",{type:"button",onClick:()=>{b("tree"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(Ve,{size:12,className:"text-ink/60"}),e("span",{children:"View as Tree"})]}),k==="tree"&&e(f,{size:12,className:"text-ink"})]})]})]})]})}function Je({activeRepo:t,repos:l,isRefreshing:c,rootPath:r,reposScanning:m,onSelectRepo:g,onRefresh:x,onRefreshRepos:v}){return e(xt,{left:e(d,{children:[e(wm,{size:12,className:"text-ink/50 flex-shrink-0","aria-hidden":!0}),e(Tr,{rootPath:r,activeRepo:t,onSelectRepo:g,repos:l,scanning:m,onRefreshRepos:v})]}),right:e(nt,{label:"Refresh",onClick:x,busy:c})})}function Fe({change:t,isStaged:l,repo:c,rootPath:r,onAction:m}){let g=sr(t.status,l),{charStatus:x,colorClass:v}=g,N=t.file.split("/"),P=N.pop()||t.file,w=N.length>0?N.join("/"):"";return e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:l,status:x,repo:c||".",root:r}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e("span",{className:`font-bold font-mono text-[10px] w-3 flex-shrink-0 text-center ${v}`,title:`Status: ${g.label}`,children:x}),e(mt,{name:P,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${v}`,title:t.file,children:P}),w&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:w})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:[!l&&e(d,{children:[e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),m("revert",t.file)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(vn,{size:11})}),e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),m("stage",t.file)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(F,{size:11})})]}),l&&e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),m("unstage",t.file)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(mn,{size:11})})]})})]})}function et({change:t,repo:l,rootPath:c,onResolve:r}){let[m,g]=n(!1),[x,v]=n(null),N=t.file.split("/"),P=N.pop()||t.file,w=N.length>0?N.join("/"):"",C=()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:!1,status:t.status,repo:l,root:c}}))},R=async()=>{let k=!m;if(g(k),k&&x===null){let b=new URLSearchParams({conflictMarkers:"1",file:t.file,repo:l||"."});if(c)b.set("root",c);try{let L=await(await fetch(`/api/fs/git?${b.toString()}`)).json();v(L.markers??{})}catch{v({})}}},G=x?.ours||"ours",M=x?.theirs||"theirs";return e("div",{className:"border-b border-warning/20 last:border-b-0",children:[e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-warning/5 cursor-pointer group text-[11px] transition-colors",onClick:C,children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e(ao,{size:11,className:"text-warning flex-shrink-0"}),e(mt,{name:P,size:12,className:"flex-shrink-0"}),e("span",{className:"truncate text-warning",title:t.file,children:P}),w&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:w}),Mr(t.status)&&e("span",{className:"text-[10px] text-warning/70 font-mono flex-shrink-0",children:t.status})]}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),R()},title:m?"Hide resolve actions":"Show resolve actions","aria-label":m?"Hide resolve actions":"Show resolve actions","aria-expanded":m,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors flex-shrink-0",children:m?e(pt,{size:11}):e(E,{size:11})})]}),m&&e("div",{className:"px-3 pb-2 pt-0.5 flex flex-wrap items-center gap-1.5",children:[e("button",{type:"button",onClick:()=>r(t.file,"ours"),title:`Take ${G} — \`git checkout --ours\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",G]}),e("button",{type:"button",onClick:()=>r(t.file,"theirs"),title:`Take ${M} — \`git checkout --theirs\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",M]}),e("button",{type:"button",onClick:()=>r(t.file,""),title:"Mark resolved: the file was edited by hand, this stages it",className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer flex items-center gap-1",children:[e(f,{size:10}),"mark resolved"]})]})]})}function Wt(t){let l={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let r of t){let m=r.file.replace(/^[./]+/,""),g=m.endsWith("/"),x=m.replace(/\/$/,"").split("/").filter(Boolean),v=l,N="";for(let P=0;P<x.length;P++){let w=x[P];N=N?`${N}/${w}`:w;let C=P===x.length-1;if(C&&!g)v.children.push({id:N,name:w,path:N,type:"file",change:r,children:[],changeCount:1});else{let G=v.children.find((M)=>M.type==="folder"&&M.name===w);if(!G)G={id:N,name:w,path:N,type:"folder",children:[],changeCount:0,change:C&&g?r:void 0},v.children.push(G);v=G}}}function c(r){if(r.type==="file")return 1;let m=r.change?1:0;for(let g of r.children)m+=c(g);return r.changeCount=m,r.children.sort((g,x)=>{if(g.type==="folder"&&x.type==="file")return-1;if(g.type==="file"&&x.type==="folder")return 1;return g.name.localeCompare(x.name)}),m}return c(l),l.children}function tt(t){let{sessionId:l,ready:c,read:r}=_m(),m=u(()=>Wt(t),[t]),g=u(()=>{let R=new Set;function G(M){for(let k of M)if(k.type==="folder"){if(R.add(k.id),k.children&&k.children.length>0)G(k.children)}}return G(m),R},[m]),[x,v]=T("git.expandedFolders",[]),N=u(()=>new Set(x),[x]),P=i(null);o(()=>{if(!c||P.current===l)return;if(g.size===0)return;if(P.current=l,r("git.expandedFolders",[]).length>0)return;v(Array.from(g))},[c,l,g,r,v]);let w=a((R)=>{v((G)=>{let M=new Set(G);if(M.has(R))M.delete(R);else M.add(R);return Array.from(M)})},[v]),C=a((R)=>N.has(R),[N]);return{tree:m,expandedFolders:N,toggleFolder:w,isFolderOpen:C,expandAll:()=>v(Array.from(g)),collapseAll:()=>v([])}}function He({node:t,isStaged:l,isFolderOpen:c,toggleFolder:r,onAction:m,repo:g,rootPath:x}){let v=t.type==="folder",N=v?c(t.id):!1;if(v)return e("div",{className:"select-none",children:[e("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>r(t.id),children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:N?e(E,{size:12}):e(ue,{size:12})}),e(mt,{name:t.name,isFolder:!0,isOpen:N,size:13,className:"flex-shrink-0"}),e("span",{className:"font-medium text-ink truncate",children:t.name}),e("span",{className:"text-[10px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!l?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(vn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(F,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(mn,{size:11})})})})]}),N&&t.children&&t.children.length>0&&e("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map((k)=>e(He,{node:k,isStaged:l,isFolderOpen:c,toggleFolder:r,onAction:m,repo:g,rootPath:x},k.id))})]});let P=t.change,w=sr(P?.status||"M",l),{charStatus:C,colorClass:R}=w,G=P?P.file:t.path;return e("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:G,staged:l,status:C,repo:g||".",root:x}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:e("span",{className:`font-bold font-mono text-[10px] ${R}`,title:`Status: ${w.label}`,children:C})}),e(mt,{name:t.name,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${R}`,title:G,children:t.name})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!l?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("revert",G)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(vn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("stage",G)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(F,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("unstage",G)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(mn,{size:11})})})})]})}function ze({changes:t,isStaged:l,repo:c,rootPath:r,onAction:m}){let{tree:g,isFolderOpen:x,toggleFolder:v}=tt(t);if(g.length===0)return null;return e("div",{className:"py-0.5",children:g.map((N)=>e(He,{node:N,isStaged:l,isFolderOpen:x,toggleFolder:v,onAction:m,repo:c,rootPath:r},N.id))})}function ot({changes:t,isLoading:l,viewMode:c,repo:r,rootPath:m,onAction:g,onResolve:x}){let[v,N]=T("git.stagedExpanded",!0),[P,w]=T("git.unstagedExpanded",!0),[C,R]=T("git.conflictsExpanded",!0),G=t.filter((b)=>Mr(b.status)),M=t.filter((b)=>{if(Mr(b.status))return!1;let y=b.status;return y&&y[0]!==" "&&y[0]!=="?"}),k=t.filter((b)=>{if(Mr(b.status))return!1;let y=b.status;return y&&y[1]!==" "&&y[1]!=="?"||y==="??"});if(l&&t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})});if(t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})});return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"py-1",children:[G.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-warning/5 cursor-pointer transition-colors",onClick:()=>R(!C),children:e("div",{className:"flex items-center space-x-1 font-semibold text-warning text-xs",children:[e("span",{className:"w-3 text-center",children:C?"▾":"▸"}),e("span",{children:"Conflicts"}),e("span",{className:"text-warning/70 font-normal ml-1 border border-warning/30 rounded-full px-1.5 text-[10px] bg-paper",children:G.length})]})}),C&&G.map((b)=>e(et,{change:b,repo:r,rootPath:m,onResolve:x??(()=>{})},`conflict-${b.file}`))]}),M.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>N(!v),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:v?"▾":"▸"}),e("span",{children:"Staged Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:M.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("button",{type:"button",onClick:(b)=>{b.stopPropagation(),g("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(mn,{size:12})})})]}),v&&(c==="tree"?e(ze,{changes:M,isStaged:!0,repo:r,rootPath:m,onAction:g}):M.map((b)=>e(Fe,{change:b,isStaged:!0,repo:r,rootPath:m,onAction:g},b.file+"staged")))]}),k.length>0&&e("div",{children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>w(!P),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:P?"▾":"▸"}),e("span",{children:"Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:k.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[e("button",{type:"button",onClick:(b)=>{b.stopPropagation(),g("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(vn,{size:12})}),e("button",{type:"button",onClick:(b)=>{b.stopPropagation(),g("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(F,{size:12})})]})]}),P&&(c==="tree"?e(ze,{changes:k,isStaged:!1,repo:r,rootPath:m,onAction:g}):k.map((b)=>e(Fe,{change:b,isStaged:!1,repo:r,rootPath:m,onAction:g},b.file+"unstaged")))]})]})})}function st({matches:t,loaded:l,total:c,hasMore:r,isFiltering:m}){if(m)return`${t} of ${l} loaded`;if(typeof c==="number"&&c>0)return r||l<c?`${l} of ${c}`:`${c} commits`;return r?`${l}+ commits`:`${l} commits`}function rt({isGraphMode:t,onToggleMode:l,searchQuery:c,onSearchChange:r,onRefresh:m,onClose:g,isRefreshing:x,totalCommits:v,loadedCount:N,totalCount:P,hasMore:w}){let C=st({matches:v,loaded:N,total:P,hasMore:w,isFiltering:c.trim().length>0});return e("div",{className:`flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none
1
+ import{d,n,o,K,i,u,a,Dr,e,s,ro,_e,ao,p,Kn,Ne,Q,I,dt,f,E,ue,pt,ae,fe,de,Jn,mn,Zn,F,S,Ra,U,La,vn,h,Mr,Lo,sr,Bm,Te,T,_m,Jg,xr,wr,xt,nt,he,_d,Ei,X,mt,ft,On,rn,gt,wl,We,be,J}from"./index-7ckzdf4r.js";import{wm,Tr}from"./index-gsw1zh30.js";var jt={name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]},Ve=s(jt);var Ut={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]},Ye=s(Ut);function Xe({message:t,hasStagedChanges:l,isBusy:c=!1,amend:r=!1,seeded:m=!1,isGenerating:g=!1,suggestion:x=null,generated:v=!1,onToggleAmend:N,onChangeMessage:P,onCommit:w,onGenerate:C,onUseSuggestion:R,onDismissSuggestion:G}){let M=t.trim().length>0&&!c&&(r||l),k=(r||l)&&!c&&!g,b=r?"Rewrite the previous commit with this message":l?"Commit staged changes":"Stage changes first",y=g?"Generating…":r||l?"Generate a commit message from the staged changes":"Stage changes first";return e("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[x&&e("div",{className:"rounded border border-ink/20 bg-paper p-2.5 space-y-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-ink/45",children:"Generated message"}),e("div",{className:"flex items-center gap-1",children:[e("button",{type:"button",onClick:R,className:"px-2 py-0.5 rounded bg-ink text-canvas text-[10px] font-medium hover:bg-ink/90 transition-colors cursor-pointer",children:"Use"}),e("button",{type:"button",onClick:G,className:"px-2 py-0.5 rounded border border-ink/20 text-ink/70 text-[10px] font-medium hover:bg-ink/5 transition-colors cursor-pointer",children:"Dismiss"})]})]}),e("pre",{className:"whitespace-pre-wrap break-words text-[11px] text-ink/80 font-mono max-h-32 overflow-y-auto",children:x})]}),e("textarea",{value:t,onChange:(L)=>P(L.currentTarget.value),onKeyDown:(L)=>{if(L.key==="Enter"&&(L.metaKey||L.ctrlKey)&&M)L.preventDefault(),w()},placeholder:r?"New message for the previous commit (⌘/Ctrl+Enter to commit)":"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),v&&t.trim().length>0&&e("div",{className:"flex items-center gap-1 text-[10px] text-ink/40",children:[e(Ne,{size:10})," Generated from staged changes"]}),e("div",{className:"flex flex-wrap items-center gap-2",children:[e("label",{className:"flex items-center gap-1.5 text-[11px] text-ink/70 cursor-pointer select-none",children:[e("input",{type:"checkbox",checked:r,onChange:(L)=>N?.(L.currentTarget.checked),className:`${be} accent-ink cursor-pointer`}),"Amend"]}),r&&m&&e("span",{className:"text-[10px] text-ink/40",title:"The previous commit's message, loaded as an editable starting point",children:"previous message loaded"}),e("button",{type:"button",onClick:C,disabled:!k,title:y,"aria-label":"Generate commit message with AI",className:"ml-auto flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[g?e(p,{size:12,className:"animate-spin"}):e(Ne,{size:12}),g?"Generating…":"Generate"]}),e("button",{type:"button",onClick:w,disabled:!M,title:b,className:"flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(f,{size:12}),r?"Amend commit":"Commit"]})]})]})}function Qe({operation:t,conflicts:l,isBusy:c,onAbort:r,onContinue:m}){let g=Lo[t],x=l.length,v=x===0,N=t!=="stash-pop";return e("div",{className:"border-t border-warning/30 bg-warning/5 p-3 flex flex-col gap-2",children:[e("div",{className:"flex items-center gap-2 text-xs text-ink",children:[e(I,{size:13,className:"text-warning flex-shrink-0"}),e("span",{className:"font-medium",children:[g.charAt(0).toUpperCase()+g.slice(1)," in progress"]}),e("span",{className:`font-mono tabular-nums text-[10px] ${v?"text-success":"text-warning"}`,children:v?"all conflicts resolved":`${x} conflict${x===1?"":"s"} left`})]}),!v&&e("div",{className:"max-h-20 overflow-y-auto scrollbar-overlay-container font-mono text-[10px] text-warning/90 space-y-0.5",children:l.map((P)=>e("div",{className:"truncate",title:P,children:P},P))}),e("div",{className:"flex items-stretch gap-2",children:[e("button",{type:"button",onClick:r,disabled:c,title:`Abort the ${g} and restore the previous state`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(vn,{size:12}),"Abort ",g]}),N&&e("button",{type:"button",onClick:m,disabled:c||!v,title:v?`Conclude the ${g}`:`Resolve all ${x} conflict(s) first`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-transparent bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(Jn,{size:12}),"Continue ",g]})]})]})}function Ze({branchRef:t,showBranchMenu:l,setShowBranchMenu:c,branch:r,branches:m,remoteBranches:g,onCheckout:x,onMerge:v,onOpenBranchPrompt:N,onManageBranches:P,optionsRef:w,showOptions:C,setShowOptions:R,onHistory:G,onGraph:M,viewMode:k,setViewMode:b,isBusy:y=!1,syncCount:L={ahead:0,behind:0},syncing:B=!1,onSync:z,onFetch:q,detached:A=!1}){let[V,Y]=n("");o(()=>{if(!l)Y("")},[l]);let _=V.trim(),H=u(()=>m.filter((D)=>rn(D,_)),[m,_]),O=u(()=>g.filter((D)=>rn(D,_)),[g,_]);return e("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[e("div",{className:"relative",ref:t,children:[e("button",{onClick:()=>c(!l),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",title:A?`Detached HEAD at ${r}`:`On branch ${r}`,children:[e(de,{size:12,className:A?"text-warning":"text-ink/60"}),e("span",{className:`truncate max-w-[140px] ${A?"font-mono text-warning":""}`,children:r}),e(E,{size:12,className:"text-ink/40"})]}),l&&e("div",{className:"glass-popover absolute top-full left-0 mt-1 w-64 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[e(On,{value:V,onChange:Y,ariaLabel:"Search branches",placeholder:"Search branches…"}),e("div",{className:"max-h-48 scrollbar-overlay-container py-1",children:[H.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),H.map((D)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{x(D),c(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:D}),r===D&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==D&&e("button",{type:"button",onClick:()=>{v(D),c(!1)},title:`Merge ${D} into ${r}`,"aria-label":`Merge ${D} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Jn,{size:12})})]},D))]}),O.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),O.map((D)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{x(D),c(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:D}),r===D&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==D&&e("button",{type:"button",onClick:()=>{v(D),c(!1)},title:`Merge ${D} into ${r}`,"aria-label":`Merge ${D} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Jn,{size:12})})]},D))]}),H.length===0&&O.length===0&&e("div",{className:"px-3 py-2 text-ink/40 italic",children:["No match for “",_,"”"]}),e("div",{className:"w-full h-px bg-ink/10 my-1"}),e("button",{onClick:()=>{N(),c(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[e(F,{size:12}),e("span",{children:"Create new branch..."})]}),e("button",{onClick:P,className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80",children:[e(La,{size:12}),e("span",{children:"Manage branches..."})]})]})]})]}),e("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:w,children:[e("button",{type:"button",onClick:q,disabled:y,title:"Fetch from all remotes and prune deleted branches","aria-label":"Fetch",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e(ro,{size:13})}),e("button",{type:"button",onClick:z,disabled:y,title:B?"Syncing with upstream…":L.ahead>0&&L.behind>0?`Pull ${L.behind} then push ${L.ahead} commit(s)`:L.ahead>0?`Push ${L.ahead} commit(s)`:L.behind>0?`Pull ${L.behind} commit(s)`:"Up to date — sync anyway","aria-label":"Sync with upstream","aria-busy":B,className:`flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:cursor-not-allowed ${B?"":"disabled:opacity-40"}`,children:[e(S,{size:13,className:B?"animate-spin":"","aria-hidden":"true"}),e("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",L.ahead," ↓",L.behind]})]}),e("button",{type:"button",onClick:G,title:"Commit History","aria-label":"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Kn,{size:13})}),e("button",{type:"button",onClick:M,title:"Git Graph","aria-label":"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Jn,{size:13})}),e("button",{type:"button",onClick:()=>R(!C),title:"View Options","aria-label":"View Options","aria-expanded":C,className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(_e,{size:13})}),C&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[e("button",{type:"button",onClick:()=>{b("flat"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(Ye,{size:12,className:"text-ink/60"}),e("span",{children:"View as List"})]}),k==="flat"&&e(f,{size:12,className:"text-ink"})]}),e("button",{type:"button",onClick:()=>{b("tree"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(Ve,{size:12,className:"text-ink/60"}),e("span",{children:"View as Tree"})]}),k==="tree"&&e(f,{size:12,className:"text-ink"})]})]})]})]})}function Je({activeRepo:t,repos:l,isRefreshing:c,rootPath:r,reposScanning:m,onSelectRepo:g,onRefresh:x,onRefreshRepos:v}){return e(xt,{left:e(d,{children:[e(wm,{size:12,className:"text-ink/50 flex-shrink-0","aria-hidden":!0}),e(Tr,{rootPath:r,activeRepo:t,onSelectRepo:g,repos:l,scanning:m,onRefreshRepos:v})]}),right:e(nt,{label:"Refresh",onClick:x,busy:c})})}function Fe({change:t,isStaged:l,repo:c,rootPath:r,onAction:m}){let g=sr(t.status,l),{charStatus:x,colorClass:v}=g,N=t.file.split("/"),P=N.pop()||t.file,w=N.length>0?N.join("/"):"";return e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:l,status:x,repo:c||".",root:r}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e("span",{className:`font-bold font-mono text-[10px] w-3 flex-shrink-0 text-center ${v}`,title:`Status: ${g.label}`,children:x}),e(mt,{name:P,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${v}`,title:t.file,children:P}),w&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:w})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:[!l&&e(d,{children:[e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),m("revert",t.file)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(vn,{size:11})}),e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),m("stage",t.file)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(F,{size:11})})]}),l&&e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),m("unstage",t.file)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(mn,{size:11})})]})})]})}function et({change:t,repo:l,rootPath:c,onResolve:r}){let[m,g]=n(!1),[x,v]=n(null),N=t.file.split("/"),P=N.pop()||t.file,w=N.length>0?N.join("/"):"",C=()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:!1,status:t.status,repo:l,root:c}}))},R=async()=>{let k=!m;if(g(k),k&&x===null){let b=new URLSearchParams({conflictMarkers:"1",file:t.file,repo:l||"."});if(c)b.set("root",c);try{let L=await(await fetch(`/api/fs/git?${b.toString()}`)).json();v(L.markers??{})}catch{v({})}}},G=x?.ours||"ours",M=x?.theirs||"theirs";return e("div",{className:"border-b border-warning/20 last:border-b-0",children:[e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-warning/5 cursor-pointer group text-[11px] transition-colors",onClick:C,children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e(ao,{size:11,className:"text-warning flex-shrink-0"}),e(mt,{name:P,size:12,className:"flex-shrink-0"}),e("span",{className:"truncate text-warning",title:t.file,children:P}),w&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:w}),Mr(t.status)&&e("span",{className:"text-[10px] text-warning/70 font-mono flex-shrink-0",children:t.status})]}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),R()},title:m?"Hide resolve actions":"Show resolve actions","aria-label":m?"Hide resolve actions":"Show resolve actions","aria-expanded":m,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors flex-shrink-0",children:m?e(pt,{size:11}):e(E,{size:11})})]}),m&&e("div",{className:"px-3 pb-2 pt-0.5 flex flex-wrap items-center gap-1.5",children:[e("button",{type:"button",onClick:()=>r(t.file,"ours"),title:`Take ${G} — \`git checkout --ours\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",G]}),e("button",{type:"button",onClick:()=>r(t.file,"theirs"),title:`Take ${M} — \`git checkout --theirs\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",M]}),e("button",{type:"button",onClick:()=>r(t.file,""),title:"Mark resolved: the file was edited by hand, this stages it",className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer flex items-center gap-1",children:[e(f,{size:10}),"mark resolved"]})]})]})}function Wt(t){let l={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let r of t){let m=r.file.replace(/^[./]+/,""),g=m.endsWith("/"),x=m.replace(/\/$/,"").split("/").filter(Boolean),v=l,N="";for(let P=0;P<x.length;P++){let w=x[P];N=N?`${N}/${w}`:w;let C=P===x.length-1;if(C&&!g)v.children.push({id:N,name:w,path:N,type:"file",change:r,children:[],changeCount:1});else{let G=v.children.find((M)=>M.type==="folder"&&M.name===w);if(!G)G={id:N,name:w,path:N,type:"folder",children:[],changeCount:0,change:C&&g?r:void 0},v.children.push(G);v=G}}}function c(r){if(r.type==="file")return 1;let m=r.change?1:0;for(let g of r.children)m+=c(g);return r.changeCount=m,r.children.sort((g,x)=>{if(g.type==="folder"&&x.type==="file")return-1;if(g.type==="file"&&x.type==="folder")return 1;return g.name.localeCompare(x.name)}),m}return c(l),l.children}function tt(t){let{sessionId:l,ready:c,read:r}=_m(),m=u(()=>Wt(t),[t]),g=u(()=>{let R=new Set;function G(M){for(let k of M)if(k.type==="folder"){if(R.add(k.id),k.children&&k.children.length>0)G(k.children)}}return G(m),R},[m]),[x,v]=T("git.expandedFolders",[]),N=u(()=>new Set(x),[x]),P=i(null);o(()=>{if(!c||P.current===l)return;if(g.size===0)return;if(P.current=l,r("git.expandedFolders",[]).length>0)return;v(Array.from(g))},[c,l,g,r,v]);let w=a((R)=>{v((G)=>{let M=new Set(G);if(M.has(R))M.delete(R);else M.add(R);return Array.from(M)})},[v]),C=a((R)=>N.has(R),[N]);return{tree:m,expandedFolders:N,toggleFolder:w,isFolderOpen:C,expandAll:()=>v(Array.from(g)),collapseAll:()=>v([])}}function He({node:t,isStaged:l,isFolderOpen:c,toggleFolder:r,onAction:m,repo:g,rootPath:x}){let v=t.type==="folder",N=v?c(t.id):!1;if(v)return e("div",{className:"select-none",children:[e("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>r(t.id),children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:N?e(E,{size:12}):e(ue,{size:12})}),e(mt,{name:t.name,isFolder:!0,isOpen:N,size:13,className:"flex-shrink-0"}),e("span",{className:"font-medium text-ink truncate",children:t.name}),e("span",{className:"text-[10px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!l?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(vn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(F,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(mn,{size:11})})})})]}),N&&t.children&&t.children.length>0&&e("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map((k)=>e(He,{node:k,isStaged:l,isFolderOpen:c,toggleFolder:r,onAction:m,repo:g,rootPath:x},k.id))})]});let P=t.change,w=sr(P?.status||"M",l),{charStatus:C,colorClass:R}=w,G=P?P.file:t.path;return e("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:G,staged:l,status:C,repo:g||".",root:x}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:e("span",{className:`font-bold font-mono text-[10px] ${R}`,title:`Status: ${w.label}`,children:C})}),e(mt,{name:t.name,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${R}`,title:G,children:t.name})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!l?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("revert",G)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(vn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("stage",G)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(F,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),m("unstage",G)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(mn,{size:11})})})})]})}function ze({changes:t,isStaged:l,repo:c,rootPath:r,onAction:m}){let{tree:g,isFolderOpen:x,toggleFolder:v}=tt(t);if(g.length===0)return null;return e("div",{className:"py-0.5",children:g.map((N)=>e(He,{node:N,isStaged:l,isFolderOpen:x,toggleFolder:v,onAction:m,repo:c,rootPath:r},N.id))})}function ot({changes:t,isLoading:l,viewMode:c,repo:r,rootPath:m,onAction:g,onResolve:x}){let[v,N]=T("git.stagedExpanded",!0),[P,w]=T("git.unstagedExpanded",!0),[C,R]=T("git.conflictsExpanded",!0),G=t.filter((b)=>Mr(b.status)),M=t.filter((b)=>{if(Mr(b.status))return!1;let y=b.status;return y&&y[0]!==" "&&y[0]!=="?"}),k=t.filter((b)=>{if(Mr(b.status))return!1;let y=b.status;return y&&y[1]!==" "&&y[1]!=="?"||y==="??"});if(l&&t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})});if(t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})});return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"py-1",children:[G.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-warning/5 cursor-pointer transition-colors",onClick:()=>R(!C),children:e("div",{className:"flex items-center space-x-1 font-semibold text-warning text-xs",children:[e("span",{className:"w-3 text-center",children:C?"▾":"▸"}),e("span",{children:"Conflicts"}),e("span",{className:"text-warning/70 font-normal ml-1 border border-warning/30 rounded-full px-1.5 text-[10px] bg-paper",children:G.length})]})}),C&&G.map((b)=>e(et,{change:b,repo:r,rootPath:m,onResolve:x??(()=>{})},`conflict-${b.file}`))]}),M.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>N(!v),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:v?"▾":"▸"}),e("span",{children:"Staged Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:M.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("button",{type:"button",onClick:(b)=>{b.stopPropagation(),g("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(mn,{size:12})})})]}),v&&(c==="tree"?e(ze,{changes:M,isStaged:!0,repo:r,rootPath:m,onAction:g}):M.map((b)=>e(Fe,{change:b,isStaged:!0,repo:r,rootPath:m,onAction:g},b.file+"staged")))]}),k.length>0&&e("div",{children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>w(!P),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:P?"▾":"▸"}),e("span",{children:"Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:k.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[e("button",{type:"button",onClick:(b)=>{b.stopPropagation(),g("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(vn,{size:12})}),e("button",{type:"button",onClick:(b)=>{b.stopPropagation(),g("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(F,{size:12})})]})]}),P&&(c==="tree"?e(ze,{changes:k,isStaged:!1,repo:r,rootPath:m,onAction:g}):k.map((b)=>e(Fe,{change:b,isStaged:!1,repo:r,rootPath:m,onAction:g},b.file+"unstaged")))]})]})})}function st({matches:t,loaded:l,total:c,hasMore:r,isFiltering:m}){if(m)return`${t} of ${l} loaded`;if(typeof c==="number"&&c>0)return r||l<c?`${l} of ${c}`:`${c} commits`;return r?`${l}+ commits`:`${l} commits`}function rt({isGraphMode:t,onToggleMode:l,searchQuery:c,onSearchChange:r,onRefresh:m,onClose:g,isRefreshing:x,totalCommits:v,loadedCount:N,totalCount:P,hasMore:w}){let C=st({matches:v,loaded:N,total:P,hasMore:w,isFiltering:c.trim().length>0});return e("div",{className:`flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none
2
2
  pl-[max(0.75rem,env(safe-area-inset-left,0px))] pr-[max(0.75rem,env(safe-area-inset-right,0px))]`,children:[e("div",{className:"flex items-center justify-between gap-2 lg:gap-4",children:[e("div",{className:"flex flex-col min-w-0",children:[e("div",{className:"flex items-center gap-2.5 min-w-0",children:[e("h2",{className:"text-base font-semibold text-ink tracking-tight",children:t?"Graph":"History"}),e("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-ink/5 text-ink/80 border border-ink/10 whitespace-nowrap",children:C})]}),e("p",{className:"text-xs text-muted mt-0.5 hidden lg:block",children:t?"Follow branch topology and inspect commits.":"Browse recent commits and inspect changed files."})]}),e("div",{className:"flex items-center gap-1.5 lg:gap-2 flex-shrink-0",children:[e("div",{className:"flex items-center text-xs lg:bg-ink/5 lg:p-0.5 lg:rounded-lg lg:border lg:border-ink/10",children:[e("button",{type:"button",onClick:()=>l(!1),title:"History view","aria-label":"History view","aria-pressed":!t,className:`tap-target flex items-center justify-center gap-1.5 p-2 rounded-md font-medium transition-colors cursor-pointer lg:px-2.5 lg:py-1 ${!t?"bg-ink/5 text-ink lg:bg-paper lg:shadow-xs":"text-ink/80 lg:hover:text-ink lg:hover:bg-ink/5"}`,children:[e(Kn,{size:13,"aria-hidden":"true"}),e("span",{className:"hidden lg:inline",children:"History"})]}),e("button",{type:"button",onClick:()=>l(!0),title:"Graph view","aria-label":"Graph view","aria-pressed":t,className:`tap-target flex items-center justify-center gap-1.5 p-2 rounded-md font-medium transition-colors cursor-pointer lg:px-2.5 lg:py-1 ${t?"bg-ink/5 text-ink lg:bg-paper lg:shadow-xs":"text-ink/80 lg:hover:text-ink lg:hover:bg-ink/5"}`,children:[e(Jn,{size:13,"aria-hidden":"true"}),e("span",{className:"hidden lg:inline",children:"Graph"})]})]}),e("button",{type:"button",onClick:m,disabled:x,className:"tap-target flex items-center justify-center gap-1.5 p-2 rounded-md text-ink/70 transition-colors cursor-pointer text-xs disabled:opacity-40 lg:px-2.5 lg:py-1.5 lg:border lg:border-ink/15 lg:hover:bg-ink/5 lg:hover:text-ink",title:"Refresh commit history","aria-label":"Refresh commit history",children:[e(Ra,{size:13,className:x?"animate-spin text-ink":"","aria-hidden":"true"}),e("span",{className:"hidden lg:inline",children:"Refresh"})]}),e("button",{type:"button",onClick:g,className:"tap-target p-2 -mr-1 rounded-md hover:bg-ink/5 text-muted hover:text-ink transition-colors cursor-pointer",title:"Close modal","aria-label":"Close commit history",children:e(h,{size:16,"aria-hidden":"true"})})]})]}),e("div",{className:"relative mt-1",children:[e(U,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/55","aria-hidden":"true"}),e("input",{type:"text",value:c,onChange:(R)=>r(R.currentTarget.value),placeholder:"Filter commits by message, author, or hash...","aria-label":"Filter commits",className:"w-full bg-ink/[0.03] border border-ink/15 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),c&&e("button",{type:"button",onClick:()=>r(""),"aria-label":"Clear filter",className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-ink/55 hover:text-ink cursor-pointer",children:e(h,{size:12,"aria-hidden":"true"})})]})]})}var le=["#38bdf8","#f97316","#a855f7","#10b981","#ec4899","#eab308","#06b6d4","#6366f1"];function Oe(t,l){if(!t||!l)return!1;if(t===l)return!0;let c=Math.min(t.length,l.length);if(c>=4)return t.substring(0,c)===l.substring(0,c);return!1}function Ge(t){let l=new Map,c=[];for(let r of t){if(typeof r.lane==="number"){l.set(r.hash,r.lane);continue}let m=c.findIndex((x)=>Oe(x,r.hash)||Oe(x,r.shortHash));if(m===-1)if(m=c.indexOf(null),m===-1)m=c.length,c.push(r.hash);else c[m]=r.hash;l.set(r.hash,m);let g=r.parents&&r.parents[0];if(g)c[m]=g;else c[m]=null;if(r.parents&&r.parents.length>1)for(let x=1;x<r.parents.length;x++){let v=r.parents[x];if(!c.some((P)=>Oe(P,v))){let P=c.indexOf(null);if(P===-1)c.push(v);else c[P]=v}}}return l}function it(t,l,c,r){let m=[],g=new Map;t.forEach((x,v)=>{if(g.set(x.hash,v),x.shortHash)g.set(x.shortHash,v);if(x.hash.length>=7)g.set(x.hash.substring(0,7),v)});for(let x of t){let v=l.get(x.hash)??0,N=c[x.hash]??0,P=le[v%le.length];if(!x.parents||x.parents.length===0)continue;for(let w of x.parents){let C=g.get(w);if(typeof C!=="number"&&w.length>=7)C=g.get(w.substring(0,7));if(typeof C==="number"){let R=t[C],G=l.get(R.hash)??v,M=c[R.hash]??N+60;m.push({fromHash:x.hash,toHash:R.hash,fromLane:v,toLane:G,fromY:N,toY:M,color:le[v%le.length]})}else m.push({fromHash:x.hash,toHash:"tail-"+x.hash,fromLane:v,toLane:v,fromY:N,toY:Math.max(N+80,r),color:P})}}return m}function at(t,l,c,r){if(Math.abs(t-c)<1)return`M ${t} ${l} L ${c} ${r}`;let m=r-l,g=l+m*0.45,x=r-m*0.45;return`M ${t} ${l} C ${t} ${g}, ${c} ${x}, ${c} ${r}`}function lt({commits:t,nodePositions:l,expandedHash:c,hoveredHash:r,isGraphMode:m,laneWidth:g=18,paddingLeft:x=16,totalHeight:v}){let N=u(()=>{if(!m){let R=new Map;return t.forEach((G)=>R.set(G.hash,0)),R}return Ge(t)},[t,m]),P=u(()=>{let R=0;return N.forEach((G)=>{if(G>R)R=G}),R},[N]),w=m?(P+1)*g+x*2:36,C=u(()=>{if(!m){let R=[];for(let G=0;G<t.length-1;G++){let M=l[t[G].hash]??G*60+20,k=l[t[G+1].hash]??(G+1)*60+20;R.push({fromHash:t[G].hash,toHash:t[G+1].hash,fromLane:0,toLane:0,fromY:M,toY:k,color:"var(--theme-ink)"})}return R}return it(t,N,l,v)},[t,N,l,v,m]);return e("div",{className:"absolute top-0 left-0 pointer-events-none z-10",style:{width:w,height:v},"aria-hidden":"true",children:e("svg",{className:"w-full h-full overflow-visible",style:{width:w,height:v},children:[C.map((R)=>{let G=m?x+R.fromLane*g:16,M=m?x+R.toLane*g:16,k=m?R.color:"currentColor",b=m?0.95:0.25,y=at(G,R.fromY,M,R.toY);return e("path",{d:y,fill:"none",stroke:k,strokeWidth:m?2.25:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:b},`${R.fromHash}->${R.toHash}`)}),t.map((R)=>{let G=N.get(R.hash)??0,M=m?x+G*g:16,k=l[R.hash]??20,b=c===R.hash||c===R.shortHash,y=r===R.hash||r===R.shortHash,L=m?le[G%le.length]:"var(--theme-success)";return e("g",{"data-commit-node":R.hash,children:[(b||y)&&e("circle",{cx:M,cy:k,r:8,fill:L,fillOpacity:b?0.35:0.2,stroke:L,strokeWidth:1}),e("circle",{"data-commit-dot":"",cx:M,cy:k,r:m?4:4.5,fill:m?"var(--theme-paper)":L,stroke:L,strokeWidth:m?2.5:1.5}),m&&e("circle",{cx:M,cy:k,r:1.8,fill:L})]},`node-${R.hash}`)})]})})}var qt=[{action:"checkout",label:"checkout"},{action:"create_branch_here",label:"create branch here"},{action:"cherry_pick",label:"cherry-pick"},{action:"revert",label:"revert"},{action:"reset",label:"reset..."},{action:"merge",label:"merge into current"},{action:"rebase",label:"rebase onto this"}];function ct({commit:t,onAction:l}){return e("div",{className:"flex flex-wrap items-center gap-1.5 pt-1.5 pb-2",children:qt.map(({action:c,label:r})=>e("button",{type:"button",onClick:(m)=>{m.stopPropagation(),l(c,t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer",children:r},c))})}var Se=3;function Kt(t){let l=[];for(let c=0;c<t.length;c+=1){if(t[c].type!=="context"){l.push({row:t[c],index:c});continue}let r=c;while(r<t.length&&t[r].type==="context")r+=1;let m=r-c;if(m>Se*2+1){for(let g=c;g<c+Se;g+=1)l.push({row:t[g],index:g});l.push({row:{type:"elided",count:m-Se*2},index:-1});for(let g=r-Se;g<r;g+=1)l.push({row:t[g],index:g})}else for(let g=c;g<r;g+=1)l.push({row:t[g],index:g});c=r-1}return l}function ut({diffText:t,isLoading:l,filePath:c,fullContext:r=!1,onToggleContext:m}){let g=Ei(),x=u(()=>{if(!t)return[];let w=[],C=1,R=1,G=t.split(/\r?\n/),k=G.some((b)=>b.startsWith("@@"))?G:[`@@ -0,0 +1,${G.length} @@`,...G.map((b)=>b.startsWith("+")||b.startsWith("-")?b:`+${b}`)];for(let b of k){if(b.startsWith("diff --git")||b.startsWith("index ")||b.startsWith("---")||b.startsWith("+++")||b.startsWith("new file mode")||b.startsWith("deleted file mode")||b.startsWith("similarity index")||b.startsWith("old mode")||b.startsWith("new mode")||b.startsWith("\\ No newline"))continue;if(b.startsWith("@@")){let y=b.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(y)C=parseInt(y[1],10),R=parseInt(y[2],10);w.push({type:"meta",text:b})}else if(b.startsWith("+"))w.push({type:"add",text:b.slice(1),newNum:R++});else if(b.startsWith("-"))w.push({type:"del",text:b.slice(1),oldNum:C++});else{let y=b.startsWith(" ")?b.slice(1):b;w.push({type:"context",text:y,oldNum:C++,newNum:R++})}}return w},[t]),v=gt(c),N=u(()=>{let w=Array(x.length).fill(""),C=-1,R=(G)=>{if(C<0)return;let M=_d(x.slice(C,G).map((k)=>k.text).join(`
3
3
  `),v);for(let k=C;k<G;k++)w[k]=M[k-C]??"";C=-1};return x.forEach((G,M)=>{if(G.type==="meta")R(M);else if(C<0)C=M}),R(x.length),w},[x,v,g]),P=u(()=>r?x.map((w,C)=>({row:w,index:C})):Kt(x),[x,r]);if(l)return e("div",{className:"my-2 p-4 rounded bg-canvas border border-ink/10 text-muted font-mono text-xs flex items-center justify-center",children:"Loading commit diff..."});if(!t||x.length===0)return e("div",{className:"my-2 p-3 rounded bg-canvas border border-ink/10 text-muted font-mono text-xs text-center",children:"No diff content available for this file."});return e("div",{className:"my-2 rounded border border-ink/15 bg-paper overflow-hidden text-[11px] font-mono leading-relaxed text-ink",children:[e("div",{className:"flex items-center justify-between px-3 py-1.5 bg-canvas border-b border-ink/10 text-ink/70 text-[10.5px]",children:[e("span",{className:"font-semibold text-muted",children:"Diff preview"}),e("button",{type:"button",onClick:m,disabled:!m,className:"hover:text-ink flex items-center gap-1 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-default",title:r?"Show only the changed hunks":"Read the whole file around the change","aria-pressed":r,children:r?e(d,{children:[e(pt,{size:12,"aria-hidden":"true"})," Collapse context"]}):e(d,{children:[e(E,{size:12,"aria-hidden":"true"})," Expand all context"]})})]}),e("div",{className:"overflow-x-auto max-h-72 select-text",children:e("div",{className:"w-max min-w-full divide-y divide-ink/[0.04]",children:P.map(({row:w,index:C},R)=>{if(w.type==="elided")return e("div",{className:"px-3 py-1 bg-canvas text-muted text-[10px] text-center select-none",title:`${w.count} unchanged line(s) hidden`,children:["⋯ ",w.count," unchanged line",w.count===1?"":"s"," hidden ⋯"]},`elided-${R}`);let G=w,M=C;if(G.type==="meta")return e("div",{className:"flex items-center gap-2 px-3 py-1 bg-canvas border-y border-ink/10 text-muted text-[10px] font-semibold",children:[e("span",{children:"↕"}),e("span",{children:G.text})]},M);let k=G.type==="add",b=G.type==="del";return e("div",{className:`flex items-start font-mono ${k?"bg-success/10 hover:bg-success/15":b?"bg-error/10 hover:bg-error/15":"text-ink hover:bg-ink/[0.02]"}`,children:[e("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${b?"bg-error/15 text-ink/80 font-semibold":k?"bg-success/15 text-ink/80":"bg-canvas/50 text-muted"}`,children:G.oldNum??(k?"+":"")}),e("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${k?"bg-success/15 text-ink/80 font-semibold":b?"bg-error/15 text-ink/80":"bg-canvas/50 text-muted"}`,children:G.newNum??(b?"-":"")}),e("div",{className:`w-4 flex-shrink-0 text-center py-0.5 select-none font-bold ${k||b?"text-ink/80":"opacity-0"}`,children:k?"+":b?"-":" "}),e("div",{className:"flex-1 py-0.5 pr-3 whitespace-pre text-ink",children:G.text?e("span",{className:"shiki",dangerouslySetInnerHTML:{__html:N[M]}}):" "})]},M)})})})]})}function ht({commit:t,isExpanded:l,onToggleExpand:c,onAction:r,onToggleFile:m,isExpandedFile:g,isLoadingFile:x,isFullContextFile:v,onToggleContext:N,fileDiffs:P,headerRef:w}){let[C,R]=n(!1),G=t.body?.trim()??"",M=G.length>0,k=t.files??[],b=k.length,y=b>0,L=M||y,B=(A)=>{A.stopPropagation(),navigator.clipboard.writeText(t.hash),R(!0),setTimeout(()=>R(!1),2000)},z=(A,V)=>{A.stopPropagation(),m(t.hash,V)},q=L?"border-b border-ink/5 transition-colors cursor-pointer hover:bg-ink/[0.015]":"border-b border-ink/5";return e("div",{onClick:L?c:void 0,"data-testid":"commit-row","data-commit-hash":t.hash,className:q,children:e("div",{className:"py-2.5 flex flex-col",children:[e("div",{className:"flex flex-col gap-1",children:[t.refs&&t.refs.length>0&&e("div",{className:"flex flex-wrap items-center gap-1.5 pb-0.5",children:t.refs.map((A,V)=>{let Y=A.includes("stash"),_=A.includes("HEAD")||A.includes("main")||A.includes("master");return e("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono border ${Y?"bg-warning/10 text-ink/80 border-warning/25 font-semibold":_?"bg-ink/10 text-ink font-semibold border-ink/20":"bg-canvas text-muted border-ink/10 font-medium"}`,children:A},V)})}),e("div",{ref:w,className:"flex items-start gap-1.5",children:e("button",{type:"button",onClick:L?(A)=>{A.stopPropagation(),c()}:void 0,"aria-expanded":L?l:void 0,className:"flex flex-1 min-w-0 items-start gap-1.5 text-left cursor-pointer rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20",children:[e("span",{"data-commit-title":"",className:"text-[13px] font-semibold text-ink leading-snug break-words flex-1 min-w-0",children:t.message}),L&&e("span",{className:"text-ink/55 flex-shrink-0 mt-0.5","aria-hidden":"true",children:l?e(E,{size:13}):e(ue,{size:13})})]})}),M&&l&&e("div",{className:"border-l-2 border-ink/15 pl-3 py-1",children:e(J,{content:G,className:"text-ink/70"})}),e("div",{className:"flex items-center gap-x-2 gap-y-0.5 text-[11px] text-muted font-mono flex-wrap",children:[e("span",{children:t.author}),e("span",{children:t.date}),e("button",{type:"button",onClick:B,title:"Copy commit hash","aria-label":`Copy commit hash ${t.shortHash}`,className:"inline-flex items-center gap-1 hover:text-ink transition-colors cursor-pointer text-ink/70",children:[e("span",{children:t.shortHash}),C?e(f,{size:11,className:"text-success-text","aria-hidden":"true"}):e(ae,{size:11,"aria-hidden":"true"})]}),y&&e("span",{children:[b," ",b===1?"file":"files"]})]})]}),l&&e("div",{className:"mt-2",children:e(ct,{commit:t,onAction:r})}),y&&l&&e("div",{className:"mt-2 flex flex-col gap-1",children:k.map((A,V)=>{let Y=g(t.hash,A.file),_=`${t.hash}:${A.file}`,H=P[_]!==void 0?P[_]:A.diff,O=x(t.hash,A.file),D=A.status==="A"?"text-success-text font-bold":A.status==="D"?"text-error-text font-bold":A.status==="R"?"text-meta-text font-bold":"text-info-text font-bold";return e("div",{className:"flex flex-col",children:[e("button",{type:"button",onClick:(oe)=>z(oe,A),"aria-expanded":Y,className:"flex w-full items-center gap-2 py-1 px-2 rounded text-[11.5px] font-mono text-ink/80 transition-colors group cursor-pointer border border-transparent hover:border-ink/10 text-left",children:[e("span",{className:`w-3.5 text-center flex-shrink-0 text-[11px] ${D}`,children:A.status||"M"}),e("span",{className:"truncate flex-1 min-w-0 text-ink/90 group-hover:text-ink font-medium",children:A.file}),e("span",{className:"flex items-center gap-1 text-[10.5px] tabular-nums flex-shrink-0 font-medium",children:[e("span",{className:"text-success-text",children:["+",A.additions]}),e("span",{className:"text-ink/30",children:"/"}),e("span",{className:"text-error-text",children:["-",A.deletions]})]}),e("span",{className:"text-ink/55 group-hover:text-ink flex-shrink-0",children:Y?e(E,{size:13,"aria-hidden":"true"}):e(ue,{size:13,"aria-hidden":"true"})})]}),Y&&e("div",{className:"pl-4 pr-1",children:e(ut,{diffText:H,isLoading:O,filePath:A.file,fullContext:v(t.hash,A.file),onToggleContext:()=>N(t.hash,A)})})]},V)})})]})})}var xe=50;function Vt(t){if(!Array.isArray(t))return[];let l=[];for(let c of t){if(!c||typeof c!=="object")continue;let r=c;if(typeof r.file!=="string"||!r.file)continue;l.push({file:r.file,status:typeof r.status==="string"?r.status:"M",additions:typeof r.additions==="number"&&Number.isFinite(r.additions)?r.additions:0,deletions:typeof r.deletions==="number"&&Number.isFinite(r.deletions)?r.deletions:0,diff:typeof r.diff==="string"?r.diff:void 0})}return l}function Ie(t){if(!Array.isArray(t))return[];let l=[];for(let c of t){if(!c||typeof c!=="object")continue;let r=c,m=typeof r.hash==="string"&&r.hash?r.hash:"";if(!m)continue;l.push({hash:m,shortHash:typeof r.shortHash==="string"&&r.shortHash?r.shortHash:m.slice(0,8),author:typeof r.author==="string"?r.author:"Unknown",date:typeof r.date==="string"?r.date:typeof r.time==="string"?r.time:"",message:typeof r.message==="string"?r.message:"",body:typeof r.body==="string"?r.body:void 0,parents:Array.isArray(r.parents)?r.parents.filter((g)=>typeof g==="string"):[],refs:Array.isArray(r.refs)?r.refs.filter((g)=>typeof g==="string"):[],files:Vt(r.files),lane:typeof r.lane==="number"?r.lane:void 0})}return l}function bt({output:t,isGraphMode:l,rootPath:c,activeRepo:r}){let[m,g]=n(!1),[x,v]=n(t?.hasMore??t?.data?.length===xe),[N,P]=n(t?.total),w=u(()=>Ie(t?.data),[t?.data]),C=Array.isArray(t?.data)?t.data.length:0,[R,G]=n(w),[M,k]=n(C);o(()=>{if(G(w),k(C),v(t?.hasMore??C===xe),typeof t?.total==="number")P(t.total)},[w,C,t?.hasMore,t?.total]);let b=a(async()=>{if(m||!x)return;g(!0);try{let y=new FormData;if(y.set("actionType",l?"graph":"history"),y.set("limit",String(xe)),y.set("skip",String(M)),c)y.set("root",c);if(r)y.set("repo",r);let B=await(await fetch("/api/fs/git",{method:"POST",body:y})).json();if(B.success&&Array.isArray(B.data)){let z=Ie(B.data),q=B.data.length;if(G((A)=>{let V=new Set(A.map((_)=>_.hash)),Y=z.filter((_)=>!V.has(_.hash));return[...A,...Y]}),k((A)=>A+q),v(Boolean(B.hasMore??q===xe)),typeof B.total==="number")P(B.total)}else v(!1)}catch(y){console.error("Failed to load more commits:",y)}finally{g(!1)}},[m,x,l,M,c,r]);return{commits:R,hasMore:x,totalCount:N,isLoadingMore:m,handleLoadMore:b}}function vt({onExecuteAction:t,rootPath:l,activeRepo:c}){let[r,m]=n({}),[g,x]=n(new Set),[v,N]=n(new Set),[P,w]=n(new Set),C=a(async(k,b,y)=>{let L=`${k}:${b.file}`;N((B)=>new Set(B).add(L));try{let B=new FormData;if(B.set("actionType","commit_diff"),B.set("hash",k),B.set("file",b.file),y)B.set("full","1");if(l)B.set("root",l);if(c&&c!==".")B.set("repo",c);let q=await(await fetch("/api/fs/git",{method:"POST",body:B})).json();if(q&&typeof q.diff==="string")m((A)=>({...A,[L]:q.diff}));else if(q&&q.error)m((A)=>({...A,[L]:`// Error: ${q.error}`}))}catch(B){console.error("Failed to load file diff:",B);let z=B instanceof Error?B.message:"Network error";m((q)=>({...q,[L]:`// Error loading diff: ${z}`}))}finally{N((B)=>{let z=new Set(B);return z.delete(L),z})}},[l,c]),R=a(async(k,b)=>{let y=`${k}:${b.file}`,L=!g.has(y);if(x((B)=>{let z=new Set(B);if(z.has(y))z.delete(y);else z.add(y);return z}),L&&r[y]===void 0&&!b.diff)await C(k,b,!1)},[g,r,C]),G=a(async(k,b)=>{let y=`${k}:${b.file}`,L=!P.has(y);w((B)=>{let z=new Set(B);if(z.has(y))z.delete(y);else z.add(y);return z}),await C(k,b,L)},[P,C]),M=a((k,b)=>{if(!t)return;if(k==="checkout")t("checkout",void 0,{branch:b.hash});else if(k==="create_branch_here"){let y=window.prompt(`Create new branch at commit ${b.shortHash}:`,`branch-${b.shortHash}`);if(y?.trim())t("create_branch_at",void 0,{branch:y.trim(),hash:b.hash})}else if(k==="cherry_pick"){if(window.confirm(`Cherry-pick commit ${b.shortHash} onto current branch?`))t("cherry_pick",void 0,{hash:b.hash})}else if(k==="revert"){if(window.confirm(`Revert commit ${b.shortHash}?`))t("revert_commit",void 0,{hash:b.hash})}else if(k==="reset"){let y=window.prompt(`Reset current branch to ${b.shortHash} (soft, mixed, hard):`,"soft");if(y&&["soft","mixed","hard"].includes(y.toLowerCase()))t("reset_commit",void 0,{hash:b.hash,mode:y.toLowerCase()})}else if(k==="merge"){if(window.confirm(`Merge commit ${b.shortHash} into current branch?`))t("merge_commit",void 0,{hash:b.hash})}else if(k==="rebase"){if(window.confirm(`Rebase current branch onto commit ${b.shortHash}?`))t("rebase_commit",void 0,{hash:b.hash})}},[t]);return{fileDiffs:r,expandedFiles:g,loadingFiles:v,fullContextFiles:P,handleToggleFile:R,handleToggleContext:G,handleCommitAction:M}}function kt(t){let[l,c]=n({page:t,hash:""}),r=l.page===t?l.hash:"",m=a((g)=>{c((x)=>{let v=x.page===t&&x.hash===g;return{page:t,hash:v?"":g}})},[t]);return{expandedHash:r,toggleExpanded:m}}function je({output:t,onClose:l,onRefresh:c,onExecuteAction:r,rootPath:m,activeRepo:g}){if(o(()=>{if(!t)return;let j=(W)=>{if(W.key==="Escape")l()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[t,l]),!t)return null;let[x,v]=n(()=>({title:t.title,graph:t.title.toLowerCase().includes("graph")}));if(x.title!==t.title)v({title:t.title,graph:t.title.toLowerCase().includes("graph")});let N=x.graph,P=(j)=>v((W)=>({...W,graph:j})),[w,C]=n(""),{expandedHash:R,toggleExpanded:G}=kt(t),[M,k]=n(!1),{commits:b,hasMore:y,totalCount:L,isLoadingMore:B,handleLoadMore:z}=bt({output:t,isGraphMode:N,rootPath:m,activeRepo:g}),{fileDiffs:q,expandedFiles:A,loadingFiles:V,fullContextFiles:Y,handleToggleFile:_,handleToggleContext:H,handleCommitAction:O}=vt({onExecuteAction:r,rootPath:m,activeRepo:g}),D=u(()=>{if(!w.trim())return b;let j=w.toLowerCase().trim();return b.filter((W)=>W.message.toLowerCase().includes(j)||W.author.toLowerCase().includes(j)||W.shortHash.toLowerCase().includes(j)||W.hash.toLowerCase().includes(j)||W.refs?.some((ne)=>ne.toLowerCase().includes(j)))},[b,w]),oe=i(null),se=i(null),ve=i(null),me=i({}),[pe,ke]=n({}),[Pe,$e]=n(800);o(()=>{let j=ve.current;if(!j||!y||B||w.trim())return;let W=new IntersectionObserver((ne)=>{if(ne[0].isIntersecting)z()},{root:oe.current,threshold:0.1});return W.observe(j),()=>W.disconnect()},[y,B,w,z]);let re=a(()=>{if(!oe.current||!se.current)return;let j=oe.current.getBoundingClientRect(),W=oe.current.scrollTop,ne={};D.forEach((ge,Ee)=>{let we=me.current[ge.hash];if(we){let ce=we.getBoundingClientRect();ne[ge.hash]=ce.top+ce.height/2-j.top+W}else ne[ge.hash]=Ee*60+20}),ke(ne);let De=se.current.offsetHeight;$e(Math.max(De,oe.current.clientHeight,600))},[D]);K(()=>{re();let j=requestAnimationFrame(()=>{re()});return()=>cancelAnimationFrame(j)},[re,D,q,A,N,R]),o(()=>{let j=se.current;if(!j)return;let W=new ResizeObserver(()=>{re()});W.observe(j);for(let ne of Array.from(j.children))W.observe(ne);return()=>W.disconnect()},[re,D]);let ee=u(()=>Ge(D),[D]),Me=u(()=>{let j=0;return ee.forEach((W)=>{if(W>j)j=W}),j},[ee]),ye=18,Ce=16,Le=N?(Me+1)*ye+Ce*2:36,Ae=()=>{k(!0),c?.(),setTimeout(()=>k(!1),600)};return e("div",{className:"fixed inset-0 z-50 modal-scrim backdrop-blur-xs flex items-center justify-center p-0 lg:p-5",onClick:l,role:"dialog","aria-modal":"true","aria-label":t.title,children:e("div",{className:`glass-overlay bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden
4
4
  w-full h-full rounded-none border-0
@@ -1 +1 @@
1
- import{zn,Ao,fp,Pi,ri,Xs,Ku,el,dg,Vu,gp,Ap,hp,bp,NA,tl,Yu,QA,Ju,Er,RA}from"./index-p8bta9ae.js";import"./index-4kchzh9y.js";export{el as IndentContext,RA as StreamLanguage,Ju as bracketMatching,tl as codeFolding,hp as foldAll,gp as foldCode,Yu as foldGutter,NA as foldKeymap,Vu as foldService,ri as getIndentUnit,Ku as getIndentation,QA as highlightingFor,dg as indentOnInput,fp as indentService,Xs as indentString,Pi as indentUnit,Ao as language,Er as matchBrackets,zn as syntaxTree,bp as unfoldAll,Ap as unfoldCode};
1
+ import{zn,Ao,fp,Pi,ri,Xs,Ku,el,dg,Vu,gp,Ap,hp,bp,NA,tl,Yu,QA,Ju,Er,RA}from"./index-tk1vr8q2.js";import"./index-4kchzh9y.js";export{el as IndentContext,RA as StreamLanguage,Ju as bracketMatching,tl as codeFolding,hp as foldAll,gp as foldCode,Yu as foldGutter,NA as foldKeymap,Vu as foldService,ri as getIndentUnit,Ku as getIndentation,QA as highlightingFor,dg as indentOnInput,fp as indentService,Xs as indentString,Pi as indentUnit,Ao as language,Er as matchBrackets,zn as syntaxTree,bp as unfoldAll,Ap as unfoldCode};
@@ -1,2 +1,2 @@
1
- import{d,n,o,i,a,e,p,Q,dn,Ia,Ue,F,S,er,h,He,we,T,Jh,Km,Nd,Zh,Rc}from"./index-jvn2xfpt.js";import{rd}from"./index-rtfw07hy.js";import"./index-e2y4hkps.js";var Oe={idle:"Kosong",loading:"Memuat",ready:"Siap"},ee="p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors";function ae({url:t,input:r,loading:s,error:l,canGoBack:c,canGoForward:u,viewportMode:f,zoomLevel:m,onInputChange:g,onSubmit:y,onBack:U,onForward:L,onReload:w,onOpenExternal:E,onIncludeInChat:b,onChangeViewport:z,onZoomIn:N,onZoomOut:C,onResetZoom:x,onSetZoom:k,annotate:R,focusKey:A}){let O=i(void 0),D=i(null),G=i(null);o(()=>{if(O.current===t)return;O.current=t;let v=G.current;if(G.current=null,!t)return;if(v!==null&&v!==r)return;g(t)},[t,r,g]);let M=i(A);o(()=>{if(A===void 0||M.current===A)return;if(M.current=A,t)return;D.current?.focus()},[A,t]);let B=(v)=>{G.current=v,g(v)},I=!t?"idle":s?"loading":"ready",P=I==="ready"?"bg-success animate-pulse":I==="loading"?"bg-ink/40 animate-pulse":"bg-ink/25",Z=e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 flex-shrink-0",children:[e("button",{type:"button",onClick:U,disabled:!c,"aria-label":"Back",title:"Back",className:ee,children:e(dn,{size:12})}),e("button",{type:"button",onClick:L,disabled:!u,"aria-label":"Maju",title:"Maju",className:ee,children:e(Ia,{size:12})}),e("button",{type:"button",onClick:w,disabled:!t,"aria-label":"Reload",title:"Reload",className:ee,children:e(S,{size:12,className:s?"animate-spin":void 0})})]});return e(rd,{twoRows:!0,url:t,statusDotClass:P,statusLabel:Oe[I],viewportMode:f,zoomLevel:m,onChangeViewport:z,onZoomIn:N,onZoomOut:C,onResetZoom:x,onSetZoom:k,annotate:R,onIncludeInChat:b,onOpenExternal:E,openExternalLabel:"Buka di tab baru",openExternalTitle:"Buka di tab baru (untuk situs yang menolak iframe)",children:e("div",{className:"flex items-center flex-1 min-w-0 space-x-1.5",children:[Z,e("form",{className:`flex-1 min-w-0 flex items-center bg-canvas border rounded-md px-2 py-1 space-x-1 focus-within:border-ink/40 ${l?"border-error":"border-ink/15"}`,onSubmit:(v)=>{v.preventDefault(),y(r)},children:[e(Ue,{size:12,className:"text-ink/40 flex-shrink-0"}),e("input",{ref:D,type:"text",value:r,onChange:(v)=>B(v.currentTarget.value),placeholder:"Type an address (e.g. localhost:5173) and press Enter…","aria-label":"Browser address","aria-invalid":l!==void 0&&l!==null,title:l??void 0,spellcheck:!1,autoComplete:"off",className:`w-full min-w-0 bg-transparent outline-none font-mono text-[11px] placeholder:text-ink/35 ${l?"text-error":"text-ink/90"}`})]})]})})}var ie={"desktop-16-9":"w-full max-w-[1280px] aspect-video max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",laptop:"w-[1024px] max-w-full h-[768px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",tablet:"w-[768px] max-w-full h-[1024px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",mobile:"w-[375px] max-w-full h-[667px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto","mobile-lg":"w-[414px] max-w-full h-[896px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto",responsive:"w-full h-full border-0"};function le(t){let r=t.trim();if(!r)return"";try{let s=new URL(r),l=s.pathname==="/"?"":s.pathname;return`${s.hostname}${l}`.slice(0,64)}catch{return r.slice(0,64)}}var X=12,ce=60,ze=8192,de=0;function W(){return de+=1,`tab-${Date.now().toString(36)}-${de}`}function Y(t,r=""){return r?{id:t,history:[r],index:0,frameKey:0}:{id:t,history:[],index:-1,frameKey:0}}function K(t){if(!t||t.index<0)return"";return t.history[t.index]??""}function te(t){return Boolean(t)&&t.index>0}function ne(t){return Boolean(t)&&t.index>=0&&t.index<t.history.length-1}function ue(t,r){if(K(t)===r)return re(t);let s=[...t.history.slice(0,t.index+1),r],l=Math.max(0,s.length-ce),c=l>0?s.slice(l):s;return{...t,history:c,index:c.length-1,frameKey:t.frameKey+1}}function oe(t,r){let s=t.index+r;if(s<0||s>=t.history.length)return t;return{...t,index:s}}function re(t){return{...t,frameKey:t.frameKey+1}}function pe(t,r,s){let l=t.findIndex((f)=>f.id===s);if(l===-1)return{tabs:t,activeId:r};let c=t.filter((f)=>f.id!==s);if(r!==s)return{tabs:c,activeId:r};let u=c[Math.min(l,c.length-1)]??null;return{tabs:c,activeId:u?u.id:null}}function me(t,r){return t.find((s)=>s.id===r)??t[t.length-1]??null}function Fe(t){if(!Array.isArray(t))return[];let r=[];for(let s of t){if(typeof s!=="string")continue;let l=s.trim();if(!l||l.length>ze)continue;if(r.push(l),r.length>=ce)break}return r}function se(t){if(!Array.isArray(t))return[];let r=[],s=new Set;for(let l of t){if(typeof l!=="object"||l===null)continue;let c=l,u=typeof c.id==="string"?c.id.trim():"";if(!u||s.has(u))continue;let f=Fe(c.history),m=typeof c.index==="number"&&Number.isFinite(c.index)?Math.trunc(c.index):-1,g=f.length===0?-1:Math.min(f.length-1,Math.max(0,m===-1?0:m)),y=typeof c.frameKey==="number"&&Number.isFinite(c.frameKey)?Math.trunc(c.frameKey):0;if(s.add(u),r.push({id:u,history:f,index:g,frameKey:Math.max(0,y)}),r.length>=X)break}return r}function fe(t){return le(K(t))||"Tab baru"}var Ke="clipboard-read; clipboard-write; fullscreen";function he({tabs:t,activeTabId:r,loadingTabId:s,viewportMode:l,zoomLevel:c,onLoad:u,active:f=!0,overlay:m,onFrame:g}){let y=i(new Map),U=t.map((w)=>`${w.id}:${w.frameKey}`).join("|");if(o(()=>{g?.(r?y.current.get(r)??null:null)},[r,g,U]),!f)return null;let L=t.filter((w)=>K(w)!=="");if(L.length===0)return e("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none",children:[e("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:e(Ue,{size:22})}),e("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Browser Anda"}),e("p",{className:"text-xs text-ink/60 max-w-sm",children:"Type an address above and press Enter. The page loads inside this panel."}),e("p",{className:"text-[11px] text-ink/45 max-w-sm mt-2",children:"Sebagian situs (Google, GitHub) menolak ditampilkan dalam iframe — pakai tombol buka di tab baru."})]});return e("div",{className:"flex-1 min-h-0 relative flex items-center justify-center p-2 overflow-auto bg-canvas/60",children:L.map((w)=>{let E=K(w),b=w.id===r,z=w.id===s;return e("div",{"data-user-browser-tab":w.id,className:b?"relative flex-1 min-h-0 flex items-center justify-center":"hidden",children:[z?e("div",{className:"absolute inset-0 z-10 flex items-center justify-center pointer-events-none",children:e("div",{className:"flex items-center space-x-2 px-3 py-1.5 rounded-md bg-paper border border-ink/15",children:[e(p,{size:13,className:"animate-spin text-ink/50"}),e("span",{className:"text-[11px] font-mono text-ink/60",children:"Memuat…"})]})}):null,e("div",{className:`relative flex flex-col bg-white ${ie[l]} transition-all duration-200`,style:{zoom:c!==100?`${c}%`:void 0,transformOrigin:"top center"},children:[e("iframe",{ref:(N)=>{if(N)y.current.set(w.id,N);else y.current.delete(w.id)},src:E,title:`Browser pengguna ${w.id}`,onLoad:()=>u(w.id),referrerPolicy:"no-referrer",allow:Ke,className:"w-full h-full bg-white border-0",style:b&&m?{pointerEvents:"none"}:void 0},`${w.id}:${w.frameKey}`),b?m:null]})]},w.id)})})}var be="cursor-pointer transition-colors";function ge({tabs:t,activeTabId:r,canOpenTab:s,onSelect:l,onClose:c,onNewTab:u}){let f=i(null);return o(()=>{f.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[r,t.length]),e("div",{"data-toolbar-band":"strip",className:"h-8 px-1.5 border-b border-ink/10 bg-paper flex items-center gap-1 flex-shrink-0 select-none",children:[e("div",{className:"flex-1 min-w-0 flex items-center gap-1 overflow-x-auto",children:t.map((m)=>{let g=m.id===r,y=fe(m),U=K(m);return e("div",{ref:g?f:void 0,className:`group flex items-center rounded border flex-shrink-0 ${g?"bg-ink text-canvas border-ink":"bg-paper text-ink/70 border-ink/15 hover:border-ink/35 hover:text-ink"}`,children:[e("button",{type:"button",onClick:()=>l(m.id),"aria-pressed":g,"aria-label":`Tab ${y}`,title:U?`${y}
1
+ import{d,n,o,i,a,e,p,Q,dn,Ia,Ue,F,S,er,h,He,we,T,Jh,Km,Nd,Zh,Rc}from"./index-7ckzdf4r.js";import{rd}from"./index-wp7tsava.js";import"./index-r51fqzb5.js";var Oe={idle:"Kosong",loading:"Memuat",ready:"Siap"},ee="p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors";function ae({url:t,input:r,loading:s,error:l,canGoBack:c,canGoForward:u,viewportMode:f,zoomLevel:m,onInputChange:g,onSubmit:y,onBack:U,onForward:L,onReload:w,onOpenExternal:E,onIncludeInChat:b,onChangeViewport:z,onZoomIn:N,onZoomOut:C,onResetZoom:x,onSetZoom:k,annotate:R,focusKey:A}){let O=i(void 0),D=i(null),G=i(null);o(()=>{if(O.current===t)return;O.current=t;let v=G.current;if(G.current=null,!t)return;if(v!==null&&v!==r)return;g(t)},[t,r,g]);let M=i(A);o(()=>{if(A===void 0||M.current===A)return;if(M.current=A,t)return;D.current?.focus()},[A,t]);let B=(v)=>{G.current=v,g(v)},I=!t?"idle":s?"loading":"ready",P=I==="ready"?"bg-success animate-pulse":I==="loading"?"bg-ink/40 animate-pulse":"bg-ink/25",Z=e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 flex-shrink-0",children:[e("button",{type:"button",onClick:U,disabled:!c,"aria-label":"Back",title:"Back",className:ee,children:e(dn,{size:12})}),e("button",{type:"button",onClick:L,disabled:!u,"aria-label":"Maju",title:"Maju",className:ee,children:e(Ia,{size:12})}),e("button",{type:"button",onClick:w,disabled:!t,"aria-label":"Reload",title:"Reload",className:ee,children:e(S,{size:12,className:s?"animate-spin":void 0})})]});return e(rd,{twoRows:!0,url:t,statusDotClass:P,statusLabel:Oe[I],viewportMode:f,zoomLevel:m,onChangeViewport:z,onZoomIn:N,onZoomOut:C,onResetZoom:x,onSetZoom:k,annotate:R,onIncludeInChat:b,onOpenExternal:E,openExternalLabel:"Buka di tab baru",openExternalTitle:"Buka di tab baru (untuk situs yang menolak iframe)",children:e("div",{className:"flex items-center flex-1 min-w-0 space-x-1.5",children:[Z,e("form",{className:`flex-1 min-w-0 flex items-center bg-canvas border rounded-md px-2 py-1 space-x-1 focus-within:border-ink/40 ${l?"border-error":"border-ink/15"}`,onSubmit:(v)=>{v.preventDefault(),y(r)},children:[e(Ue,{size:12,className:"text-ink/40 flex-shrink-0"}),e("input",{ref:D,type:"text",value:r,onChange:(v)=>B(v.currentTarget.value),placeholder:"Type an address (e.g. localhost:5173) and press Enter…","aria-label":"Browser address","aria-invalid":l!==void 0&&l!==null,title:l??void 0,spellcheck:!1,autoComplete:"off",className:`w-full min-w-0 bg-transparent outline-none font-mono text-[11px] placeholder:text-ink/35 ${l?"text-error":"text-ink/90"}`})]})]})})}var ie={"desktop-16-9":"w-full max-w-[1280px] aspect-video max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",laptop:"w-[1024px] max-w-full h-[768px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",tablet:"w-[768px] max-w-full h-[1024px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",mobile:"w-[375px] max-w-full h-[667px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto","mobile-lg":"w-[414px] max-w-full h-[896px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto",responsive:"w-full h-full border-0"};function le(t){let r=t.trim();if(!r)return"";try{let s=new URL(r),l=s.pathname==="/"?"":s.pathname;return`${s.hostname}${l}`.slice(0,64)}catch{return r.slice(0,64)}}var X=12,ce=60,ze=8192,de=0;function W(){return de+=1,`tab-${Date.now().toString(36)}-${de}`}function Y(t,r=""){return r?{id:t,history:[r],index:0,frameKey:0}:{id:t,history:[],index:-1,frameKey:0}}function K(t){if(!t||t.index<0)return"";return t.history[t.index]??""}function te(t){return Boolean(t)&&t.index>0}function ne(t){return Boolean(t)&&t.index>=0&&t.index<t.history.length-1}function ue(t,r){if(K(t)===r)return re(t);let s=[...t.history.slice(0,t.index+1),r],l=Math.max(0,s.length-ce),c=l>0?s.slice(l):s;return{...t,history:c,index:c.length-1,frameKey:t.frameKey+1}}function oe(t,r){let s=t.index+r;if(s<0||s>=t.history.length)return t;return{...t,index:s}}function re(t){return{...t,frameKey:t.frameKey+1}}function pe(t,r,s){let l=t.findIndex((f)=>f.id===s);if(l===-1)return{tabs:t,activeId:r};let c=t.filter((f)=>f.id!==s);if(r!==s)return{tabs:c,activeId:r};let u=c[Math.min(l,c.length-1)]??null;return{tabs:c,activeId:u?u.id:null}}function me(t,r){return t.find((s)=>s.id===r)??t[t.length-1]??null}function Fe(t){if(!Array.isArray(t))return[];let r=[];for(let s of t){if(typeof s!=="string")continue;let l=s.trim();if(!l||l.length>ze)continue;if(r.push(l),r.length>=ce)break}return r}function se(t){if(!Array.isArray(t))return[];let r=[],s=new Set;for(let l of t){if(typeof l!=="object"||l===null)continue;let c=l,u=typeof c.id==="string"?c.id.trim():"";if(!u||s.has(u))continue;let f=Fe(c.history),m=typeof c.index==="number"&&Number.isFinite(c.index)?Math.trunc(c.index):-1,g=f.length===0?-1:Math.min(f.length-1,Math.max(0,m===-1?0:m)),y=typeof c.frameKey==="number"&&Number.isFinite(c.frameKey)?Math.trunc(c.frameKey):0;if(s.add(u),r.push({id:u,history:f,index:g,frameKey:Math.max(0,y)}),r.length>=X)break}return r}function fe(t){return le(K(t))||"Tab baru"}var Ke="clipboard-read; clipboard-write; fullscreen";function he({tabs:t,activeTabId:r,loadingTabId:s,viewportMode:l,zoomLevel:c,onLoad:u,active:f=!0,overlay:m,onFrame:g}){let y=i(new Map),U=t.map((w)=>`${w.id}:${w.frameKey}`).join("|");if(o(()=>{g?.(r?y.current.get(r)??null:null)},[r,g,U]),!f)return null;let L=t.filter((w)=>K(w)!=="");if(L.length===0)return e("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none",children:[e("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:e(Ue,{size:22})}),e("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Browser Anda"}),e("p",{className:"text-xs text-ink/60 max-w-sm",children:"Type an address above and press Enter. The page loads inside this panel."}),e("p",{className:"text-[11px] text-ink/45 max-w-sm mt-2",children:"Sebagian situs (Google, GitHub) menolak ditampilkan dalam iframe — pakai tombol buka di tab baru."})]});return e("div",{className:"flex-1 min-h-0 relative flex items-center justify-center p-2 overflow-auto bg-canvas/60",children:L.map((w)=>{let E=K(w),b=w.id===r,z=w.id===s;return e("div",{"data-user-browser-tab":w.id,className:b?"relative flex-1 min-h-0 flex items-center justify-center":"hidden",children:[z?e("div",{className:"absolute inset-0 z-10 flex items-center justify-center pointer-events-none",children:e("div",{className:"flex items-center space-x-2 px-3 py-1.5 rounded-md bg-paper border border-ink/15",children:[e(p,{size:13,className:"animate-spin text-ink/50"}),e("span",{className:"text-[11px] font-mono text-ink/60",children:"Memuat…"})]})}):null,e("div",{className:`relative flex flex-col bg-white ${ie[l]} transition-all duration-200`,style:{zoom:c!==100?`${c}%`:void 0,transformOrigin:"top center"},children:[e("iframe",{ref:(N)=>{if(N)y.current.set(w.id,N);else y.current.delete(w.id)},src:E,title:`Browser pengguna ${w.id}`,onLoad:()=>u(w.id),referrerPolicy:"no-referrer",allow:Ke,className:"w-full h-full bg-white border-0",style:b&&m?{pointerEvents:"none"}:void 0},`${w.id}:${w.frameKey}`),b?m:null]})]},w.id)})})}var be="cursor-pointer transition-colors";function ge({tabs:t,activeTabId:r,canOpenTab:s,onSelect:l,onClose:c,onNewTab:u}){let f=i(null);return o(()=>{f.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[r,t.length]),e("div",{"data-toolbar-band":"strip",className:"h-8 px-1.5 border-b border-ink/10 bg-paper flex items-center gap-1 flex-shrink-0 select-none",children:[e("div",{className:"flex-1 min-w-0 flex items-center gap-1 overflow-x-auto",children:t.map((m)=>{let g=m.id===r,y=fe(m),U=K(m);return e("div",{ref:g?f:void 0,className:`group flex items-center rounded border flex-shrink-0 ${g?"bg-ink text-canvas border-ink":"bg-paper text-ink/70 border-ink/15 hover:border-ink/35 hover:text-ink"}`,children:[e("button",{type:"button",onClick:()=>l(m.id),"aria-pressed":g,"aria-label":`Tab ${y}`,title:U?`${y}
2
2
  ${U}`:y,className:`pl-2 pr-1 py-0.5 text-[11px] font-mono max-w-[150px] truncate ${be}`,children:y}),e("button",{type:"button",onClick:()=>c(m.id),"aria-label":`Tutup tab ${y}`,title:`Tutup tab ${y}`,className:`mr-0.5 p-1 rounded hover:bg-error hover:text-paper ${be} ${g?"text-on-ink-muted":"text-ink/40 opacity-0 group-hover:opacity-100 focus-visible:opacity-100"}`,children:e(h,{size:11})})]},m.id)})}),e("button",{type:"button",onClick:u,disabled:!s,"aria-label":"Tab baru",title:s?"Tab baru":`Maksimal ${X} tab`,className:"p-1 rounded hover:bg-ink/5 text-ink/60 hover:text-ink disabled:opacity-30 disabled:hover:bg-transparent disabled:cursor-not-allowed cursor-pointer transition-colors flex-shrink-0",children:e(F,{size:13})})]})}var xe="w-full min-w-0 bg-canvas border border-ink/15 rounded px-2 py-1 text-[11px] font-mono text-ink placeholder:text-ink/35 focus:outline-none focus:border-ink/40";function De(t){if(!t||t.ok)return null;if(t.reason==="cross-origin")return"This page is cross-origin, so its elements cannot be read. Name the part and add a note instead.";if(t.reason==="no-frame")return"The page has not loaded, so its elements cannot be read yet.";return"There is no element at this point (empty space). Name the part instead."}function ve({shape:t,index:r,readability:s,onLabel:l,onNote:c}){let u=De(s),f=t.element;return e("div",{className:"flex items-start gap-1.5 min-w-0",children:[e("span",{className:"text-[11px] font-mono text-ink/45 pt-1 flex-shrink-0",children:[Nd[t.tool]," #",r]}),e("div",{className:"flex-1 min-w-0 space-y-1",children:[e("div",{className:"flex items-center gap-1 flex-wrap",children:[e("span",{className:"text-[10px] uppercase font-mono text-ink/40",children:"bagian"}),Zh.map((m)=>{let g=t.label===m;return e("button",{type:"button",onClick:()=>l(g?"":m),"aria-pressed":g,className:`px-1.5 py-0.5 rounded-full border text-[10px] font-mono transition-colors cursor-pointer ${g?"bg-ink text-canvas border-ink":"bg-canvas text-ink/65 border-ink/15 hover:border-ink/40"}`,children:m},m)}),e("input",{value:t.label,onInput:(m)=>l(m.currentTarget.value),placeholder:"or type your own…","aria-label":"Name of the marked part",spellcheck:!1,className:`${xe} flex-1 min-w-[110px]`})]}),e("textarea",{value:t.note,onInput:(m)=>c(m.currentTarget.value),placeholder:"What is wrong with this part? (e.g. the Pay button looks disabled)",rows:2,"aria-label":"Annotation note",className:`${xe} resize-y`}),f?e("p",{className:"text-[10px] font-mono text-ink/45 truncate",title:f.path,children:["elemen: ",f.path,f.state?` · ${f.state}`:""]}):null,u?e("p",{className:"text-[10px] text-ink/40",children:u}):null]})]})}var Ge=["box","pin","arrow"],Ve="px-2 py-1 rounded text-[11px] font-mono border transition-colors cursor-pointer",j="flex items-center gap-1 px-2 py-1 rounded text-[11px] border border-ink/15 hover:border-ink/40 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed";function ye({tool:t,shapes:r,selectedId:s,readability:l,onTool:c,onLabel:u,onNote:f,onRemove:m,onReset:g,onCancel:y,onSend:U}){let L=r.find((E)=>E.id===s)??null,w=r.length>0;return e("div",{className:"flex-shrink-0 border-b border-ink/10 bg-paper px-2.5 py-1.5 space-y-1.5 select-none",children:[e("div",{className:"flex items-center gap-1.5",children:[e("span",{className:"text-[10px] uppercase font-mono text-ink/50 mr-1",children:"Anotasi"}),Ge.map((E)=>e("button",{type:"button",onClick:()=>c(E),"aria-pressed":t===E,className:`${Ve} ${t===E?"bg-ink text-canvas border-ink":"bg-canvas text-ink/70 border-ink/15 hover:border-ink/40"}`,children:Nd[E]},E)),e("span",{className:"text-[11px] font-mono text-ink/45 ml-1",children:r.length>0?`${r.length} mark${r.length===1?"":"s"}`:"drag on the page to mark a part"}),e("div",{className:"flex-1"}),e("button",{type:"button",onClick:g,disabled:!w,className:j,title:"Clear all marks",children:[e(Q,{size:12})," Bersihkan"]}),e("button",{type:"button",onClick:U,disabled:!w,className:j,title:"Kirim anotasi ke draft chat",children:[e(er,{size:12})," Kirim ke chat"]}),e("button",{type:"button",onClick:y,className:j,title:"Tutup mode anotasi",children:e(h,{size:12})})]}),L?e("div",{className:"flex items-start gap-1.5",children:[e("div",{className:"flex-1 min-w-0",children:e(ve,{shape:L,index:r.indexOf(L)+1,readability:l,onLabel:(E)=>u(L.id,E),onNote:(E)=>f(L.id,E)})}),e("button",{type:"button",onClick:()=>m(L.id),className:j,title:"Remove this mark",children:e(Q,{size:12})})]}):e("p",{className:"text-[11px] text-ink/45",children:"This page cannot be screenshotted, so what gets sent is the area, the part name and your note."})]})}var Te=0;function ke(){return Te+=1,`annot-${Date.now().toString(36)}-${Te}`}function Ae(t){let[r,s]=n(!1),[l,c]=n("box"),[u,f]=n([]),[m,g]=n(null);o(()=>{f([]),g(null)},[t]);let y=a(()=>{s((N)=>!N),g(null)},[]),U=a(()=>{g(null),s(!1)},[]),L=a((N)=>{f((C)=>[...C,N]),g(N.id)},[]),w=a((N,C)=>{f((x)=>x.map((k)=>k.id===N?{...k,note:C}:k))},[]),E=a((N,C)=>{f((x)=>x.map((k)=>k.id===N?{...k,label:C}:k))},[]),b=a((N)=>{f((C)=>C.filter((x)=>x.id!==N)),g((C)=>C===N?null:C)},[]),z=a(()=>{f([]),g(null)},[]);return{active:r,tool:l,shapes:u,selectedId:m,setTool:c,toggle:y,close:U,add:L,setNote:w,setLabel:E,select:g,remove:b,reset:z}}var Xe=4,V="var(--theme-error)";function Be({shapes:t,tool:r,selectedId:s,onMeasure:l,onAdd:c,onSelect:u}){let f=i(null),m=i(null),[g,y]=n(null),[U,L]=n({width:0,height:0});o(()=>{let x=f.current;if(!x)return;let k=()=>{let A=x.getBoundingClientRect();if(A.width<=0||A.height<=0)return;L((O)=>O.width===A.width&&O.height===A.height?O:{width:A.width,height:A.height}),l({width:A.width,height:A.height})};if(k(),typeof ResizeObserver!=="function")return;let R=new ResizeObserver(k);return R.observe(x),()=>R.disconnect()},[l]);let w=(x)=>{let k=f.current;if(!k)return null;let R=k.getBoundingClientRect(),A={x:x.clientX-R.left,y:x.clientY-R.top};return{normalized:Jh(R,A),px:A.x,py:A.y}},E=(x)=>{if(x.button!==0)return;let k=w(x);if(!k)return;x.preventDefault(),u(null),x.currentTarget.setPointerCapture?.(x.pointerId);let R={id:ke(),tool:r,start:k.normalized,end:k.normalized,label:"",note:""};m.current=R,y(R)},b=(x)=>{let k=m.current;if(!k)return;let R=w(x);if(!R)return;let A={...k,end:R.normalized};m.current=A,y(A)},z=(x)=>{let k=m.current;if(!k)return;let R=w(x),A=R?{...k,end:R.normalized}:k;if(m.current=null,y(null),x.currentTarget.releasePointerCapture?.(x.pointerId),A.tool!=="pin"){let O=f.current?.getBoundingClientRect();if((O?Math.hypot((A.end.x-A.start.x)*O.width,(A.end.y-A.start.y)*O.height):0)<Xe)return}c(A)},N=()=>{m.current=null,y(null)},C=g?[...t,g]:t;return e("div",{ref:f,className:"absolute inset-0 cursor-crosshair touch-none",onPointerDown:E,onPointerMove:b,onPointerUp:z,onPointerCancel:N,children:e("svg",{className:"absolute inset-0 w-full h-full",viewBox:`0 0 ${Math.max(1,U.width)} ${Math.max(1,U.height)}`,preserveAspectRatio:"none","aria-label":"Page annotation area",children:C.map((x,k)=>e(We,{shape:x,index:k+1,box:U,selected:x.id===s,onSelect:()=>u(x.id)},x.id))})})}function We({shape:t,index:r,box:s,selected:l,onSelect:c}){let u={x:t.start.x*s.width,y:t.start.y*s.height},f={x:t.end.x*s.width,y:t.end.y*s.height},m=Km(t),g=l?3:2,y=String(r);return e("g",{onPointerDown:(L)=>{L.stopPropagation(),L.preventDefault(),c()},className:"cursor-pointer",children:[t.tool==="box"&&e("rect",{x:m.x*s.width,y:m.y*s.height,width:Math.max(1,m.width*s.width),height:Math.max(1,m.height*s.height),fill:V,fillOpacity:l?0.16:0.1,stroke:V,strokeWidth:g,vectorEffect:"non-scaling-stroke",rx:3}),t.tool==="arrow"&&e(d,{children:[e("line",{x1:u.x,y1:u.y,x2:f.x,y2:f.y,stroke:V,strokeWidth:g,vectorEffect:"non-scaling-stroke"}),e("circle",{cx:f.x,cy:f.y,r:4,fill:V})]}),t.tool==="pin"&&e("circle",{cx:u.x,cy:u.y,r:7,fill:V,fillOpacity:l?0.5:0.3,stroke:V,strokeWidth:g}),e("circle",{cx:u.x,cy:u.y,r:9,fill:V}),e("text",{x:u.x,y:u.y,textAnchor:"middle",dominantBaseline:"central",fontSize:11,fontWeight:700,fill:"var(--theme-paper)",children:y})]})}function Ee(t){let r=t.trim();if(!r)return r;let s=/^[a-z][a-z0-9+.-]*:/i.test(r)?r:`https://${r}`,l=new URL(s);if(l.protocol!=="http:"&&l.protocol!=="https:")throw Error("Only http and https URLs are allowed");return l.toString()}var Ne="userBrowser.tabs",Se="userBrowser.activeTabId",Ze="userBrowser.inputUrl",Ye="userBrowser.history",je="userBrowser.historyIndex";function Me(){let[t,r]=T(Ne,[]),[s,l]=T(Se,null),[c,u]=T(Ze,""),[f,m]=n(null),[g,y]=n(void 0),{sessionId:U,ready:L}=He(),w=i(null),E=(M,B)=>we(U,M)??B,b=me(t,s),z=K(b);o(()=>{if(!L||w.current===U)return;w.current=U;let M=E(Ne,[]),B=se(M);if(B.length>0){if(JSON.stringify(B)!==JSON.stringify(M))r(B);let Z=E(Se,null);if(!B.some((v)=>v.id===Z))l(B[B.length-1].id);return}let[I]=se([{id:W(),history:E(Ye,[]),index:E(je,-1),frameKey:0}]),P=I&&I.history.length>0?I:Y(W());r([P]),l(P.id)},[L,U,r,l]);let N=a((M,B)=>{r((I)=>I.map((P)=>P.id===M?B(P):P))},[r]),C=a((M)=>{let B=M.trim();if(!B)return;let I;try{I=Ee(B)}catch(P){y(P instanceof Error?P.message:"Alamat tidak valid");return}if(y(void 0),u(I),!b){let P=Y(W(),I);r([P]),l(P.id),m(P.id);return}m(b.id),N(b.id,(P)=>ue(P,I))},[b,l,u,r,N]),x=a(()=>{if(!b||!te(b))return;m(b.id),N(b.id,(M)=>oe(M,-1))},[b,N]),k=a(()=>{if(!b||!ne(b))return;m(b.id),N(b.id,(M)=>oe(M,1))},[b,N]),R=a(()=>{if(!b||!z)return;m(b.id),N(b.id,re)},[b,z,N]),A=a((M)=>{m((B)=>B===M?null:B)},[]),O=a(()=>{if(t.length>=X)return;let M=Y(W());r((B)=>[...B,M]),l(M.id),u(""),y(void 0)},[l,u,r,t.length]),D=a((M)=>{let B=t.find((I)=>I.id===M);if(!B)return;l(M),u(K(B)),y(void 0)},[l,u,t]),G=a((M)=>{let B=pe(t,s,M);if(B.tabs.length===0){let I=Y(W());r([I]),l(I.id),u("");return}if(r(B.tabs),B.activeId!==s){l(B.activeId);let I=B.tabs.find((P)=>P.id===B.activeId);u(K(I)),y(void 0)}},[s,l,u,r,t]);return{tabs:t,activeTab:b,activeTabId:b?.id??null,url:z,input:c,setInput:u,frameKey:b?.frameKey??0,loading:f!==null&&f===b?.id,error:g,canGoBack:te(b),canGoForward:ne(b),canOpenTab:t.length<X,submit:C,goBack:x,goForward:k,reload:R,markLoaded:A,openTab:O,selectTab:D,closeTab:G}}function qe(t){if(!t)return"no-frame";try{return t.contentDocument?"readable":"cross-origin"}catch{return"cross-origin"}}function q(t){let r=t.replace(/\s+/g," ").trim();return r.length>60?`${r.slice(0,59)}…`:r}function Je(t){let r=t.tagName.toLowerCase();if(t.id)return`${r}#${t.id}`;for(let l of["data-testid","data-test","aria-label"]){let c=t.getAttribute(l);if(c)return`${r}[${l}="${q(c)}"]`}let s=t.getAttribute("role");if(s)return`${r}[role="${s}"]`;return r}function Qe(t){let r=[],s=t;while(s&&r.length<4){if(s.tagName.toLowerCase()==="html")break;r.unshift(Je(s)),s=s.parentElement}return r.join(" > ")}function et(t){let r=[];if(t.disabled)r.push("nonaktif");if(t instanceof HTMLSelectElement||t.tagName.toLowerCase()==="select"){let s=t,c=s.selectedOptions?.[0]?.textContent?.trim()||s.value;if(c)r.push(`nilai "${q(c)}"`);let u=s.options?.length??0;if(u>0)r.push(`${u} opsi`)}else if(t.tagName.toLowerCase()==="input"){let s=t;if(s.type)r.push(`tipe ${s.type}`);if(s.type!=="password"&&s.placeholder)r.push(`placeholder "${q(s.placeholder)}"`)}return r.length>0?r.join(", "):void 0}function tt(t){let r={path:Qe(t),tag:t.tagName.toLowerCase()},s=t.getAttribute("role");if(s)r.role=s;let l=q(t.innerText??t.textContent??"");if(l)r.text=l;let c=et(t);if(c)r.state=c;return r}function Le(t,r){let s=qe(t);if(s!=="readable")return{ok:!1,reason:s};let{contentWindow:l,contentDocument:c}=t;if(!l||!c)return{ok:!1,reason:"cross-origin"};try{let u=Math.min(Math.max(r.x,0),1)*l.innerWidth,f=Math.min(Math.max(r.y,0),1)*l.innerHeight,m=c.elementFromPoint(u,f);if(!m||m===c.documentElement||m===c.body)return{ok:!1,reason:"no-element"};return{ok:!0,element:tt(m)}}catch{return{ok:!1,reason:"cross-origin"}}}function on({className:t="",active:r=!0}){let[s,l]=T("userBrowser.viewportMode","responsive"),[c,u]=T("userBrowser.zoomLevel",100),[f,m]=n(null),[g,y]=n(null),[U,L]=n(null),{tabs:w,activeTabId:E,url:b,input:z,setInput:N,loading:C,error:x,canGoBack:k,canGoForward:R,canOpenTab:A,submit:O,goBack:D,goForward:G,reload:M,markLoaded:B,openTab:I,selectTab:P,closeTab:Z}=Me(),v=Ae(`${E??""}:${w.find((_)=>_.id===E)?.frameKey??0}`),Ie=a(()=>{if(!b)return;window.open(b,"_blank","noopener,noreferrer")},[b]),Re=a(()=>{if(!b)return;Rc({url:b})},[b]),Pe=a((_)=>{m((H)=>H&&H.width===_.width&&H.height===_.height?H:_)},[]),Ce=a((_)=>{let H=Le(g,_.start);L(H),v.add(H.ok?{..._,element:H.element}:_)},[v,g]),_e=a(()=>{if(!b||v.shapes.length===0)return;let _=c/100;Rc({url:b,annotations:v.shapes,panel:{width:(f?.width??0)/_,height:(f?.height??0)/_,viewportMode:s,zoom:c}}),v.close()},[b,v,f,s,c]),J=v.active&&Boolean(b),$e=C?E??null:null;return e("div",{"data-user-browser-panel":"",className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden ${t}`,children:[e(ge,{tabs:w,activeTabId:E,canOpenTab:A,onSelect:P,onClose:Z,onNewTab:I}),e(ae,{url:b,input:z,loading:C,error:x,canGoBack:k,canGoForward:R,viewportMode:s,zoomLevel:c,onInputChange:N,onSubmit:O,onBack:D,onForward:G,onReload:M,onOpenExternal:Ie,onIncludeInChat:Re,onChangeViewport:l,onZoomIn:()=>u((_)=>Math.min(200,_+10)),onZoomOut:()=>u((_)=>Math.max(50,_-10)),onResetZoom:()=>u(100),onSetZoom:u,focusKey:E??void 0,annotate:{active:J,count:v.shapes.length,onToggle:v.toggle}}),J&&e(ye,{tool:v.tool,shapes:v.shapes,selectedId:v.selectedId,readability:U,onTool:v.setTool,onLabel:v.setLabel,onNote:v.setNote,onRemove:v.remove,onReset:v.reset,onCancel:v.close,onSend:_e}),e(he,{tabs:w,activeTabId:E,loadingTabId:$e,viewportMode:s,zoomLevel:c,onLoad:B,onFrame:y,active:r,overlay:J?e(Be,{shapes:v.shapes,tool:v.tool,selectedId:v.selectedId,onMeasure:Pe,onAdd:Ce,onSelect:v.select}):null})]})}export{on as UserBrowserPanel};
@@ -1,2 +1,2 @@
1
- import{t,l,ne,Ae}from"./index-n5194pe6.js";import{$e}from"./index-cwwg7k5f.js";var n={parse:t(async(r)=>{let e=await $e("info",r);l.debug(e)},"parse")},i={version:"12.0.0"},s=t(()=>i.version,"getVersion"),p={getVersion:s},g=t((r,e,o)=>{l.debug(`rendering info diagram
1
+ import{t,l,ne,Ae}from"./index-pqmvhqmj.js";import{$e}from"./index-cwwg7k5f.js";var n={parse:t(async(r)=>{let e=await $e("info",r);l.debug(e)},"parse")},i={version:"12.0.0"},s=t(()=>i.version,"getVersion"),p={getVersion:s},g=t((r,e,o)=>{l.debug(`rendering info diagram
2
2
  `+r);let a=Ae(e);ne(a,100,400,!0),a.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),m={draw:g},y={parser:n,db:p,renderer:m};export{y as diagram};
@@ -1,4 +1,4 @@
1
- import{t,w,ne,M,O,G,z,j,q,H,m,Ae,jn,y}from"./index-n5194pe6.js";var ct=function(){var e=t(function(C,i,n,s){for(n=n||{},s=C.length;s--;n[C[s]]=i);return n},"o"),d=[1,4],r=[1,14],l=[1,12],o=[1,13],f=[6,7,8],g=[1,20],u=[1,18],x=[1,19],c=[6,7,11],_=[1,6,13,14],b=[1,23],S=[1,24],E=[1,6,7,11,13,14],W={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:t(function(i,n,s,h,p,a,A){var v=a.length-1;switch(p){case 6:case 7:return h;case 15:h.addNode(a[v-1].length,a[v].trim());break;case 16:h.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:r,7:[1,10],9:9,12:11,13:l,14:o},e(f,[2,3]),{1:[2,2]},e(f,[2,4]),e(f,[2,5]),{1:[2,6],6:r,12:15,13:l,14:o},{6:r,9:16,12:11,13:l,14:o},{6:g,7:u,10:17,11:x},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:g,7:u,10:22,11:x},{1:[2,7],6:r,12:15,13:l,14:o},e(_,[2,14],{7:b,11:S}),e(E,[2,8]),e(E,[2,9]),e(E,[2,10]),e(c,[2,15]),e(_,[2,13],{7:b,11:S}),e(E,[2,11]),e(E,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:t(function(i){var n=this,s=[0],h=[],p=[null],a=[],A=this.table,v="",B=0,I=0,P=0,N=2,U=1,nt=a.slice.call(arguments,1),k=Object.create(this.lexer),L={yy:{}};for(var X in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,X))L.yy[X]=this.yy[X];if(k.setInput(i,L.yy),L.yy.lexer=k,L.yy.parser=this,typeof k.yylloc>"u")k.yylloc={};var Y=k.yylloc;a.push(Y);var at=k.options&&k.options.ranges;if(typeof L.yy.parseError==="function")this.parseError=L.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function bt(R){s.length=s.length-2*R,p.length=p.length-R,a.length=a.length-R}t(bt,"popStack");function ut(){var R=h.pop()||k.lex()||U;if(typeof R!=="number"){if(R instanceof Array)h=R,R=h.pop();R=n.symbols_[R]||R}return R}t(ut,"lex");var D,rt,K,V,Ot,lt,Q={},et,Z,dt,it;while(!0){if(K=s[s.length-1],this.defaultActions[K])V=this.defaultActions[K];else{if(D===null||typeof D>"u")D=ut();V=A[K]&&A[K][D]}if(typeof V>"u"||!V.length||!V[0]){var ot="";it=[];for(et in A[K])if(this.terminals_[et]&&et>N)it.push("'"+this.terminals_[et]+"'");if(k.showPosition)ot="Parse error on line "+(B+1)+`:
1
+ import{t,w,ne,M,O,G,z,j,q,H,m,Ae,jn,y}from"./index-pqmvhqmj.js";var ct=function(){var e=t(function(C,i,n,s){for(n=n||{},s=C.length;s--;n[C[s]]=i);return n},"o"),d=[1,4],r=[1,14],l=[1,12],o=[1,13],f=[6,7,8],g=[1,20],u=[1,18],x=[1,19],c=[6,7,11],_=[1,6,13,14],b=[1,23],S=[1,24],E=[1,6,7,11,13,14],W={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:t(function(i,n,s,h,p,a,A){var v=a.length-1;switch(p){case 6:case 7:return h;case 15:h.addNode(a[v-1].length,a[v].trim());break;case 16:h.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:r,7:[1,10],9:9,12:11,13:l,14:o},e(f,[2,3]),{1:[2,2]},e(f,[2,4]),e(f,[2,5]),{1:[2,6],6:r,12:15,13:l,14:o},{6:r,9:16,12:11,13:l,14:o},{6:g,7:u,10:17,11:x},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:g,7:u,10:22,11:x},{1:[2,7],6:r,12:15,13:l,14:o},e(_,[2,14],{7:b,11:S}),e(E,[2,8]),e(E,[2,9]),e(E,[2,10]),e(c,[2,15]),e(_,[2,13],{7:b,11:S}),e(E,[2,11]),e(E,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:t(function(i){var n=this,s=[0],h=[],p=[null],a=[],A=this.table,v="",B=0,I=0,P=0,N=2,U=1,nt=a.slice.call(arguments,1),k=Object.create(this.lexer),L={yy:{}};for(var X in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,X))L.yy[X]=this.yy[X];if(k.setInput(i,L.yy),L.yy.lexer=k,L.yy.parser=this,typeof k.yylloc>"u")k.yylloc={};var Y=k.yylloc;a.push(Y);var at=k.options&&k.options.ranges;if(typeof L.yy.parseError==="function")this.parseError=L.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function bt(R){s.length=s.length-2*R,p.length=p.length-R,a.length=a.length-R}t(bt,"popStack");function ut(){var R=h.pop()||k.lex()||U;if(typeof R!=="number"){if(R instanceof Array)h=R,R=h.pop();R=n.symbols_[R]||R}return R}t(ut,"lex");var D,rt,K,V,Ot,lt,Q={},et,Z,dt,it;while(!0){if(K=s[s.length-1],this.defaultActions[K])V=this.defaultActions[K];else{if(D===null||typeof D>"u")D=ut();V=A[K]&&A[K][D]}if(typeof V>"u"||!V.length||!V[0]){var ot="";it=[];for(et in A[K])if(this.terminals_[et]&&et>N)it.push("'"+this.terminals_[et]+"'");if(k.showPosition)ot="Parse error on line "+(B+1)+`:
2
2
  `+k.showPosition()+`
3
3
  Expecting `+it.join(", ")+", got '"+(this.terminals_[D]||D)+"'";else ot="Parse error on line "+(B+1)+": Unexpected "+(D==U?"end of input":"'"+(this.terminals_[D]||D)+"'");this.parseError(ot,{text:k.match,token:this.terminals_[D]||D,line:k.yylineno,loc:Y,expected:it})}if(V[0]instanceof Array&&V.length>1)throw Error("Parse Error: multiple actions possible at state: "+K+", token: "+D);switch(V[0]){case 1:if(s.push(D),p.push(k.yytext),a.push(k.yylloc),s.push(V[1]),D=null,!rt){if(I=k.yyleng,v=k.yytext,B=k.yylineno,Y=k.yylloc,P>0)P--}else D=rt,rt=null;break;case 2:if(Z=this.productions_[V[1]][1],Q.$=p[p.length-Z],Q._$={first_line:a[a.length-(Z||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(Z||1)].first_column,last_column:a[a.length-1].last_column},at)Q._$.range=[a[a.length-(Z||1)].range[0],a[a.length-1].range[1]];if(lt=this.performAction.apply(Q,[v,I,B,L.yy,V[1],p,a].concat(nt)),typeof lt<"u")return lt;if(Z)s=s.slice(0,-1*Z*2),p=p.slice(0,-1*Z),a=a.slice(0,-1*Z);s.push(this.productions_[V[1]][0]),p.push(Q.$),a.push(Q._$),dt=A[s[s.length-2]][s[s.length-1]],s.push(dt);break;case 3:return!0}}return!0},"parse")},F=function(){var C={EOF:1,parseError:t(function(n,s){if(this.yy.parser)this.yy.parser.parseError(n,s);else throw Error(n)},"parseError"),setInput:t(function(i,n){if(this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);if(n)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:t(function(i){var n=i.length,s=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var h=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1)this.yylineno-=s.length-1;var p=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===h.length?this.yylloc.first_column:0)+h[h.length-s.length].length-s[0].length:this.yylloc.first_column-n},this.options.ranges)this.yylloc.range=[p[0],p[0]+this.yyleng-n];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(i){this.unput(this.match.slice(i))},"less"),pastInput:t(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var i=this.pastInput(),n=Array(i.length+1).join("-");return i+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{t,ne,M,O,G,z,j,q,H,m,b,ea,Hn}from"./index-n5194pe6.js";import{ii,ld,YA,gr}from"./index-40fdtqvw.js";var it=function(){var e=t(function(h,n,s,l){for(s=s||{},l=h.length;l--;s[h[l]]=n);return s},"o"),r=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:t(function(n,s,l,y,d,c,w){var _=c.length-1;switch(d){case 1:return c[_-1];case 2:this.$=[];break;case 3:c[_-1].push(c[_]),this.$=c[_-1];break;case 4:case 5:this.$=c[_];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[_].substr(6)),this.$=c[_].substr(6);break;case 9:this.$=c[_].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[_].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[_].substr(8)),this.$=c[_].substr(8);break;case 13:y.addTask(c[_-1],c[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},e(r,[2,7],{1:[2,1]}),e(r,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},e(r,[2,5]),e(r,[2,6]),e(r,[2,8]),{13:[1,16]},{15:[1,17]},e(r,[2,11]),e(r,[2,12]),{19:[1,18]},e(r,[2,4]),e(r,[2,9]),e(r,[2,10]),e(r,[2,13])],defaultActions:{},parseError:t(function(n,s){if(s.recoverable)this.trace(n);else{var l=Error(n);throw l.hash=s,l}},"parseError"),parse:t(function(n){var s=this,l=[0],y=[],d=[null],c=[],w=this.table,_="",F=0,lt=0,ot=0,bt=2,ct=1,_t=c.slice.call(arguments,1),v=Object.create(this.lexer),R={yy:{}};for(var K in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,K))R.yy[K]=this.yy[K];if(v.setInput(n,R.yy),R.yy.lexer=v,R.yy.parser=this,typeof v.yylloc>"u")v.yylloc={};var Q=v.yylloc;c.push(Q);var vt=v.options&&v.options.ranges;if(typeof R.yy.parseError==="function")this.parseError=R.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function wt(E){l.length=l.length-2*E,d.length=d.length-E,c.length=c.length-E}t(wt,"popStack");function ht(){var E=y.pop()||v.lex()||ct;if(typeof E!=="number"){if(E instanceof Array)y=E,E=y.pop();E=s.symbols_[E]||E}return E}t(ht,"lex");var T,D,L,S,qt,tt,B={},U,I,ut,Z;while(!0){if(L=l[l.length-1],this.defaultActions[L])S=this.defaultActions[L];else{if(T===null||typeof T>"u")T=ht();S=w[L]&&w[L][T]}if(typeof S>"u"||!S.length||!S[0]){var et="";Z=[];for(U in w[L])if(this.terminals_[U]&&U>bt)Z.push("'"+this.terminals_[U]+"'");if(v.showPosition)et="Parse error on line "+(F+1)+`:
1
+ import{t,ne,M,O,G,z,j,q,H,m,b,ea,Hn}from"./index-pqmvhqmj.js";import{ii,ld,YA,gr}from"./index-0xh8402w.js";var it=function(){var e=t(function(h,n,s,l){for(s=s||{},l=h.length;l--;s[h[l]]=n);return s},"o"),r=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:t(function(n,s,l,y,d,c,w){var _=c.length-1;switch(d){case 1:return c[_-1];case 2:this.$=[];break;case 3:c[_-1].push(c[_]),this.$=c[_-1];break;case 4:case 5:this.$=c[_];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[_].substr(6)),this.$=c[_].substr(6);break;case 9:this.$=c[_].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[_].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[_].substr(8)),this.$=c[_].substr(8);break;case 13:y.addTask(c[_-1],c[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},e(r,[2,7],{1:[2,1]}),e(r,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},e(r,[2,5]),e(r,[2,6]),e(r,[2,8]),{13:[1,16]},{15:[1,17]},e(r,[2,11]),e(r,[2,12]),{19:[1,18]},e(r,[2,4]),e(r,[2,9]),e(r,[2,10]),e(r,[2,13])],defaultActions:{},parseError:t(function(n,s){if(s.recoverable)this.trace(n);else{var l=Error(n);throw l.hash=s,l}},"parseError"),parse:t(function(n){var s=this,l=[0],y=[],d=[null],c=[],w=this.table,_="",F=0,lt=0,ot=0,bt=2,ct=1,_t=c.slice.call(arguments,1),v=Object.create(this.lexer),R={yy:{}};for(var K in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,K))R.yy[K]=this.yy[K];if(v.setInput(n,R.yy),R.yy.lexer=v,R.yy.parser=this,typeof v.yylloc>"u")v.yylloc={};var Q=v.yylloc;c.push(Q);var vt=v.options&&v.options.ranges;if(typeof R.yy.parseError==="function")this.parseError=R.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function wt(E){l.length=l.length-2*E,d.length=d.length-E,c.length=c.length-E}t(wt,"popStack");function ht(){var E=y.pop()||v.lex()||ct;if(typeof E!=="number"){if(E instanceof Array)y=E,E=y.pop();E=s.symbols_[E]||E}return E}t(ht,"lex");var T,D,L,S,qt,tt,B={},U,I,ut,Z;while(!0){if(L=l[l.length-1],this.defaultActions[L])S=this.defaultActions[L];else{if(T===null||typeof T>"u")T=ht();S=w[L]&&w[L][T]}if(typeof S>"u"||!S.length||!S[0]){var et="";Z=[];for(U in w[L])if(this.terminals_[U]&&U>bt)Z.push("'"+this.terminals_[U]+"'");if(v.showPosition)et="Parse error on line "+(F+1)+`:
2
2
  `+v.showPosition()+`
3
3
  Expecting `+Z.join(", ")+", got '"+(this.terminals_[T]||T)+"'";else et="Parse error on line "+(F+1)+": Unexpected "+(T==ct?"end of input":"'"+(this.terminals_[T]||T)+"'");this.parseError(et,{text:v.match,token:this.terminals_[T]||T,line:v.yylineno,loc:Q,expected:Z})}if(S[0]instanceof Array&&S.length>1)throw Error("Parse Error: multiple actions possible at state: "+L+", token: "+T);switch(S[0]){case 1:if(l.push(T),d.push(v.yytext),c.push(v.yylloc),l.push(S[1]),T=null,!D){if(lt=v.yyleng,_=v.yytext,F=v.yylineno,Q=v.yylloc,ot>0)ot--}else T=D,D=null;break;case 2:if(I=this.productions_[S[1]][1],B.$=d[d.length-I],B._$={first_line:c[c.length-(I||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(I||1)].first_column,last_column:c[c.length-1].last_column},vt)B._$.range=[c[c.length-(I||1)].range[0],c[c.length-1].range[1]];if(tt=this.performAction.apply(B,[_,lt,F,R.yy,S[1],d,c].concat(_t)),typeof tt<"u")return tt;if(I)l=l.slice(0,-1*I*2),d=d.slice(0,-1*I),c=c.slice(0,-1*I);l.push(this.productions_[S[1]][0]),d.push(B.$),c.push(B._$),ut=w[l[l.length-2]][l[l.length-1]],l.push(ut);break;case 3:return!0}}return!0},"parse")},x=function(){var h={EOF:1,parseError:t(function(s,l){if(this.yy.parser)this.yy.parser.parseError(s,l);else throw Error(s)},"parseError"),setInput:t(function(n,s){if(this.yy=s||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var s=n.match(/(?:\r\n?|\n).*/g);if(s)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),n},"input"),unput:t(function(n){var s=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var y=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1)this.yylineno-=l.length-1;var d=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-s},this.options.ranges)this.yylloc.range=[d[0],d[0]+this.yyleng-s];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(n){this.unput(this.match.slice(n))},"less"),pastInput:t(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var n=this.match;if(n.length<20)n+=this._input.substr(0,20-n.length);return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var n=this.pastInput(),s=Array(n.length+1).join("-");return n+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{t,l,De,g,A,Y,te,Xr,m,Ae,Ar,hr,wa,na,So,Hn}from"./index-n5194pe6.js";var re=function(){var e=t(function(w,r,i,a){for(i=i||{},a=w.length;a--;i[w[a]]=r);return i},"o"),d=[1,4],b=[1,13],s=[1,12],f=[1,15],S=[1,16],_=[1,20],h=[1,19],I=[6,7,8],T=[1,26],p=[1,24],P=[1,25],N=[6,7,11],W=[1,31],v=[6,7,11,24],M=[1,6,13,16,17,20,23],y=[1,35],V=[1,36],C=[1,6,7,11,13,16,17,20,23],z=[1,38],B={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(r,i,a,o,u,n,j){var c=n.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",n[c-1].id),o.addNode(n[c-2].length,n[c-1].id,n[c-1].descr,n[c-1].type,n[c]);break;case 16:o.getLogger().info("Node: ",n[c].id),o.addNode(n[c-1].length,n[c].id,n[c].descr,n[c].type);break;case 17:o.getLogger().trace("Icon: ",n[c]),o.decorateNode({icon:n[c]});break;case 18:case 23:o.decorateNode({class:n[c]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",n[c-1].id),o.addNode(0,n[c-1].id,n[c-1].descr,n[c-1].type,n[c]);break;case 21:o.getLogger().trace("Node: ",n[c].id),o.addNode(0,n[c].id,n[c].descr,n[c].type);break;case 22:o.decorateNode({icon:n[c]});break;case 27:o.getLogger().trace("node found ..",n[c-2]),this.$={id:n[c-1],descr:n[c-1],type:o.getType(n[c-2],n[c])};break;case 28:this.$={id:n[c],descr:n[c],type:0};break;case 29:o.getLogger().trace("node found ..",n[c-3]),this.$={id:n[c-3],descr:n[c-1],type:o.getType(n[c-2],n[c])};break;case 30:this.$=n[c-1]+n[c];break;case 31:this.$=n[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:b,7:[1,10],9:9,12:11,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},e(I,[2,3]),{1:[2,2]},e(I,[2,4]),e(I,[2,5]),{1:[2,6],6:b,12:21,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},{6:b,9:22,12:11,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},{6:T,7:p,10:23,11:P},e(N,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:_,23:h}),e(N,[2,19]),e(N,[2,21],{15:30,24:W}),e(N,[2,22]),e(N,[2,23]),e(v,[2,25]),e(v,[2,26]),e(v,[2,28],{20:[1,32]}),{21:[1,33]},{6:T,7:p,10:34,11:P},{1:[2,7],6:b,12:21,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},e(M,[2,14],{7:y,11:V}),e(C,[2,8]),e(C,[2,9]),e(C,[2,10]),e(N,[2,16],{15:37,24:W}),e(N,[2,17]),e(N,[2,18]),e(N,[2,20],{24:z}),e(v,[2,31]),{21:[1,39]},{22:[1,40]},e(M,[2,13],{7:y,11:V}),e(C,[2,11]),e(C,[2,12]),e(N,[2,15],{24:z}),e(v,[2,30]),{22:[1,41]},e(v,[2,27]),e(v,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(r,i){if(i.recoverable)this.trace(r);else{var a=Error(r);throw a.hash=i,a}},"parseError"),parse:t(function(r){var i=this,a=[0],o=[],u=[null],n=[],j=this.table,c="",X=0,ce=0,le=0,pe=2,he=1,fe=n.slice.call(arguments,1),E=Object.create(this.lexer),F={yy:{}};for(var Q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Q))F.yy[Q]=this.yy[Q];if(E.setInput(r,F.yy),F.yy.lexer=E,F.yy.parser=this,typeof E.yylloc>"u")E.yylloc={};var Z=E.yylloc;n.push(Z);var be=E.options&&E.options.ranges;if(typeof F.yy.parseError==="function")this.parseError=F.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ye(L){a.length=a.length-2*L,u.length=u.length-L,n.length=n.length-L}t(ye,"popStack");function ue(){var L=o.pop()||E.lex()||he;if(typeof L!=="number"){if(L instanceof Array)o=L,L=o.pop();L=i.symbols_[L]||L}return L}t(ue,"lex");var x,ee,G,D,je,ne,H={},K,R,ge,J;while(!0){if(G=a[a.length-1],this.defaultActions[G])D=this.defaultActions[G];else{if(x===null||typeof x>"u")x=ue();D=j[G]&&j[G][x]}if(typeof D>"u"||!D.length||!D[0]){var ie="";J=[];for(K in j[G])if(this.terminals_[K]&&K>pe)J.push("'"+this.terminals_[K]+"'");if(E.showPosition)ie="Parse error on line "+(X+1)+`:
1
+ import{t,l,De,g,A,Y,te,Xr,m,Ae,Ar,hr,wa,na,So,Hn}from"./index-pqmvhqmj.js";var re=function(){var e=t(function(w,r,i,a){for(i=i||{},a=w.length;a--;i[w[a]]=r);return i},"o"),d=[1,4],b=[1,13],s=[1,12],f=[1,15],S=[1,16],_=[1,20],h=[1,19],I=[6,7,8],T=[1,26],p=[1,24],P=[1,25],N=[6,7,11],W=[1,31],v=[6,7,11,24],M=[1,6,13,16,17,20,23],y=[1,35],V=[1,36],C=[1,6,7,11,13,16,17,20,23],z=[1,38],B={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(r,i,a,o,u,n,j){var c=n.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",n[c-1].id),o.addNode(n[c-2].length,n[c-1].id,n[c-1].descr,n[c-1].type,n[c]);break;case 16:o.getLogger().info("Node: ",n[c].id),o.addNode(n[c-1].length,n[c].id,n[c].descr,n[c].type);break;case 17:o.getLogger().trace("Icon: ",n[c]),o.decorateNode({icon:n[c]});break;case 18:case 23:o.decorateNode({class:n[c]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",n[c-1].id),o.addNode(0,n[c-1].id,n[c-1].descr,n[c-1].type,n[c]);break;case 21:o.getLogger().trace("Node: ",n[c].id),o.addNode(0,n[c].id,n[c].descr,n[c].type);break;case 22:o.decorateNode({icon:n[c]});break;case 27:o.getLogger().trace("node found ..",n[c-2]),this.$={id:n[c-1],descr:n[c-1],type:o.getType(n[c-2],n[c])};break;case 28:this.$={id:n[c],descr:n[c],type:0};break;case 29:o.getLogger().trace("node found ..",n[c-3]),this.$={id:n[c-3],descr:n[c-1],type:o.getType(n[c-2],n[c])};break;case 30:this.$=n[c-1]+n[c];break;case 31:this.$=n[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:b,7:[1,10],9:9,12:11,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},e(I,[2,3]),{1:[2,2]},e(I,[2,4]),e(I,[2,5]),{1:[2,6],6:b,12:21,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},{6:b,9:22,12:11,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},{6:T,7:p,10:23,11:P},e(N,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:_,23:h}),e(N,[2,19]),e(N,[2,21],{15:30,24:W}),e(N,[2,22]),e(N,[2,23]),e(v,[2,25]),e(v,[2,26]),e(v,[2,28],{20:[1,32]}),{21:[1,33]},{6:T,7:p,10:34,11:P},{1:[2,7],6:b,12:21,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},e(M,[2,14],{7:y,11:V}),e(C,[2,8]),e(C,[2,9]),e(C,[2,10]),e(N,[2,16],{15:37,24:W}),e(N,[2,17]),e(N,[2,18]),e(N,[2,20],{24:z}),e(v,[2,31]),{21:[1,39]},{22:[1,40]},e(M,[2,13],{7:y,11:V}),e(C,[2,11]),e(C,[2,12]),e(N,[2,15],{24:z}),e(v,[2,30]),{22:[1,41]},e(v,[2,27]),e(v,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(r,i){if(i.recoverable)this.trace(r);else{var a=Error(r);throw a.hash=i,a}},"parseError"),parse:t(function(r){var i=this,a=[0],o=[],u=[null],n=[],j=this.table,c="",X=0,ce=0,le=0,pe=2,he=1,fe=n.slice.call(arguments,1),E=Object.create(this.lexer),F={yy:{}};for(var Q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Q))F.yy[Q]=this.yy[Q];if(E.setInput(r,F.yy),F.yy.lexer=E,F.yy.parser=this,typeof E.yylloc>"u")E.yylloc={};var Z=E.yylloc;n.push(Z);var be=E.options&&E.options.ranges;if(typeof F.yy.parseError==="function")this.parseError=F.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ye(L){a.length=a.length-2*L,u.length=u.length-L,n.length=n.length-L}t(ye,"popStack");function ue(){var L=o.pop()||E.lex()||he;if(typeof L!=="number"){if(L instanceof Array)o=L,L=o.pop();L=i.symbols_[L]||L}return L}t(ue,"lex");var x,ee,G,D,je,ne,H={},K,R,ge,J;while(!0){if(G=a[a.length-1],this.defaultActions[G])D=this.defaultActions[G];else{if(x===null||typeof x>"u")x=ue();D=j[G]&&j[G][x]}if(typeof D>"u"||!D.length||!D[0]){var ie="";J=[];for(K in j[G])if(this.terminals_[K]&&K>pe)J.push("'"+this.terminals_[K]+"'");if(E.showPosition)ie="Parse error on line "+(X+1)+`:
2
2
  `+E.showPosition()+`
3
3
  Expecting `+J.join(", ")+", got '"+(this.terminals_[x]||x)+"'";else ie="Parse error on line "+(X+1)+": Unexpected "+(x==he?"end of input":"'"+(this.terminals_[x]||x)+"'");this.parseError(ie,{text:E.match,token:this.terminals_[x]||x,line:E.yylineno,loc:Z,expected:J})}if(D[0]instanceof Array&&D.length>1)throw Error("Parse Error: multiple actions possible at state: "+G+", token: "+x);switch(D[0]){case 1:if(a.push(x),u.push(E.yytext),n.push(E.yylloc),a.push(D[1]),x=null,!ee){if(ce=E.yyleng,c=E.yytext,X=E.yylineno,Z=E.yylloc,le>0)le--}else x=ee,ee=null;break;case 2:if(R=this.productions_[D[1]][1],H.$=u[u.length-R],H._$={first_line:n[n.length-(R||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(R||1)].first_column,last_column:n[n.length-1].last_column},be)H._$.range=[n[n.length-(R||1)].range[0],n[n.length-1].range[1]];if(ne=this.performAction.apply(H,[c,ce,X,F.yy,D[1],u,n].concat(fe)),typeof ne<"u")return ne;if(R)a=a.slice(0,-1*R*2),u=u.slice(0,-1*R),n=n.slice(0,-1*R);a.push(this.productions_[D[1]][0]),u.push(H.$),n.push(H._$),ge=j[a[a.length-2]][a[a.length-1]],a.push(ge);break;case 3:return!0}}return!0},"parse")},q=function(){var w={EOF:1,parseError:t(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw Error(i)},"parseError"),setInput:t(function(r,i){if(this.yy=i||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var i=r.match(/(?:\r\n?|\n).*/g);if(i)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),r},"input"),unput:t(function(r){var i=r.length,a=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var o=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1)this.yylineno-=a.length-1;var u=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-i},this.options.ranges)this.yylloc.range=[u[0],u[0]+this.yyleng-i];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),i=Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,5 +1,5 @@
1
- import{t,l,cd,Sg,Tg,Vi,cc,Wp,JA,ot,Bo,Y,Dg,si,Zr,Kp,ZA,XA,eh,Ng,Qg,C,th,ud,Jt,ne,Vp,rh,dd,Jp,b,Ae,Ar,hr,Xi,ui,kc,fd,hm,oh,ym,ce,V,ih,eo,vm,Gg}from"./index-n5194pe6.js";import{Ht}from"./index-jvn2xfpt.js";function wr(r){let e=r?.constructor;return r===(typeof e==="function"?e.prototype:Object.prototype)}function ur(r){if(r==null)return!0;if(hm(r)){if(typeof r.splice!=="function"&&typeof r!=="string"&&!kc(r)&&!ui(r)&&!fd(r))return!1;return r.length===0}if(typeof r==="object"||typeof r==="function"){if(r instanceof Map||r instanceof Set)return r.size===0;let e=Object.keys(r);if(wr(r))return e.filter((a)=>a!=="constructor").length===0;return e.length===0}return!0}var G="comm",Z="rule",J="decl";var xr="@media",br="@import";var Sr="@supports";var Er="@namespace",X="@keyframes";var rr="@layer",Dr="@scope";var Tr=Math.abs,P=String.fromCharCode;function er(r){return r.trim()}function K(r,e,a){return r.replace(e,a)}function I(r,e){return r.charCodeAt(e)|0}function O(r,e,a){return r.slice(e,a)}function E(r){return r.length}function tr(r){return r.length}function H(r,e){return e.push(r),r}var ar=1,B=1,_r=0,L=0,h=0,q="";function ir(r,e,a,i,o,n,d,s){return{value:r,root:e,parent:a,type:i,props:o,children:n,line:ar,column:B,length:d,return:"",siblings:s}}function Cr(){return h}function Lr(){if(h=L>0?I(q,--L):0,B--,h===10)B=1,ar--;return h}function M(){if(h=L<_r?I(q,L++):0,B++,h===10)B=1,ar++;return h}function F(){return I(q,L)}function Q(){return L}function or(r,e){return O(q,r,e)}function j(r){switch(r){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Mr(r){return ar=B=1,_r=E(q=r),L=0,[]}function kr(r){return q="",r}function nr(r){return er(or(L-1,pr(r===91?r+2:r===40?r+1:r)))}function Rr(r){while(h=F())if(h<33)M();else break;return j(r)>2||j(h)>3?"":" "}function Ir(r,e){while(--e&&M())if(h<48||h>102||h>57&&h<65||h>70&&h<97)break;return or(r,Q()+(e<6&&F()==32&&M()==32))}function pr(r){while(M())switch(h){case r:return L;case 34:case 39:if(r!==34&&r!==39)pr(h);break;case 40:if(r===41)pr(r);break;case 92:M();break}return L}function Or(r,e){while(M())if(r+h===57)break;else if(r+h===84&&F()===47)break;return"/*"+or(e,L-1)+"*"+P(r===47?r:M())}function Fr(r){while(!j(F()))M();return or(r,L)}function Pr(r){return kr(sr("",null,null,null,[""],r=Mr(r),0,[0],r))}function sr(r,e,a,i,o,n,d,s,c){var f=0,g=0,p=d,u=0,w=0,D=0,S=1,x=1,T=1,A=0,v=0,k="",U=o,R=n,_=i,m=k;while(x)switch(D=v,v=M()){case 40:if(D!=108&&I(m,p-1)==58)A++,m+="(";else m+=nr(v);break;case 41:A--,m+=")";break;case 34:case 39:case 91:m+=nr(v);break;case 9:case 10:case 13:case 32:if(A>0){m+=P(v);break}m+=Rr(D);break;case 92:m+=Ir(Q()-1,7);continue;case 47:switch(F()){case 42:case 47:if(H(Ke(Or(M(),Q()),e,a,c),c),(j(D||1)==5||j(F()||1)==5)&&E(m)&&O(m,-1,void 0)!==" ")m+=" ";break;default:m+="/"}break;case 123*S:s[f++]=E(m)*T;case 125*S:case 59:case 0:if(A>0&&v){m+=P(v);break}switch(v){case 0:case 125:x=0;case 59+g:if(T==-1)m=K(m,/\f/g,"");if(w>0&&(E(m)-p||S===0))H(w>32?$r(m+";",i,a,p-1,c):$r(K(m," ","")+";",i,a,p-2,c),c);break;case 59:m+=";";default:if(H(_=zr(m,e,a,f,g,o,s,k,U=[],R=[],p,n),n),v===123)if(g===0)sr(m,e,_,_,U,n,p,s,R);else{switch(u){case 99:if(I(m,3)===110)break;case 108:if(I(m,2)===97)break;default:g=0;case 100:case 109:case 115:}if(g)sr(r,_,_,i&&H(zr(r,_,_,0,0,o,s,k,o,U=[],p,R),R),o,R,p,s,i?U:R);else sr(m,_,_,_,[""],R,0,s,R)}}f=g=w=0,S=T=1,k=m="",p=d;break;case 58:p=1+E(m),w=D;default:if(S<1){if(v==123)--S;else if(v==125&&S++==0&&Lr()==125)continue}switch(m+=P(v),v*S){case 38:T=g>0?1:(m+="\f",-1);break;case 44:if(A>0)break;s[f++]=(E(m)-1)*T,T=1;break;case 64:if(F()===45)m+=nr(M());u=F(),g=p=E(k=m+=Fr(Q())),v++;break;case 45:if(D===45&&E(m)==2)S=0}}return n}function zr(r,e,a,i,o,n,d,s,c,f,g,p){var u=o-1,w=o===0?n:[""],D=tr(w);for(var S=0,x=0,T=0;S<i;++S)for(var A=0,v=O(r,u+1,u=Tr(x=d[S])),k=r;A<D;++A)if(k=er(x>0?w[A]+" "+v:K(v,/&\f/g,w[A])))c[T++]=k;return ir(r,e,a,o===0?Z:s,c,f,g,p)}function Ke(r,e,a,i){return ir(r,e,a,G,P(Cr()),O(r,2,-2),0,i)}function $r(r,e,a,i,o){return ir(r,e,a,J,O(r,0,i),O(r,i+1,-1),i,o)}function dr(r,e){var a="";for(var i=0;i<r.length;i++)a+=e(r[i],i,r,e)||"";return a}function Nr(r,e,a,i){switch(r.type){case rr:if(r.children.length)break;case br:case Er:case J:return r.return=r.return||r.value;case G:return"";case X:return r.return=r.value+"{"+dr(r.children,i)+"}";case Z:if(!E(r.value=r.props.join(",")))return""}return E(a=dr(r.children,i))?r.return=r.value+"{"+a+"}":""}function Vr(r){var e=tr(r);return function(a,i,o,n){var d="";for(var s=0;s<e;s++)d+=r[s](a,i,o,n)||"";return d}}var Yr="c4",Qe=t((r)=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(r),"detector"),Ze=t(async()=>{let{diagram:r}=await import("./c4Diagram-YGBWAQC7-qcd46ts2.js");return{id:Yr,diagram:r}},"loader"),Je={id:Yr,detector:Qe,loader:Ze},rt=Je,jr="flowchart-v2",et=t((r)=>/^\s*(graph|flowchart)/.test(r),"detector"),tt=t(async()=>{let{diagram:r}=await import("./flowDiagram-KWPJA3E3-dpjz82p8.js");return{id:jr,diagram:r}},"loader"),at={id:jr,detector:et,loader:tt},it=at,qr="agentflow",nt=t((r)=>/^\s*agentflow-beta\b/.test(r),"detector"),st=t(async()=>{let{diagram:r}=await import("./diagram-22UHCM2B-wy2y0323.js");return{id:qr,diagram:r}},"loader"),dt={id:qr,detector:nt,loader:st},ct=dt,Wr="swimlane",lt=t((r)=>/^\s*swimlane-beta\b/.test(r),"detector"),mt=t(async()=>{let{diagram:r}=await import("./swimlanesDiagram-TC7HE7FX-qnhxxmjr.js");return{id:Wr,diagram:r}},"loader"),ut={id:Wr,detector:lt,loader:mt},pt=ut,Xr="er",ft=t((r)=>/^\s*erDiagram/.test(r),"detector"),gt=t(async()=>{let{diagram:r}=await import("./erDiagram-OPXOYQCR-kx15t6f0.js");return{id:Xr,diagram:r}},"loader"),vt={id:Xr,detector:ft,loader:gt},ht=vt,Kr="gitGraph",yt=t((r)=>/^\s*gitGraph/.test(r),"detector"),wt=t(async()=>{let{diagram:r}=await import("./gitGraphDiagram-X574FWY7-a4mq8vwz.js");return{id:Kr,diagram:r}},"loader"),xt={id:Kr,detector:yt,loader:wt},bt=xt,Qr="gantt",St=t((r)=>/^\s*gantt/.test(r),"detector"),Et=t(async()=>{let{diagram:r}=await import("./ganttDiagram-FUAMR5RP-3hv8pej4.js");return{id:Qr,diagram:r}},"loader"),Dt={id:Qr,detector:St,loader:Et},Tt=Dt,Jr="info",At=t((r)=>/^\s*info/.test(r),"detector"),_t=t(async()=>{let{diagram:r}=await import("./infoDiagram-VRGFBTTK-wtnqb06v.js");return{id:Jr,diagram:r}},"loader"),Ct={id:Jr,detector:At,loader:_t},re="pie",Lt=t((r)=>/^\s*pie/.test(r),"detector"),Mt=t(async()=>{let{diagram:r}=await import("./pieDiagram-5QR66LMP-efech3mm.js");return{id:re,diagram:r}},"loader"),kt={id:re,detector:Lt,loader:Mt},ee="quadrantChart",Rt=t((r)=>/^\s*quadrantChart/.test(r),"detector"),It=t(async()=>{let{diagram:r}=await import("./quadrantDiagram-O4NWA36T-khf9cv3t.js");return{id:ee,diagram:r}},"loader"),Ot={id:ee,detector:Rt,loader:It},Ft=Ot,te="xychart",zt=t((r)=>/^\s*xychart(-beta)?/.test(r),"detector"),$t=t(async()=>{let{diagram:r}=await import("./xychartDiagram-PMCCYNJV-0a47th65.js");return{id:te,diagram:r}},"loader"),Pt={id:te,detector:zt,loader:$t},Nt=Pt,ae="requirement",Vt=t((r)=>/^\s*requirement(Diagram)?/.test(r),"detector"),Ut=t(async()=>{let{diagram:r}=await import("./requirementDiagram-PLB6GJNP-3s4smnme.js");return{id:ae,diagram:r}},"loader"),Gt={id:ae,detector:Vt,loader:Ut},Bt=Gt,ie="sequence",Yt=t((r)=>/^\s*sequenceDiagram/.test(r),"detector"),jt=t(async()=>{let{diagram:r}=await import("./sequenceDiagram-PO4LG4MO-rka8ct43.js");return{id:ie,diagram:r}},"loader"),qt={id:ie,detector:Yt,loader:jt},Wt=qt,oe="classDiagram",Xt=t((r)=>/^\s*classDiagram/.test(r),"detector"),Kt=t(async()=>{let{diagram:r}=await import("./classDiagram-v2-NBCMYWYE-scyhe133.js");return{id:oe,diagram:r}},"loader"),Qt={id:oe,detector:Xt,loader:Kt},Zt=Qt,se="stateDiagram",ra=t((r)=>/^\s*stateDiagram/.test(r),"detector"),ea=t(async()=>{let{diagram:r}=await import("./stateDiagram-v2-GCMORJYK-gy1zab2j.js");return{id:se,diagram:r}},"loader"),ta={id:se,detector:ra,loader:ea},aa=ta,de="journey",ia=t((r)=>/^\s*journey/.test(r),"detector"),oa=t(async()=>{let{diagram:r}=await import("./journeyDiagram-ZHPQQLJL-4e572kkp.js");return{id:de,diagram:r}},"loader"),na={id:de,detector:ia,loader:oa},sa=na,da=t((r,e,a)=>{l.debug(`rendering svg for syntax error
2
- `);let i=Ae(e),o=i.append("g");i.attr("viewBox","0 0 2412 512"),ne(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${a}`)},"draw"),le={draw:da},ca=le,la={db:{},renderer:le,parser:{parse:t(()=>{return},"parse")}},ma=la,me="flowchart-elk",ua=t((r,e={})=>{if(/^\s*flowchart-elk/.test(r))return e.layout="elk",!0;return!1},"detector"),pa=t(async()=>{let{diagram:r}=await import("./flowDiagram-KWPJA3E3-dpjz82p8.js");return{id:me,diagram:r}},"loader"),fa={id:me,detector:ua,loader:pa},ga=fa,ue="timeline",va=t((r)=>/^\s*timeline/.test(r),"detector"),ha=t(async()=>{let{diagram:r}=await import("./timeline-definition-EJHVYXUP-sg151mkc.js");return{id:ue,diagram:r}},"loader"),ya={id:ue,detector:va,loader:ha},wa=ya,pe="mindmap",xa=t((r)=>/^\s*mindmap/.test(r),"detector"),ba=t(async()=>{let{diagram:r}=await import("./mindmap-definition-NLK3R4M7-pphjnkvt.js");return{id:pe,diagram:r}},"loader"),Sa={id:pe,detector:xa,loader:ba},Ea=Sa,fe="kanban",Da=t((r)=>/^\s*kanban/.test(r),"detector"),Ta=t(async()=>{let{diagram:r}=await import("./kanban-definition-PNTS6WVX-yrtnn4zy.js");return{id:fe,diagram:r}},"loader"),Aa={id:fe,detector:Da,loader:Ta},_a=Aa,ge="sankey",Ca=t((r)=>/^\s*sankey(-beta)?/.test(r),"detector"),La=t(async()=>{let{diagram:r}=await import("./sankeyDiagram-IPEJSGJF-9pqd25mc.js");return{id:ge,diagram:r}},"loader"),Ma={id:ge,detector:Ca,loader:La},ka=Ma,ve="packet",Ra=t((r)=>/^\s*packet(-beta)?/.test(r),"detector"),Ia=t(async()=>{let{diagram:r}=await import("./diagram-MLGK6HIB-ryf8j6hf.js");return{id:ve,diagram:r}},"loader"),Oa={id:ve,detector:Ra,loader:Ia},he="radar",Fa=t((r)=>/^\s*radar-beta/.test(r),"detector"),za=t(async()=>{let{diagram:r}=await import("./diagram-MPIPVDR6-8k5e36sd.js");return{id:he,diagram:r}},"loader"),$a={id:he,detector:Fa,loader:za},ye="block",Pa=t((r)=>/^\s*block(-beta)?/.test(r),"detector"),Na=t(async()=>{let{diagram:r}=await import("./blockDiagram-BEXU5L5S-p19shaft.js");return{id:ye,diagram:r}},"loader"),Va={id:ye,detector:Pa,loader:Na},Ua=Va,we="treeView",Ga=t((r)=>/^\s*treeView-beta/.test(r),"detector"),Ha=t(async()=>{let{diagram:r}=await import("./diagram-CDSNMT55-cfhk73ty.js");return{id:we,diagram:r}},"loader"),Ba={id:we,detector:Ga,loader:Ha},Ya=Ba,xe="architecture",ja=t((r)=>/^\s*architecture/.test(r),"detector"),qa=t(async()=>{let{diagram:r}=await import("./architectureDiagram-NJMV4G6O-n1pr5s6j.js");return{id:xe,diagram:r}},"loader"),Wa={id:xe,detector:ja,loader:qa},Xa=Wa,be="eventmodeling",Ka=t((r)=>/^\s*eventmodeling/.test(r),"detector"),Qa=t(async()=>{let{diagram:r}=await import("./diagram-ATOU4E4O-2mmxccm2.js");return{id:be,diagram:r}},"loader"),Za={id:be,detector:Ka,loader:Qa},Ja=Za,Se="ishikawa",ri=t((r)=>/^\s*ishikawa(-beta)?\b/i.test(r),"detector"),ei=t(async()=>{let{diagram:r}=await import("./ishikawaDiagram-OU5B5YK6-eta0jnvr.js");return{id:Se,diagram:r}},"loader"),ti={id:Se,detector:ri,loader:ei},Ee="venn",ai=t((r)=>/^\s*venn-beta/.test(r),"detector"),ii=t(async()=>{let{diagram:r}=await import("./vennDiagram-UO4OBE2U-zbhr4eqf.js");return{id:Ee,diagram:r}},"loader"),oi={id:Ee,detector:ai,loader:ii},ni=oi,De="treemap",di=t((r)=>/^\s*treemap/.test(r),"detector"),ci=t(async()=>{let{diagram:r}=await import("./diagram-3UASUU5V-j904f93p.js");return{id:De,diagram:r}},"loader"),li={id:De,detector:di,loader:ci},Te="usecase",mi=t((r)=>/^\s*usecase-beta(?:\s|$)/.test(r),"detector"),pi=t(async()=>{let{diagram:r}=await import("./usecaseDiagram-POWQR4AR-f91g61p3.js");return{id:Te,diagram:r}},"loader"),fi={id:Te,detector:mi,loader:pi},_e="wardley",gi=t((r)=>/^\s*wardley-beta/i.test(r),"detector"),vi=t(async()=>{let{diagram:r}=await import("./wardleyDiagram-VNRHLVJA-6302414n.js");return{id:_e,diagram:r}},"loader"),hi={id:_e,detector:gi,loader:vi},yi=hi,Ce="cynefin",wi=t((r)=>/^\s*cynefin-beta(?:[\s:]|$)/.test(r),"detector"),xi=t(async()=>{let{diagram:r}=await import("./cynefinDiagram-VND7K2PF-1zfrnyay.js");return{id:Ce,diagram:r}},"loader"),bi={id:Ce,detector:wi,loader:xi},Le="railroad",Si=t((r)=>/^\s*railroad-beta/i.test(r),"detector"),Ei=t(async()=>{let{diagram:r}=await import("./railroadDiagram-XR7U4H2S-ye68kdx2.js");return{id:Le,diagram:r}},"loader"),Di={id:Le,detector:Si,loader:Ei},Me="railroadEbnf",Ti=t((r)=>/^\s*railroad-ebnf-beta/i.test(r),"detector"),Ai=t(async()=>{let{diagram:r}=await import("./ebnfDiagram-ZINNZB2B-5kkbbbhv.js");return{id:Me,diagram:r}},"loader"),_i={id:Me,detector:Ti,loader:Ai},ke="railroadAbnf",Ci=t((r)=>/^\s*railroad-abnf-beta/i.test(r),"detector"),Li=t(async()=>{let{diagram:r}=await import("./abnfDiagram-O67JEVCF-48z2x5vg.js");return{id:ke,diagram:r}},"loader"),Mi={id:ke,detector:Ci,loader:Li},Re="railroadPeg",ki=t((r)=>/^\s*railroad-peg-beta/i.test(r),"detector"),Ri=t(async()=>{let{diagram:r}=await import("./pegDiagram-GJSIUBJH-kgffb9p3.js");return{id:Re,diagram:r}},"loader"),Ii={id:Re,detector:ki,loader:Ri},Ur=!1,mr=t(()=>{if(Ur)return;Ur=!0,dd("error",ma,(r)=>r.toLowerCase().trim()==="error"),dd("---",{db:{clear:t(()=>{},"clear")},styles:{},renderer:{draw:t(()=>{},"draw")},parser:{parse:t(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:t(()=>null,"init")},(r)=>r.toLowerCase().trimStart().startsWith("---")),Wp(ga,Ea,Xa),Wp(ct,rt,_a,Zt,ht,Tt,Ct,kt,Bt,Wt,pt,it,wa,bt,aa,sa,Ft,ka,Oa,Nt,Ua,Ja,Ya,$a,ti,li,Di,_i,Mi,Ii,ni,yi,bi,fi)},"addDiagrams"),Oi=t(async()=>{l.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(Vi).map(async([a,{detector:i,loader:o}])=>{if(!o)return;try{Jp(a)}catch{try{let{diagram:n,id:d}=await o();dd(d,n,i)}catch(n){throw l.error(`Failed to load external diagram with key ${a}. Removing from detectors.`),delete Vi[a],n}}}))).filter((a)=>a.status==="rejected");if(e.length>0){l.error(`Failed to load ${e.length} external diagrams`);for(let a of e)l.error(a);throw Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),Fi="graphics-document document";function Ie(r,e){if(r.attr("role",Fi),e!=="")r.attr("aria-roledescription",e)}t(Ie,"setA11yDiagramInfo");function Oe(r,e,a,i){if(r.insert===void 0)return;if(a){let o=`chart-desc-${i}`;r.attr("aria-describedby",o),r.insert("desc",":first-child").attr("id",o).text(a)}if(e){let o=`chart-title-${i}`;r.attr("aria-labelledby",o),r.insert("title",":first-child").attr("id",o).text(e)}}t(Oe,"addSVGa11yTitleDescription");var cr=class r{constructor(e,a,i,o,n){this.type=e,this.text=a,this.db=i,this.parser=o,this.renderer=n}static{t(this,"Diagram")}static async fromText(e,a={}){let i=typeof e==="string"?{raw:e,cleaned:e}:e,o=C(),n=cc(i.cleaned,o);try{Jp(n)}catch{let u=JA(n);if(!u)throw new Tg(`Diagram ${n} not found.`);let{id:w,diagram:D}=await u();dd(w,D)}let{db:d,parser:s,renderer:c,init:f}=Jp(n);if(s.parser)s.parser.yy=d;if(d.clear?.(),f?.(o),a.title)d.setDiagramTitle?.(a.title);let g=i.cleaned;if(d.preserveCommentsWhenParsing&&i.withComments){let u=o.maxTextSize??Y.maxTextSize;if(i.withComments.length>u)l.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`);else g=i.withComments}let p=ih(g)+`
1
+ import{t,l,cd,Sg,Tg,Vi,cc,Wp,JA,ot,Bo,Y,Dg,si,Zr,Kp,ZA,XA,eh,Ng,Qg,C,th,ud,Jt,ne,Vp,rh,dd,Jp,b,Ae,Ar,hr,Xi,ui,kc,fd,hm,oh,ym,ce,V,ih,eo,vm,Gg}from"./index-pqmvhqmj.js";import{Ht}from"./index-7ckzdf4r.js";function wr(r){let e=r?.constructor;return r===(typeof e==="function"?e.prototype:Object.prototype)}function ur(r){if(r==null)return!0;if(hm(r)){if(typeof r.splice!=="function"&&typeof r!=="string"&&!kc(r)&&!ui(r)&&!fd(r))return!1;return r.length===0}if(typeof r==="object"||typeof r==="function"){if(r instanceof Map||r instanceof Set)return r.size===0;let e=Object.keys(r);if(wr(r))return e.filter((a)=>a!=="constructor").length===0;return e.length===0}return!0}var G="comm",Z="rule",J="decl";var xr="@media",br="@import";var Sr="@supports";var Er="@namespace",X="@keyframes";var rr="@layer",Dr="@scope";var Tr=Math.abs,P=String.fromCharCode;function er(r){return r.trim()}function K(r,e,a){return r.replace(e,a)}function I(r,e){return r.charCodeAt(e)|0}function O(r,e,a){return r.slice(e,a)}function E(r){return r.length}function tr(r){return r.length}function H(r,e){return e.push(r),r}var ar=1,B=1,_r=0,L=0,h=0,q="";function ir(r,e,a,i,o,n,d,s){return{value:r,root:e,parent:a,type:i,props:o,children:n,line:ar,column:B,length:d,return:"",siblings:s}}function Cr(){return h}function Lr(){if(h=L>0?I(q,--L):0,B--,h===10)B=1,ar--;return h}function M(){if(h=L<_r?I(q,L++):0,B++,h===10)B=1,ar++;return h}function F(){return I(q,L)}function Q(){return L}function or(r,e){return O(q,r,e)}function j(r){switch(r){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Mr(r){return ar=B=1,_r=E(q=r),L=0,[]}function kr(r){return q="",r}function nr(r){return er(or(L-1,pr(r===91?r+2:r===40?r+1:r)))}function Rr(r){while(h=F())if(h<33)M();else break;return j(r)>2||j(h)>3?"":" "}function Ir(r,e){while(--e&&M())if(h<48||h>102||h>57&&h<65||h>70&&h<97)break;return or(r,Q()+(e<6&&F()==32&&M()==32))}function pr(r){while(M())switch(h){case r:return L;case 34:case 39:if(r!==34&&r!==39)pr(h);break;case 40:if(r===41)pr(r);break;case 92:M();break}return L}function Or(r,e){while(M())if(r+h===57)break;else if(r+h===84&&F()===47)break;return"/*"+or(e,L-1)+"*"+P(r===47?r:M())}function Fr(r){while(!j(F()))M();return or(r,L)}function Pr(r){return kr(sr("",null,null,null,[""],r=Mr(r),0,[0],r))}function sr(r,e,a,i,o,n,d,s,c){var f=0,g=0,p=d,u=0,w=0,D=0,S=1,x=1,T=1,A=0,v=0,k="",U=o,R=n,_=i,m=k;while(x)switch(D=v,v=M()){case 40:if(D!=108&&I(m,p-1)==58)A++,m+="(";else m+=nr(v);break;case 41:A--,m+=")";break;case 34:case 39:case 91:m+=nr(v);break;case 9:case 10:case 13:case 32:if(A>0){m+=P(v);break}m+=Rr(D);break;case 92:m+=Ir(Q()-1,7);continue;case 47:switch(F()){case 42:case 47:if(H(Ke(Or(M(),Q()),e,a,c),c),(j(D||1)==5||j(F()||1)==5)&&E(m)&&O(m,-1,void 0)!==" ")m+=" ";break;default:m+="/"}break;case 123*S:s[f++]=E(m)*T;case 125*S:case 59:case 0:if(A>0&&v){m+=P(v);break}switch(v){case 0:case 125:x=0;case 59+g:if(T==-1)m=K(m,/\f/g,"");if(w>0&&(E(m)-p||S===0))H(w>32?$r(m+";",i,a,p-1,c):$r(K(m," ","")+";",i,a,p-2,c),c);break;case 59:m+=";";default:if(H(_=zr(m,e,a,f,g,o,s,k,U=[],R=[],p,n),n),v===123)if(g===0)sr(m,e,_,_,U,n,p,s,R);else{switch(u){case 99:if(I(m,3)===110)break;case 108:if(I(m,2)===97)break;default:g=0;case 100:case 109:case 115:}if(g)sr(r,_,_,i&&H(zr(r,_,_,0,0,o,s,k,o,U=[],p,R),R),o,R,p,s,i?U:R);else sr(m,_,_,_,[""],R,0,s,R)}}f=g=w=0,S=T=1,k=m="",p=d;break;case 58:p=1+E(m),w=D;default:if(S<1){if(v==123)--S;else if(v==125&&S++==0&&Lr()==125)continue}switch(m+=P(v),v*S){case 38:T=g>0?1:(m+="\f",-1);break;case 44:if(A>0)break;s[f++]=(E(m)-1)*T,T=1;break;case 64:if(F()===45)m+=nr(M());u=F(),g=p=E(k=m+=Fr(Q())),v++;break;case 45:if(D===45&&E(m)==2)S=0}}return n}function zr(r,e,a,i,o,n,d,s,c,f,g,p){var u=o-1,w=o===0?n:[""],D=tr(w);for(var S=0,x=0,T=0;S<i;++S)for(var A=0,v=O(r,u+1,u=Tr(x=d[S])),k=r;A<D;++A)if(k=er(x>0?w[A]+" "+v:K(v,/&\f/g,w[A])))c[T++]=k;return ir(r,e,a,o===0?Z:s,c,f,g,p)}function Ke(r,e,a,i){return ir(r,e,a,G,P(Cr()),O(r,2,-2),0,i)}function $r(r,e,a,i,o){return ir(r,e,a,J,O(r,0,i),O(r,i+1,-1),i,o)}function dr(r,e){var a="";for(var i=0;i<r.length;i++)a+=e(r[i],i,r,e)||"";return a}function Nr(r,e,a,i){switch(r.type){case rr:if(r.children.length)break;case br:case Er:case J:return r.return=r.return||r.value;case G:return"";case X:return r.return=r.value+"{"+dr(r.children,i)+"}";case Z:if(!E(r.value=r.props.join(",")))return""}return E(a=dr(r.children,i))?r.return=r.value+"{"+a+"}":""}function Vr(r){var e=tr(r);return function(a,i,o,n){var d="";for(var s=0;s<e;s++)d+=r[s](a,i,o,n)||"";return d}}var Yr="c4",Qe=t((r)=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(r),"detector"),Ze=t(async()=>{let{diagram:r}=await import("./c4Diagram-YGBWAQC7-517yhfzj.js");return{id:Yr,diagram:r}},"loader"),Je={id:Yr,detector:Qe,loader:Ze},rt=Je,jr="flowchart-v2",et=t((r)=>/^\s*(graph|flowchart)/.test(r),"detector"),tt=t(async()=>{let{diagram:r}=await import("./flowDiagram-KWPJA3E3-aegwx04w.js");return{id:jr,diagram:r}},"loader"),at={id:jr,detector:et,loader:tt},it=at,qr="agentflow",nt=t((r)=>/^\s*agentflow-beta\b/.test(r),"detector"),st=t(async()=>{let{diagram:r}=await import("./diagram-22UHCM2B-ngj4fyg3.js");return{id:qr,diagram:r}},"loader"),dt={id:qr,detector:nt,loader:st},ct=dt,Wr="swimlane",lt=t((r)=>/^\s*swimlane-beta\b/.test(r),"detector"),mt=t(async()=>{let{diagram:r}=await import("./swimlanesDiagram-TC7HE7FX-rseba3zs.js");return{id:Wr,diagram:r}},"loader"),ut={id:Wr,detector:lt,loader:mt},pt=ut,Xr="er",ft=t((r)=>/^\s*erDiagram/.test(r),"detector"),gt=t(async()=>{let{diagram:r}=await import("./erDiagram-OPXOYQCR-rxk86jsf.js");return{id:Xr,diagram:r}},"loader"),vt={id:Xr,detector:ft,loader:gt},ht=vt,Kr="gitGraph",yt=t((r)=>/^\s*gitGraph/.test(r),"detector"),wt=t(async()=>{let{diagram:r}=await import("./gitGraphDiagram-X574FWY7-7dyqcj8r.js");return{id:Kr,diagram:r}},"loader"),xt={id:Kr,detector:yt,loader:wt},bt=xt,Qr="gantt",St=t((r)=>/^\s*gantt/.test(r),"detector"),Et=t(async()=>{let{diagram:r}=await import("./ganttDiagram-FUAMR5RP-veweech7.js");return{id:Qr,diagram:r}},"loader"),Dt={id:Qr,detector:St,loader:Et},Tt=Dt,Jr="info",At=t((r)=>/^\s*info/.test(r),"detector"),_t=t(async()=>{let{diagram:r}=await import("./infoDiagram-VRGFBTTK-ksz9cvq3.js");return{id:Jr,diagram:r}},"loader"),Ct={id:Jr,detector:At,loader:_t},re="pie",Lt=t((r)=>/^\s*pie/.test(r),"detector"),Mt=t(async()=>{let{diagram:r}=await import("./pieDiagram-5QR66LMP-wqz5k5w6.js");return{id:re,diagram:r}},"loader"),kt={id:re,detector:Lt,loader:Mt},ee="quadrantChart",Rt=t((r)=>/^\s*quadrantChart/.test(r),"detector"),It=t(async()=>{let{diagram:r}=await import("./quadrantDiagram-O4NWA36T-rjszd8an.js");return{id:ee,diagram:r}},"loader"),Ot={id:ee,detector:Rt,loader:It},Ft=Ot,te="xychart",zt=t((r)=>/^\s*xychart(-beta)?/.test(r),"detector"),$t=t(async()=>{let{diagram:r}=await import("./xychartDiagram-PMCCYNJV-2nrdzp7p.js");return{id:te,diagram:r}},"loader"),Pt={id:te,detector:zt,loader:$t},Nt=Pt,ae="requirement",Vt=t((r)=>/^\s*requirement(Diagram)?/.test(r),"detector"),Ut=t(async()=>{let{diagram:r}=await import("./requirementDiagram-PLB6GJNP-b87kqbr7.js");return{id:ae,diagram:r}},"loader"),Gt={id:ae,detector:Vt,loader:Ut},Bt=Gt,ie="sequence",Yt=t((r)=>/^\s*sequenceDiagram/.test(r),"detector"),jt=t(async()=>{let{diagram:r}=await import("./sequenceDiagram-PO4LG4MO-e6fg0x45.js");return{id:ie,diagram:r}},"loader"),qt={id:ie,detector:Yt,loader:jt},Wt=qt,oe="classDiagram",Xt=t((r)=>/^\s*classDiagram/.test(r),"detector"),Kt=t(async()=>{let{diagram:r}=await import("./classDiagram-v2-NBCMYWYE-tcad3rst.js");return{id:oe,diagram:r}},"loader"),Qt={id:oe,detector:Xt,loader:Kt},Zt=Qt,se="stateDiagram",ra=t((r)=>/^\s*stateDiagram/.test(r),"detector"),ea=t(async()=>{let{diagram:r}=await import("./stateDiagram-v2-GCMORJYK-htwar22v.js");return{id:se,diagram:r}},"loader"),ta={id:se,detector:ra,loader:ea},aa=ta,de="journey",ia=t((r)=>/^\s*journey/.test(r),"detector"),oa=t(async()=>{let{diagram:r}=await import("./journeyDiagram-ZHPQQLJL-qs2e3hdf.js");return{id:de,diagram:r}},"loader"),na={id:de,detector:ia,loader:oa},sa=na,da=t((r,e,a)=>{l.debug(`rendering svg for syntax error
2
+ `);let i=Ae(e),o=i.append("g");i.attr("viewBox","0 0 2412 512"),ne(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${a}`)},"draw"),le={draw:da},ca=le,la={db:{},renderer:le,parser:{parse:t(()=>{return},"parse")}},ma=la,me="flowchart-elk",ua=t((r,e={})=>{if(/^\s*flowchart-elk/.test(r))return e.layout="elk",!0;return!1},"detector"),pa=t(async()=>{let{diagram:r}=await import("./flowDiagram-KWPJA3E3-aegwx04w.js");return{id:me,diagram:r}},"loader"),fa={id:me,detector:ua,loader:pa},ga=fa,ue="timeline",va=t((r)=>/^\s*timeline/.test(r),"detector"),ha=t(async()=>{let{diagram:r}=await import("./timeline-definition-EJHVYXUP-5km8n8mj.js");return{id:ue,diagram:r}},"loader"),ya={id:ue,detector:va,loader:ha},wa=ya,pe="mindmap",xa=t((r)=>/^\s*mindmap/.test(r),"detector"),ba=t(async()=>{let{diagram:r}=await import("./mindmap-definition-NLK3R4M7-sds2e243.js");return{id:pe,diagram:r}},"loader"),Sa={id:pe,detector:xa,loader:ba},Ea=Sa,fe="kanban",Da=t((r)=>/^\s*kanban/.test(r),"detector"),Ta=t(async()=>{let{diagram:r}=await import("./kanban-definition-PNTS6WVX-pzef80sz.js");return{id:fe,diagram:r}},"loader"),Aa={id:fe,detector:Da,loader:Ta},_a=Aa,ge="sankey",Ca=t((r)=>/^\s*sankey(-beta)?/.test(r),"detector"),La=t(async()=>{let{diagram:r}=await import("./sankeyDiagram-IPEJSGJF-dh5we479.js");return{id:ge,diagram:r}},"loader"),Ma={id:ge,detector:Ca,loader:La},ka=Ma,ve="packet",Ra=t((r)=>/^\s*packet(-beta)?/.test(r),"detector"),Ia=t(async()=>{let{diagram:r}=await import("./diagram-MLGK6HIB-22cjvj5g.js");return{id:ve,diagram:r}},"loader"),Oa={id:ve,detector:Ra,loader:Ia},he="radar",Fa=t((r)=>/^\s*radar-beta/.test(r),"detector"),za=t(async()=>{let{diagram:r}=await import("./diagram-MPIPVDR6-xv8fsecp.js");return{id:he,diagram:r}},"loader"),$a={id:he,detector:Fa,loader:za},ye="block",Pa=t((r)=>/^\s*block(-beta)?/.test(r),"detector"),Na=t(async()=>{let{diagram:r}=await import("./blockDiagram-BEXU5L5S-7ws8yq9e.js");return{id:ye,diagram:r}},"loader"),Va={id:ye,detector:Pa,loader:Na},Ua=Va,we="treeView",Ga=t((r)=>/^\s*treeView-beta/.test(r),"detector"),Ha=t(async()=>{let{diagram:r}=await import("./diagram-CDSNMT55-vfhtemve.js");return{id:we,diagram:r}},"loader"),Ba={id:we,detector:Ga,loader:Ha},Ya=Ba,xe="architecture",ja=t((r)=>/^\s*architecture/.test(r),"detector"),qa=t(async()=>{let{diagram:r}=await import("./architectureDiagram-NJMV4G6O-s23e6vtk.js");return{id:xe,diagram:r}},"loader"),Wa={id:xe,detector:ja,loader:qa},Xa=Wa,be="eventmodeling",Ka=t((r)=>/^\s*eventmodeling/.test(r),"detector"),Qa=t(async()=>{let{diagram:r}=await import("./diagram-ATOU4E4O-hz3bd083.js");return{id:be,diagram:r}},"loader"),Za={id:be,detector:Ka,loader:Qa},Ja=Za,Se="ishikawa",ri=t((r)=>/^\s*ishikawa(-beta)?\b/i.test(r),"detector"),ei=t(async()=>{let{diagram:r}=await import("./ishikawaDiagram-OU5B5YK6-g8symmrp.js");return{id:Se,diagram:r}},"loader"),ti={id:Se,detector:ri,loader:ei},Ee="venn",ai=t((r)=>/^\s*venn-beta/.test(r),"detector"),ii=t(async()=>{let{diagram:r}=await import("./vennDiagram-UO4OBE2U-k425105a.js");return{id:Ee,diagram:r}},"loader"),oi={id:Ee,detector:ai,loader:ii},ni=oi,De="treemap",di=t((r)=>/^\s*treemap/.test(r),"detector"),ci=t(async()=>{let{diagram:r}=await import("./diagram-3UASUU5V-xw2m99qa.js");return{id:De,diagram:r}},"loader"),li={id:De,detector:di,loader:ci},Te="usecase",mi=t((r)=>/^\s*usecase-beta(?:\s|$)/.test(r),"detector"),pi=t(async()=>{let{diagram:r}=await import("./usecaseDiagram-POWQR4AR-0vt6ms5g.js");return{id:Te,diagram:r}},"loader"),fi={id:Te,detector:mi,loader:pi},_e="wardley",gi=t((r)=>/^\s*wardley-beta/i.test(r),"detector"),vi=t(async()=>{let{diagram:r}=await import("./wardleyDiagram-VNRHLVJA-s0gd4jg1.js");return{id:_e,diagram:r}},"loader"),hi={id:_e,detector:gi,loader:vi},yi=hi,Ce="cynefin",wi=t((r)=>/^\s*cynefin-beta(?:[\s:]|$)/.test(r),"detector"),xi=t(async()=>{let{diagram:r}=await import("./cynefinDiagram-VND7K2PF-9kety453.js");return{id:Ce,diagram:r}},"loader"),bi={id:Ce,detector:wi,loader:xi},Le="railroad",Si=t((r)=>/^\s*railroad-beta/i.test(r),"detector"),Ei=t(async()=>{let{diagram:r}=await import("./railroadDiagram-XR7U4H2S-qv0be7dh.js");return{id:Le,diagram:r}},"loader"),Di={id:Le,detector:Si,loader:Ei},Me="railroadEbnf",Ti=t((r)=>/^\s*railroad-ebnf-beta/i.test(r),"detector"),Ai=t(async()=>{let{diagram:r}=await import("./ebnfDiagram-ZINNZB2B-m6mkn986.js");return{id:Me,diagram:r}},"loader"),_i={id:Me,detector:Ti,loader:Ai},ke="railroadAbnf",Ci=t((r)=>/^\s*railroad-abnf-beta/i.test(r),"detector"),Li=t(async()=>{let{diagram:r}=await import("./abnfDiagram-O67JEVCF-xppr9jf1.js");return{id:ke,diagram:r}},"loader"),Mi={id:ke,detector:Ci,loader:Li},Re="railroadPeg",ki=t((r)=>/^\s*railroad-peg-beta/i.test(r),"detector"),Ri=t(async()=>{let{diagram:r}=await import("./pegDiagram-GJSIUBJH-m8199cy0.js");return{id:Re,diagram:r}},"loader"),Ii={id:Re,detector:ki,loader:Ri},Ur=!1,mr=t(()=>{if(Ur)return;Ur=!0,dd("error",ma,(r)=>r.toLowerCase().trim()==="error"),dd("---",{db:{clear:t(()=>{},"clear")},styles:{},renderer:{draw:t(()=>{},"draw")},parser:{parse:t(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:t(()=>null,"init")},(r)=>r.toLowerCase().trimStart().startsWith("---")),Wp(ga,Ea,Xa),Wp(ct,rt,_a,Zt,ht,Tt,Ct,kt,Bt,Wt,pt,it,wa,bt,aa,sa,Ft,ka,Oa,Nt,Ua,Ja,Ya,$a,ti,li,Di,_i,Mi,Ii,ni,yi,bi,fi)},"addDiagrams"),Oi=t(async()=>{l.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(Vi).map(async([a,{detector:i,loader:o}])=>{if(!o)return;try{Jp(a)}catch{try{let{diagram:n,id:d}=await o();dd(d,n,i)}catch(n){throw l.error(`Failed to load external diagram with key ${a}. Removing from detectors.`),delete Vi[a],n}}}))).filter((a)=>a.status==="rejected");if(e.length>0){l.error(`Failed to load ${e.length} external diagrams`);for(let a of e)l.error(a);throw Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),Fi="graphics-document document";function Ie(r,e){if(r.attr("role",Fi),e!=="")r.attr("aria-roledescription",e)}t(Ie,"setA11yDiagramInfo");function Oe(r,e,a,i){if(r.insert===void 0)return;if(a){let o=`chart-desc-${i}`;r.attr("aria-describedby",o),r.insert("desc",":first-child").attr("id",o).text(a)}if(e){let o=`chart-title-${i}`;r.attr("aria-labelledby",o),r.insert("title",":first-child").attr("id",o).text(e)}}t(Oe,"addSVGa11yTitleDescription");var cr=class r{constructor(e,a,i,o,n){this.type=e,this.text=a,this.db=i,this.parser=o,this.renderer=n}static{t(this,"Diagram")}static async fromText(e,a={}){let i=typeof e==="string"?{raw:e,cleaned:e}:e,o=C(),n=cc(i.cleaned,o);try{Jp(n)}catch{let u=JA(n);if(!u)throw new Tg(`Diagram ${n} not found.`);let{id:w,diagram:D}=await u();dd(w,D)}let{db:d,parser:s,renderer:c,init:f}=Jp(n);if(s.parser)s.parser.yy=d;if(d.clear?.(),f?.(o),a.title)d.setDiagramTitle?.(a.title);let g=i.cleaned;if(d.preserveCommentsWhenParsing&&i.withComments){let u=o.maxTextSize??Y.maxTextSize;if(i.withComments.length>u)l.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`);else g=i.withComments}let p=ih(g)+`
3
3
  `;if(i.frontmatterLineOffset)d.setFrontmatterLineOffset?.(i.frontmatterLineOffset);return await s.parse(p),new r(n,p,d,s,c)}async render(e,a){await this.renderer.draw(this.text,e,a,this)}getParser(){return this.parser}getType(){return this.type}},Gr=[],zi=t(()=>{Gr.forEach((r)=>{r()}),Gr=[]},"attachFunctions"),$i=t((r)=>r.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Fe(r){let e=r.match(Sg);if(!e)return{text:r,metadata:{}};let a=e[1],i=a?e[2].split(`
4
4
  `).map((d)=>d.startsWith(a)?d.slice(a.length):d).join(`
5
5
  `):e[2],o=hr(i,{schema:Ar})??{};o=typeof o==="object"&&!Array.isArray(o)?o:{};let n={};if(o.displayMode)n.displayMode=o.displayMode.toString();if(o.title)n.title=o.title.toString();if(o.config)n.config=o.config;return{text:r.slice(e[0].length),metadata:n}}t(Fe,"extractFrontMatter");var Pi=t((r)=>r.replace(/\r\n?/g,`
@@ -1,4 +1,4 @@
1
- import{t,l,De,g,A,Y,C,nh,te,m,Pt,Ot,$t,vt}from"./index-n5194pe6.js";var fe=new Uint8Array(16);function Q(){return crypto.getRandomValues(fe)}var _=[];for(let e=0;e<256;++e)_.push((e+256).toString(16).slice(1));function le(e,n=0){return(_[e[n+0]]+_[e[n+1]]+_[e[n+2]]+_[e[n+3]]+"-"+_[e[n+4]]+_[e[n+5]]+"-"+_[e[n+6]]+_[e[n+7]]+"-"+_[e[n+8]]+_[e[n+9]]+"-"+_[e[n+10]]+_[e[n+11]]+_[e[n+12]]+_[e[n+13]]+_[e[n+14]]+_[e[n+15]]).toLowerCase()}function me(e,n,d){if(!n&&!e&&crypto.randomUUID)return crypto.randomUUID();return ye(e,n,d)}function ye(e,n,d){e=e||{};let c=e.random??e.rng?.()??Q();if(c.length<16)throw Error("Random bytes length must be >= 16");if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,n){if(d=d||0,d<0||d+16>n.length)throw RangeError(`UUID byte range ${d}:${d+15} is out of buffer bounds`);for(let i=0;i<16;++i)n[d+i]=c[i];return n}return le(c)}var Z=me;var ee=function(){var e=t(function(T,o,r,a){for(r=r||{},a=T.length;a--;r[T[a]]=o);return r},"o"),n=[1,4],d=[1,13],c=[1,12],i=[1,15],u=[1,16],k=[1,20],b=[1,19],S=[6,7,8],w=[1,26],U=[1,24],B=[1,25],p=[6,7,11],M=[1,6,13,15,16,19,22],ie=[1,33],ne=[1,34],P=[1,6,7,11,13,15,16,19,22],W={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:t(function(o,r,a,h,y,s,V){var f=s.length-1;switch(y){case 6:case 7:return h;case 8:h.getLogger().trace("Stop NL ");break;case 9:h.getLogger().trace("Stop EOF ");break;case 11:h.getLogger().trace("Stop NL2 ");break;case 12:h.getLogger().trace("Stop EOF2 ");break;case 15:h.getLogger().info("Node: ",s[f].id),h.addNode(s[f-1].length,s[f].id,s[f].descr,s[f].type);break;case 16:h.getLogger().trace("Icon: ",s[f]),h.decorateNode({icon:s[f]});break;case 17:case 21:h.decorateNode({class:s[f]});break;case 18:h.getLogger().trace("SPACELIST");break;case 19:h.getLogger().trace("Node: ",s[f].id),h.addNode(0,s[f].id,s[f].descr,s[f].type);break;case 20:h.decorateNode({icon:s[f]});break;case 25:h.getLogger().trace("node found ..",s[f-2]),this.$={id:s[f-1],descr:s[f-1],type:h.getType(s[f-2],s[f])};break;case 26:this.$={id:s[f],descr:s[f],type:h.nodeType.DEFAULT};break;case 27:h.getLogger().trace("node found ..",s[f-3]),this.$={id:s[f-3],descr:s[f-1],type:h.getType(s[f-2],s[f])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:d,7:[1,10],9:9,12:11,13:c,14:14,15:i,16:u,17:17,18:18,19:k,22:b},e(S,[2,3]),{1:[2,2]},e(S,[2,4]),e(S,[2,5]),{1:[2,6],6:d,12:21,13:c,14:14,15:i,16:u,17:17,18:18,19:k,22:b},{6:d,9:22,12:11,13:c,14:14,15:i,16:u,17:17,18:18,19:k,22:b},{6:w,7:U,10:23,11:B},e(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:k,22:b}),e(p,[2,18]),e(p,[2,19]),e(p,[2,20]),e(p,[2,21]),e(p,[2,23]),e(p,[2,24]),e(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:w,7:U,10:32,11:B},{1:[2,7],6:d,12:21,13:c,14:14,15:i,16:u,17:17,18:18,19:k,22:b},e(M,[2,14],{7:ie,11:ne}),e(P,[2,8]),e(P,[2,9]),e(P,[2,10]),e(p,[2,15]),e(p,[2,16]),e(p,[2,17]),{20:[1,35]},{21:[1,36]},e(M,[2,13],{7:ie,11:ne}),e(P,[2,11]),e(P,[2,12]),{21:[1,37]},e(p,[2,25]),e(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(o,r){if(r.recoverable)this.trace(o);else{var a=Error(o);throw a.hash=r,a}},"parseError"),parse:t(function(o){var r=this,a=[0],h=[],y=[null],s=[],V=this.table,f="",G=0,re=0,se=0,de=2,oe=1,ge=s.slice.call(arguments,1),E=Object.create(this.lexer),O={yy:{}};for(var X in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,X))O.yy[X]=this.yy[X];if(E.setInput(o,O.yy),O.yy.lexer=E,O.yy.parser=this,typeof E.yylloc>"u")E.yylloc={};var z=E.yylloc;s.push(z);var ue=E.options&&E.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function pe(D){a.length=a.length-2*D,y.length=y.length-D,s.length=s.length-D}t(pe,"popStack");function ae(){var D=h.pop()||E.lex()||oe;if(typeof D!=="number"){if(D instanceof Array)h=D,D=h.pop();D=r.symbols_[D]||D}return D}t(ae,"lex");var x,q,I,N,Te,J,R={},j,L,ce,H;while(!0){if(I=a[a.length-1],this.defaultActions[I])N=this.defaultActions[I];else{if(x===null||typeof x>"u")x=ae();N=V[I]&&V[I][x]}if(typeof N>"u"||!N.length||!N[0]){var K="";H=[];for(j in V[I])if(this.terminals_[j]&&j>de)H.push("'"+this.terminals_[j]+"'");if(E.showPosition)K="Parse error on line "+(G+1)+`:
1
+ import{t,l,De,g,A,Y,C,nh,te,m,Pt,Ot,$t,vt}from"./index-pqmvhqmj.js";var fe=new Uint8Array(16);function Q(){return crypto.getRandomValues(fe)}var _=[];for(let e=0;e<256;++e)_.push((e+256).toString(16).slice(1));function le(e,n=0){return(_[e[n+0]]+_[e[n+1]]+_[e[n+2]]+_[e[n+3]]+"-"+_[e[n+4]]+_[e[n+5]]+"-"+_[e[n+6]]+_[e[n+7]]+"-"+_[e[n+8]]+_[e[n+9]]+"-"+_[e[n+10]]+_[e[n+11]]+_[e[n+12]]+_[e[n+13]]+_[e[n+14]]+_[e[n+15]]).toLowerCase()}function me(e,n,d){if(!n&&!e&&crypto.randomUUID)return crypto.randomUUID();return ye(e,n,d)}function ye(e,n,d){e=e||{};let c=e.random??e.rng?.()??Q();if(c.length<16)throw Error("Random bytes length must be >= 16");if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,n){if(d=d||0,d<0||d+16>n.length)throw RangeError(`UUID byte range ${d}:${d+15} is out of buffer bounds`);for(let i=0;i<16;++i)n[d+i]=c[i];return n}return le(c)}var Z=me;var ee=function(){var e=t(function(T,o,r,a){for(r=r||{},a=T.length;a--;r[T[a]]=o);return r},"o"),n=[1,4],d=[1,13],c=[1,12],i=[1,15],u=[1,16],k=[1,20],b=[1,19],S=[6,7,8],w=[1,26],U=[1,24],B=[1,25],p=[6,7,11],M=[1,6,13,15,16,19,22],ie=[1,33],ne=[1,34],P=[1,6,7,11,13,15,16,19,22],W={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:t(function(o,r,a,h,y,s,V){var f=s.length-1;switch(y){case 6:case 7:return h;case 8:h.getLogger().trace("Stop NL ");break;case 9:h.getLogger().trace("Stop EOF ");break;case 11:h.getLogger().trace("Stop NL2 ");break;case 12:h.getLogger().trace("Stop EOF2 ");break;case 15:h.getLogger().info("Node: ",s[f].id),h.addNode(s[f-1].length,s[f].id,s[f].descr,s[f].type);break;case 16:h.getLogger().trace("Icon: ",s[f]),h.decorateNode({icon:s[f]});break;case 17:case 21:h.decorateNode({class:s[f]});break;case 18:h.getLogger().trace("SPACELIST");break;case 19:h.getLogger().trace("Node: ",s[f].id),h.addNode(0,s[f].id,s[f].descr,s[f].type);break;case 20:h.decorateNode({icon:s[f]});break;case 25:h.getLogger().trace("node found ..",s[f-2]),this.$={id:s[f-1],descr:s[f-1],type:h.getType(s[f-2],s[f])};break;case 26:this.$={id:s[f],descr:s[f],type:h.nodeType.DEFAULT};break;case 27:h.getLogger().trace("node found ..",s[f-3]),this.$={id:s[f-3],descr:s[f-1],type:h.getType(s[f-2],s[f])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:d,7:[1,10],9:9,12:11,13:c,14:14,15:i,16:u,17:17,18:18,19:k,22:b},e(S,[2,3]),{1:[2,2]},e(S,[2,4]),e(S,[2,5]),{1:[2,6],6:d,12:21,13:c,14:14,15:i,16:u,17:17,18:18,19:k,22:b},{6:d,9:22,12:11,13:c,14:14,15:i,16:u,17:17,18:18,19:k,22:b},{6:w,7:U,10:23,11:B},e(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:k,22:b}),e(p,[2,18]),e(p,[2,19]),e(p,[2,20]),e(p,[2,21]),e(p,[2,23]),e(p,[2,24]),e(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:w,7:U,10:32,11:B},{1:[2,7],6:d,12:21,13:c,14:14,15:i,16:u,17:17,18:18,19:k,22:b},e(M,[2,14],{7:ie,11:ne}),e(P,[2,8]),e(P,[2,9]),e(P,[2,10]),e(p,[2,15]),e(p,[2,16]),e(p,[2,17]),{20:[1,35]},{21:[1,36]},e(M,[2,13],{7:ie,11:ne}),e(P,[2,11]),e(P,[2,12]),{21:[1,37]},e(p,[2,25]),e(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(o,r){if(r.recoverable)this.trace(o);else{var a=Error(o);throw a.hash=r,a}},"parseError"),parse:t(function(o){var r=this,a=[0],h=[],y=[null],s=[],V=this.table,f="",G=0,re=0,se=0,de=2,oe=1,ge=s.slice.call(arguments,1),E=Object.create(this.lexer),O={yy:{}};for(var X in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,X))O.yy[X]=this.yy[X];if(E.setInput(o,O.yy),O.yy.lexer=E,O.yy.parser=this,typeof E.yylloc>"u")E.yylloc={};var z=E.yylloc;s.push(z);var ue=E.options&&E.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function pe(D){a.length=a.length-2*D,y.length=y.length-D,s.length=s.length-D}t(pe,"popStack");function ae(){var D=h.pop()||E.lex()||oe;if(typeof D!=="number"){if(D instanceof Array)h=D,D=h.pop();D=r.symbols_[D]||D}return D}t(ae,"lex");var x,q,I,N,Te,J,R={},j,L,ce,H;while(!0){if(I=a[a.length-1],this.defaultActions[I])N=this.defaultActions[I];else{if(x===null||typeof x>"u")x=ae();N=V[I]&&V[I][x]}if(typeof N>"u"||!N.length||!N[0]){var K="";H=[];for(j in V[I])if(this.terminals_[j]&&j>de)H.push("'"+this.terminals_[j]+"'");if(E.showPosition)K="Parse error on line "+(G+1)+`:
2
2
  `+E.showPosition()+`
3
3
  Expecting `+H.join(", ")+", got '"+(this.terminals_[x]||x)+"'";else K="Parse error on line "+(G+1)+": Unexpected "+(x==oe?"end of input":"'"+(this.terminals_[x]||x)+"'");this.parseError(K,{text:E.match,token:this.terminals_[x]||x,line:E.yylineno,loc:z,expected:H})}if(N[0]instanceof Array&&N.length>1)throw Error("Parse Error: multiple actions possible at state: "+I+", token: "+x);switch(N[0]){case 1:if(a.push(x),y.push(E.yytext),s.push(E.yylloc),a.push(N[1]),x=null,!q){if(re=E.yyleng,f=E.yytext,G=E.yylineno,z=E.yylloc,se>0)se--}else x=q,q=null;break;case 2:if(L=this.productions_[N[1]][1],R.$=y[y.length-L],R._$={first_line:s[s.length-(L||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(L||1)].first_column,last_column:s[s.length-1].last_column},ue)R._$.range=[s[s.length-(L||1)].range[0],s[s.length-1].range[1]];if(J=this.performAction.apply(R,[f,re,G,O.yy,N[1],y,s].concat(ge)),typeof J<"u")return J;if(L)a=a.slice(0,-1*L*2),y=y.slice(0,-1*L),s=s.slice(0,-1*L);a.push(this.productions_[N[1]][0]),y.push(R.$),s.push(R._$),ce=V[a[a.length-2]][a[a.length-1]],a.push(ce);break;case 3:return!0}}return!0},"parse")},he=function(){var T={EOF:1,parseError:t(function(r,a){if(this.yy.parser)this.yy.parser.parseError(r,a);else throw Error(r)},"parseError"),setInput:t(function(o,r){if(this.yy=r||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var r=o.match(/(?:\r\n?|\n).*/g);if(r)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),o},"input"),unput:t(function(o){var r=o.length,a=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var h=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1)this.yylineno-=a.length-1;var y=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===h.length?this.yylloc.first_column:0)+h[h.length-a.length].length-a[0].length:this.yylloc.first_column-r},this.options.ranges)this.yylloc.range=[y[0],y[0]+this.yyleng-r];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(o){this.unput(this.match.slice(o))},"less"),pastInput:t(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var o=this.match;if(o.length<20)o+=this._input.substr(0,20-o.length);return(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var o=this.pastInput(),r=Array(o.length+1).join("-");return o+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{_h}from"./index-7ckzdf4r.js";export{_h as default};
@@ -0,0 +1 @@
1
+ import{Ih}from"./index-7ckzdf4r.js";export{Ih as default};