@runfusion/fusion 0.50.0 → 0.52.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 (144) hide show
  1. package/dist/bin.js +9801 -4827
  2. package/dist/client/.vite/manifest.json +328 -327
  3. package/dist/client/assets/{AgentDetailView-D2oYUApl.js → AgentDetailView-C-PM8cwG.js} +1 -1
  4. package/dist/client/assets/{AgentPermissionPolicyEditor-DGgx46f3.js → AgentPermissionPolicyEditor-DrVW4VPc.js} +1 -1
  5. package/dist/client/assets/{AgentsView-Dhf5Vq_T.js → AgentsView-DJJO0laF.js} +6 -11
  6. package/dist/client/assets/ChatView-C7uTm5hO.js +16 -0
  7. package/dist/client/assets/ChatView-D_2wBIIx.css +1 -0
  8. package/dist/client/assets/CommandCenter-CKvo0MuO.js +71 -0
  9. package/dist/client/assets/{DevServerView-DjJYp6Jj.js → DevServerView-BHLG4Mxg.js} +1 -1
  10. package/dist/client/assets/{DirectoryPicker-CYPYp9T4.js → DirectoryPicker-CRY-rpnj.js} +1 -1
  11. package/dist/client/assets/{DocumentsView-CeQVRVdp.js → DocumentsView-DhC4dnXD.js} +1 -1
  12. package/dist/client/assets/{EvalsView-D250mVR5.js → EvalsView-DsnLOVZB.js} +1 -1
  13. package/dist/client/assets/{ExperimentalAgentOnboardingModal-B1EEY_bl.js → ExperimentalAgentOnboardingModal-B4iFX60E.js} +1 -1
  14. package/dist/client/assets/{GoalsView-CUh8JBnJ.css → GoalsView-4-eEOeqw.css} +1 -1
  15. package/dist/client/assets/GoalsView-D5bzq6W9.js +2 -0
  16. package/dist/client/assets/{InsightsView-CbWItYe8.js → InsightsView-Drpu72M4.js} +1 -1
  17. package/dist/client/assets/{MemoryView-Ct0nOTES.js → MemoryView-auLBP3UW.js} +1 -1
  18. package/dist/client/assets/{PiExtensionsManager-DSQwngX-.js → PiExtensionsManager-RlbkXf_t.js} +1 -1
  19. package/dist/client/assets/{PluginManager-DqLxCiNg.js → PluginManager-BJMUacpG.js} +1 -1
  20. package/dist/client/assets/PullRequestView-344B9WF-.js +6 -0
  21. package/dist/client/assets/PullRequestView-NkeImY1n.css +1 -0
  22. package/dist/client/assets/{ResearchView-CJQL9XKC.js → ResearchView-BNqt-f53.js} +1 -1
  23. package/dist/client/assets/{SecretsView-ChN9aTbi.js → SecretsView-Be8Tm8It.js} +1 -1
  24. package/dist/client/assets/SessionTerminal-CumHUelZ.js +2 -0
  25. package/dist/client/assets/SettingsModal-AJfer-ve.js +21 -0
  26. package/dist/client/assets/{SettingsModal-CIC5jhgo.js → SettingsModal-B28DuhaN.js} +1 -1
  27. package/dist/client/assets/SettingsModal-CaE4JYxi.css +1 -0
  28. package/dist/client/assets/{SetupWizardModal-C6EGjmbd.js → SetupWizardModal-y2j9aZoi.js} +2 -2
  29. package/dist/client/assets/ShadcnColorPicker-Cc72uPKJ.js +11 -0
  30. package/dist/client/assets/ShadcnColorPicker-CyeAnJUU.css +1 -0
  31. package/dist/client/assets/{SkillsView-Dz8dDwfP.js → SkillsView-HQp7UTdA.js} +1 -1
  32. package/dist/client/assets/{TodoView-DvJFzoOv.js → TodoView-DF7_qWGH.js} +1 -1
  33. package/dist/client/assets/WorkflowNodeEditor-BjpqTIYE.js +8 -0
  34. package/dist/client/assets/WorkflowNodeEditor-Df-_206_.css +1 -0
  35. package/dist/client/assets/{agentSkills-B2dD5Nm5.js → agentSkills-Cy_HrYHd.js} +1 -1
  36. package/dist/client/assets/{app-D27ewSC0.js → app-CGubyqAW.js} +3 -3
  37. package/dist/client/assets/{app-dATBczl3.js → app-CrQpHbIs.js} +2 -2
  38. package/dist/client/assets/{app-BYq4S7Cb.js → app-DboK-0Ty.js} +1 -1
  39. package/dist/client/assets/{app-OPrfgjjn.js → app-DjnYET2y.js} +3 -3
  40. package/dist/client/assets/{app-DFLDkeOE.js → app-MacS555z.js} +3 -3
  41. package/dist/client/assets/{app-k1K9zAjp.js → app-nvVayIeU.js} +3 -3
  42. package/dist/client/assets/{architectureDiagram-3BPJPVTR-ClO0MnzR.js → architectureDiagram-3BPJPVTR-4ur4sxlr.js} +1 -1
  43. package/dist/client/assets/{blockDiagram-GPEHLZMM-C4cyy4WE.js → blockDiagram-GPEHLZMM-BgZeqq_q.js} +1 -1
  44. package/dist/client/assets/{c4Diagram-AAUBKEIU-NHPC9TJo.js → c4Diagram-AAUBKEIU-BQtdOIrm.js} +1 -1
  45. package/dist/client/assets/channel-Dn5XowfJ.js +1 -0
  46. package/dist/client/assets/{chunk-2J33WTMH-CGYIKTVR.js → chunk-2J33WTMH-C1k1PBy1.js} +1 -1
  47. package/dist/client/assets/{chunk-4BX2VUAB-BkCCD0tE.js → chunk-4BX2VUAB-hNujwvSn.js} +1 -1
  48. package/dist/client/assets/{chunk-55IACEB6-Be3yOIDe.js → chunk-55IACEB6-CnXV9LyI.js} +1 -1
  49. package/dist/client/assets/{chunk-727SXJPM-DxjyMaQQ.js → chunk-727SXJPM-B-ocMdYN.js} +1 -1
  50. package/dist/client/assets/{chunk-AQP2D5EJ-BC0PjN0W.js → chunk-AQP2D5EJ-CWNRUL6C.js} +1 -1
  51. package/dist/client/assets/{chunk-FMBD7UC4-DoWxmM8k.js → chunk-FMBD7UC4-DerrCiYe.js} +1 -1
  52. package/dist/client/assets/{chunk-ND2GUHAM-EOpuc9pP.js → chunk-ND2GUHAM-BfcSPlX-.js} +1 -1
  53. package/dist/client/assets/{chunk-QZHKN3VN-DiRyx9QZ.js → chunk-QZHKN3VN-BaWScAds.js} +1 -1
  54. package/dist/client/assets/classDiagram-4FO5ZUOK-zSOW-KNk.js +1 -0
  55. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-zSOW-KNk.js +1 -0
  56. package/dist/client/assets/{cose-bilkent-S5V4N54A-CfVoUUxT.js → cose-bilkent-S5V4N54A-n0Oeinz2.js} +1 -1
  57. package/dist/client/assets/{dagre-BM42HDAG-BfILvxLb.js → dagre-BM42HDAG-CUtehSt2.js} +1 -1
  58. package/dist/client/assets/{dashboard-view-C9YIcx-O.js → dashboard-view-BW3GHqgb.js} +1633 -1633
  59. package/dist/client/assets/{dashboard-view-wFC1pe4d.js → dashboard-view-DWKCxtr5.js} +1 -1
  60. package/dist/client/assets/{diagram-2AECGRRQ-6mdmbH-5.js → diagram-2AECGRRQ-Bz4aOzhR.js} +1 -1
  61. package/dist/client/assets/{diagram-5GNKFQAL-CY7MMwO1.js → diagram-5GNKFQAL-UoxIMwPf.js} +1 -1
  62. package/dist/client/assets/{diagram-KO2AKTUF-D05XnQqd.js → diagram-KO2AKTUF-BYR7hloS.js} +1 -1
  63. package/dist/client/assets/{diagram-LMA3HP47-B18FTOJG.js → diagram-LMA3HP47-BR9MaP8U.js} +1 -1
  64. package/dist/client/assets/{diagram-OG6HWLK6-xmXlYf5m.js → diagram-OG6HWLK6-BOfldYHv.js} +1 -1
  65. package/dist/client/assets/{erDiagram-TEJ5UH35-4XlgVLCs.js → erDiagram-TEJ5UH35-B8x9mfOs.js} +1 -1
  66. package/dist/client/assets/{flowDiagram-I6XJVG4X-BYl3ps7f.js → flowDiagram-I6XJVG4X-DBnTroCV.js} +1 -1
  67. package/dist/client/assets/{folder-open-BH6FwmO7.js → folder-open-CFze34Eq.js} +1 -1
  68. package/dist/client/assets/{ganttDiagram-6RSMTGT7-4vxuH9Dx.js → ganttDiagram-6RSMTGT7-BfzFy7iz.js} +1 -1
  69. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-BESmFgXT.js → gitGraphDiagram-PVQCEYII-CNTFu6IY.js} +1 -1
  70. package/dist/client/assets/index-QnHUwSjw.css +1 -0
  71. package/dist/client/assets/index-Y-vyXPPN.js +1331 -0
  72. package/dist/client/assets/{infoDiagram-5YYISTIA-DvjdjtwB.js → infoDiagram-5YYISTIA-DJiBRaAl.js} +1 -1
  73. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-Cis5IoEm.js → ishikawaDiagram-YF4QCWOH-CIY9t4cc.js} +1 -1
  74. package/dist/client/assets/{journeyDiagram-JHISSGLW-C20pB1W8.js → journeyDiagram-JHISSGLW-HLMZmcjY.js} +1 -1
  75. package/dist/client/assets/{kanban-definition-UN3LZRKU-CiVfCeU3.js → kanban-definition-UN3LZRKU-x9nKoxCI.js} +1 -1
  76. package/dist/client/assets/{linear-dXivciGL.js → linear-CwI45w2t.js} +1 -1
  77. package/dist/client/assets/{mermaid.core-CW0vCXA6.js → mermaid.core-pHkdB6fb.js} +4 -4
  78. package/dist/client/assets/{mindmap-definition-RKZ34NQL-E5rPHUdw.js → mindmap-definition-RKZ34NQL-Bs_4Tofu.js} +1 -1
  79. package/dist/client/assets/{pieDiagram-4H26LBE5-DVIFbPjH.js → pieDiagram-4H26LBE5-BGHz9JGZ.js} +1 -1
  80. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-C8qPRe_x.js → quadrantDiagram-W4KKPZXB-xHSR7cAR.js} +1 -1
  81. package/dist/client/assets/{requirementDiagram-4Y6WPE33-DQ-pwXh3.js → requirementDiagram-4Y6WPE33-D7YMNM44.js} +1 -1
  82. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-BnghLuUc.js → sankeyDiagram-5OEKKPKP-OAXuab3Y.js} +1 -1
  83. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-ChlGxGVk.js → sequenceDiagram-3UESZ5HK-BZCjKFVL.js} +1 -1
  84. package/dist/client/assets/{shield-alert-BfOnDO6O.js → shield-alert-BBK8Risa.js} +1 -1
  85. package/dist/client/assets/{stateDiagram-AJRCARHV-ByUvNEch.js → stateDiagram-AJRCARHV-COnJQqA4.js} +1 -1
  86. package/dist/client/assets/{stateDiagram-v2-BHNVJYJU-Df38ITSP.js → stateDiagram-v2-BHNVJYJU-Diml4Nhm.js} +1 -1
  87. package/dist/client/assets/{time-DoDTxsna.js → time-Ckmi30gH.js} +1 -1
  88. package/dist/client/assets/{timeline-definition-PNZ67QCA-bsAGc83D.js → timeline-definition-PNZ67QCA-DHIKvV9L.js} +1 -1
  89. package/dist/client/assets/{upload-BK1crTqn.js → upload-CqUJUdZW.js} +1 -1
  90. package/dist/client/assets/{users-DW8jC2Z9.js → users-CAE-FEzI.js} +1 -1
  91. package/dist/client/assets/{vendor-reactflow-Bg-Qjzh8.js → vendor-reactflow-CnI7NMXG.js} +1 -1
  92. package/dist/client/assets/{vennDiagram-CIIHVFJN-BBIj6LFN.js → vennDiagram-CIIHVFJN-o9AxLDoL.js} +1 -1
  93. package/dist/client/assets/{wardley-L42UT6IY-De6JFroy.js → wardley-L42UT6IY-B7MIazje.js} +1 -1
  94. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-P1LOLx0_.js → wardleyDiagram-YWT4CUSO-B6qUJx0N.js} +1 -1
  95. package/dist/client/assets/{xychartDiagram-2RQKCTM6-v1G4ki6U.js → xychartDiagram-2RQKCTM6-13mSXuCA.js} +1 -1
  96. package/dist/client/index.html +8 -8
  97. package/dist/client/theme-data.css +140 -0
  98. package/dist/client/version.json +1 -1
  99. package/dist/droid-cli/package.json +1 -1
  100. package/dist/extension.js +7658 -3691
  101. package/dist/pi-claude-cli/index.ts +13 -0
  102. package/dist/pi-claude-cli/package.json +1 -1
  103. package/dist/pi-claude-cli/src/__tests__/process-manager.test.ts +2 -2
  104. package/dist/pi-claude-cli/src/__tests__/provider.test.ts +27 -4
  105. package/dist/plugin-sdk/index.d.ts +38 -1
  106. package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
  107. package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
  108. package/dist/plugins/fusion-plugin-compound-engineering/bundled.js +1 -1
  109. package/dist/plugins/fusion-plugin-compound-engineering/manifest.json +1 -1
  110. package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
  111. package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
  112. package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
  113. package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
  114. package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
  115. package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
  116. package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
  117. package/dist/plugins/fusion-plugin-reports/package.json +1 -1
  118. package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
  119. package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
  120. package/package.json +1 -1
  121. package/skill/fusion/SKILL.md +1 -0
  122. package/skill/fusion/references/best-practices.md +3 -3
  123. package/skill/fusion/references/engine-tools.md +3 -3
  124. package/skill/fusion/references/extension-tools.md +82 -5
  125. package/skill/fusion/references/fusion-capabilities.md +9 -1
  126. package/skill/fusion/workflows/task-management.md +1 -1
  127. package/dist/client/assets/ChatView-DpgpxHva.js +0 -19
  128. package/dist/client/assets/ChatView-DwIIrJxb.css +0 -1
  129. package/dist/client/assets/CommandCenter-DzQhGq_J.js +0 -71
  130. package/dist/client/assets/GoalsView-MftVwE9g.js +0 -2
  131. package/dist/client/assets/PullRequestView-CpdE3Yo_.css +0 -1
  132. package/dist/client/assets/PullRequestView-D0WgwdAi.js +0 -6
  133. package/dist/client/assets/SessionTerminal-BVon9kbr.js +0 -2
  134. package/dist/client/assets/SettingsModal-B4WANQnu.js +0 -21
  135. package/dist/client/assets/SettingsModal-tUDR6nJ9.css +0 -1
  136. package/dist/client/assets/ShadcnColorPicker-4e_aXoGX.js +0 -11
  137. package/dist/client/assets/ShadcnColorPicker-CzZo9UOD.css +0 -1
  138. package/dist/client/assets/WorkflowNodeEditor-DrdTCstS.js +0 -8
  139. package/dist/client/assets/WorkflowNodeEditor-WYIxHTxY.css +0 -1
  140. package/dist/client/assets/channel-Q2WKocEP.js +0 -1
  141. package/dist/client/assets/classDiagram-4FO5ZUOK-CPFl2Aqd.js +0 -1
  142. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CPFl2Aqd.js +0 -1
  143. package/dist/client/assets/index-B9jtBwFy.css +0 -1
  144. package/dist/client/assets/index-DFeBJ3GM.js +0 -1302
@@ -1,4 +1,4 @@
1
- import{p as lr}from"./chunk-4BX2VUAB-BkCCD0tE.js";import{I as hr}from"./chunk-QZHKN3VN-DiRyx9QZ.js";import{q as $r,p as fr,s as gr,g as ur,a as yr,b as xr,_ as h,E as J,l as w,c as W,u as mr,F as pr,z as br,j as B,G as wr,H as kr,I as vr}from"./mermaid.core-CW0vCXA6.js";import{p as Cr}from"./wardley-L42UT6IY-De6JFroy.js";import{s as Er}from"./vendor-reactflow-Bg-Qjzh8.js";import"./index-DFeBJ3GM.js";import"./vendor-react-SZ_qB27O.js";import"./vendor-i18n-GF3RlKbq.js";import"./vendor-xterm-BNq00GSj.js";import"./vendor-codemirror-jBKmHyH0.js";import"./step-yuy0qJer.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Br=kr.gitGraph,S=h(()=>wr({...Br,...J().gitGraph}),"getConfig"),d=new hr(()=>{const r=S(),e=r.mainBranchName,t=r.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:t}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function Y(){return vr({length:7})}h(Y,"getID");function tr(r,e){const t=Object.create(null);return r.reduce((s,o)=>{const i=e(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(tr,"uniqBy");var Tr=h(function(r){d.records.direction=r},"setDirection"),Lr=h(function(r){w.debug("options str",r),r=r?.trim(),r=r||"{}";try{d.records.options=JSON.parse(r)}catch(e){w.error("error while parsing gitGraph options",e.message)}},"setOptions"),Mr=h(function(){return d.records.options},"getOptions"),Ir=h(function(r){let e=r.msg,t=r.id;const s=r.type;let o=r.tags;w.info("commit",e,t,s,o),w.debug("Entering commit:",e,t,s,o);const i=S();t=B.sanitizeText(t,i),e=B.sanitizeText(e,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:e,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Rr=h(function(r){let e=r.name;const t=r.order;if(e=B.sanitizeText(e,S()),d.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);d.records.branches.set(e,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(e,{name:e,order:t}),ar(e),w.debug("in createBranch")},"branch"),Or=h(r=>{let e=r.branch,t=r.id;const s=r.type,o=r.tags,i=S();e=B.sanitizeText(e,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(e),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(d.records.currBranch===e){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},c}if(!d.records.branches.has(e)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${e} ${t} ${s} ${o?.join(" ")}`,token:`merge ${e} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${e} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${e} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_r=h(function(r){let e=r.id,t=r.targetId,s=r.tags,o=r.parent;w.debug("Entering cherryPick:",e,t,s);const i=S();if(e=B.sanitizeText(e,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!e||!d.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${t}`,token:`cherryPick ${e} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(e);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${e} ${t}`,token:`cherryPick ${e} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${e} ${t}`,token:`cherryPick ${e} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${e} ${t}`,token:`cherryPick ${e} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ar=h(function(r){if(r=B.sanitizeText(r,S()),d.records.branches.has(r)){d.records.currBranch=r;const e=d.records.branches.get(d.records.currBranch);e===void 0||!e?d.records.head=null:d.records.head=d.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${r}")`);throw e.hash={text:`checkout ${r}`,token:`checkout ${r}`,expected:[`branch ${r}`]},e}},"checkout");function V(r,e,t){const s=r.indexOf(e);s===-1?r.push(t):r.splice(s,1,t)}h(V,"upsert");function Q(r){const e=r.reduce((o,i)=>o.seq>i.seq?o:i,r[0]);let t="";r.forEach(function(o){o===e?t+=" *":t+=" |"});const s=[t,e.id,e.seq];for(const o in d.records.branches)d.records.branches.get(o)===e.id&&s.push(o);if(w.debug(s.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const o=d.records.commits.get(e.parents[0]);V(r,e,o),e.parents[1]&&r.push(d.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const o=d.records.commits.get(e.parents[0]);V(r,e,o)}}r=tr(r,o=>o.id),Q(r)}h(Q,"prettyPrintCommitHistory");var Gr=h(function(){w.debug(d.records.commits);const r=nr()[0];Q([r])},"prettyPrint"),Hr=h(function(){d.reset(),br()},"clear"),Sr=h(function(){return[...d.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Ar=h(function(){return d.records.branches},"getBranches"),Dr=h(function(){return d.records.commits},"getCommits"),nr=h(function(){const r=[...d.records.commits.values()];return r.forEach(function(e){w.debug(e.id)}),r.sort((e,t)=>e.seq-t.seq),r},"getCommitsArray"),qr=h(function(){return d.records.currBranch},"getCurrentBranch"),Pr=h(function(){return d.records.direction},"getDirection"),Wr=h(function(){return d.records.head},"getHead"),sr={commitType:m,getConfig:S,setDirection:Tr,setOptions:Lr,getOptions:Mr,commit:Ir,branch:Rr,merge:Or,cherryPick:_r,checkout:ar,prettyPrint:Gr,clear:Hr,getBranchesAsObjArray:Sr,getBranches:Ar,getCommits:Dr,getCommitsArray:nr,getCurrentBranch:qr,getDirection:Pr,getHead:Wr,setAccTitle:xr,getAccTitle:yr,getAccDescription:ur,setAccDescription:gr,setDiagramTitle:fr,getDiagramTitle:$r},Nr=h((r,e)=>{lr(r,e),r.dir&&e.setDirection(r.dir);for(const t of r.statements)Fr(t,e)},"populate"),Fr=h((r,e)=>{const s={Commit:h(o=>e.commit(zr(o)),"Commit"),Branch:h(o=>e.branch(Yr(o)),"Branch"),Merge:h(o=>e.merge(jr(o)),"Merge"),Checkout:h(o=>e.checkout(Ur(o)),"Checkout"),CherryPicking:h(o=>e.cherryPick(Kr(o)),"CherryPicking")}[r.$type];s?s(r):w.error(`Unknown statement type: ${r.$type}`)},"parseStatement"),zr=h(r=>({id:r.id,msg:r.message??"",type:r.type!==void 0?m[r.type]:m.NORMAL,tags:r.tags??void 0}),"parseCommit"),Yr=h(r=>({name:r.name,order:r.order??0}),"parseBranch"),jr=h(r=>({branch:r.branch,id:r.id??"",type:r.type!==void 0?m[r.type]:void 0,tags:r.tags??void 0}),"parseMerge"),Ur=h(r=>r.branch,"parseCheckout"),Kr=h(r=>({id:r.id,targetId:"",tags:r.tags?.length===0?void 0:r.tags,parent:r.parent}),"parseCherryPicking"),Vr={parse:h(async r=>{const e=await Cr("gitGraph",r);w.debug(e),Nr(e,sr)},"parse")},O=10,_=40,L=4,I=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((r,e,t=!1)=>t&&r>0?(r-1)%(e-1)+1:r%e,"calcColorIndex"),C=new Map,E=new Map,F=30,q=new Map,z=[],R=0,y="LR",Jr=h(()=>{C.clear(),E.clear(),q.clear(),R=0,z=[],y="LR"},"clear"),or=h(r=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof r=="string"?r.split(/\\n|\n|<br\s*\/?>/gi):r).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),e.appendChild(o)}),e},"drawText"),cr=h(r=>{let e,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),r.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(e=o,s=i)}),e},"findClosestParent"),Qr=h(r=>{let e="",t=1/0;return r.forEach(s=>{const o=E.get(s).y;o<=t&&(e=s,t=o)}),e||void 0},"findClosestParentBT"),Zr=h((r,e,t)=>{let s=t,o=t;const i=[];r.forEach(n=>{const a=e.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=ee(a),o=Math.max(s,o)):i.push(a),te(a,s)}),s=o,i.forEach(n=>{ae(n,s,t)}),r.forEach(n=>{const a=e.get(n);if(a?.parents.length){const l=Qr(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),re=h(r=>{const e=cr(r.parents.filter(s=>s!==null));if(!e)throw new Error(`Closest parent not found for commit ${r.id}`);const t=E.get(e)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${r.id}`);return t},"findClosestParentPos"),ee=h(r=>re(r)+_,"calculateCommitPosition"),te=h((r,e)=>{const t=C.get(r.branch);if(!t)throw new Error(`Branch not found for commit ${r.id}`);const s=t.pos,o=e+O;return E.set(r.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ae=h((r,e,t)=>{const s=C.get(r.branch);if(!s)throw new Error(`Branch not found for commit ${r.id}`);const o=e+t,i=s.pos;E.set(r.id,{x:i,y:o})},"setRootPosition"),ne=h((r,e,t,s,o,i)=>{const{theme:n}=W(),a=j.has(n??""),l=Z.has(n??""),f=Xr.has(n??"");if(i===m.HIGHLIGHT)r.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${e.id} commit-highlight${H(o,G,l)} ${s}-outer`),r.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${e.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)r.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${e.id} ${s}`),r.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${e.id} ${s}`),r.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${e.id} ${s}`),r.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${e.id} ${s}`),r.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${e.id} ${s}`);else{const g=r.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${e.id} commit${H(o,G,l)}`),i===m.MERGE){const $=r.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${e.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=r.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${e.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),se=h((r,e,t,s,o)=>{if(e.type!==m.CHERRY_PICK&&(e.customId&&e.type===m.MERGE||e.type!==m.MERGE)&&o.showCommitLabel){const i=r.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(e.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-I).attr("y",t.y+13.5).attr("width",l.width+2*I).attr("height",l.height+2*I),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),oe=h((r,e,t,s)=>{if(e.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of e.tags.reverse()){const f=r.insert("polygon"),g=r.append("circle"),$=r.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
1
+ import{p as lr}from"./chunk-4BX2VUAB-hNujwvSn.js";import{I as hr}from"./chunk-QZHKN3VN-BaWScAds.js";import{q as $r,p as fr,s as gr,g as ur,a as yr,b as xr,_ as h,E as J,l as w,c as W,u as mr,F as pr,z as br,j as B,G as wr,H as kr,I as vr}from"./mermaid.core-pHkdB6fb.js";import{p as Cr}from"./wardley-L42UT6IY-B7MIazje.js";import{s as Er}from"./vendor-reactflow-CnI7NMXG.js";import"./index-Y-vyXPPN.js";import"./vendor-react-SZ_qB27O.js";import"./vendor-i18n-GF3RlKbq.js";import"./vendor-xterm-BNq00GSj.js";import"./vendor-codemirror-jBKmHyH0.js";import"./step-yuy0qJer.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Br=kr.gitGraph,S=h(()=>wr({...Br,...J().gitGraph}),"getConfig"),d=new hr(()=>{const r=S(),e=r.mainBranchName,t=r.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:t}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function Y(){return vr({length:7})}h(Y,"getID");function tr(r,e){const t=Object.create(null);return r.reduce((s,o)=>{const i=e(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(tr,"uniqBy");var Tr=h(function(r){d.records.direction=r},"setDirection"),Lr=h(function(r){w.debug("options str",r),r=r?.trim(),r=r||"{}";try{d.records.options=JSON.parse(r)}catch(e){w.error("error while parsing gitGraph options",e.message)}},"setOptions"),Mr=h(function(){return d.records.options},"getOptions"),Ir=h(function(r){let e=r.msg,t=r.id;const s=r.type;let o=r.tags;w.info("commit",e,t,s,o),w.debug("Entering commit:",e,t,s,o);const i=S();t=B.sanitizeText(t,i),e=B.sanitizeText(e,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:e,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Rr=h(function(r){let e=r.name;const t=r.order;if(e=B.sanitizeText(e,S()),d.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);d.records.branches.set(e,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(e,{name:e,order:t}),ar(e),w.debug("in createBranch")},"branch"),Or=h(r=>{let e=r.branch,t=r.id;const s=r.type,o=r.tags,i=S();e=B.sanitizeText(e,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(e),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(d.records.currBranch===e){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},c}if(!d.records.branches.has(e)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${e} ${t} ${s} ${o?.join(" ")}`,token:`merge ${e} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${e} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${e} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_r=h(function(r){let e=r.id,t=r.targetId,s=r.tags,o=r.parent;w.debug("Entering cherryPick:",e,t,s);const i=S();if(e=B.sanitizeText(e,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!e||!d.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${t}`,token:`cherryPick ${e} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(e);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${e} ${t}`,token:`cherryPick ${e} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${e} ${t}`,token:`cherryPick ${e} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${e} ${t}`,token:`cherryPick ${e} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ar=h(function(r){if(r=B.sanitizeText(r,S()),d.records.branches.has(r)){d.records.currBranch=r;const e=d.records.branches.get(d.records.currBranch);e===void 0||!e?d.records.head=null:d.records.head=d.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${r}")`);throw e.hash={text:`checkout ${r}`,token:`checkout ${r}`,expected:[`branch ${r}`]},e}},"checkout");function V(r,e,t){const s=r.indexOf(e);s===-1?r.push(t):r.splice(s,1,t)}h(V,"upsert");function Q(r){const e=r.reduce((o,i)=>o.seq>i.seq?o:i,r[0]);let t="";r.forEach(function(o){o===e?t+=" *":t+=" |"});const s=[t,e.id,e.seq];for(const o in d.records.branches)d.records.branches.get(o)===e.id&&s.push(o);if(w.debug(s.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const o=d.records.commits.get(e.parents[0]);V(r,e,o),e.parents[1]&&r.push(d.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const o=d.records.commits.get(e.parents[0]);V(r,e,o)}}r=tr(r,o=>o.id),Q(r)}h(Q,"prettyPrintCommitHistory");var Gr=h(function(){w.debug(d.records.commits);const r=nr()[0];Q([r])},"prettyPrint"),Hr=h(function(){d.reset(),br()},"clear"),Sr=h(function(){return[...d.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Ar=h(function(){return d.records.branches},"getBranches"),Dr=h(function(){return d.records.commits},"getCommits"),nr=h(function(){const r=[...d.records.commits.values()];return r.forEach(function(e){w.debug(e.id)}),r.sort((e,t)=>e.seq-t.seq),r},"getCommitsArray"),qr=h(function(){return d.records.currBranch},"getCurrentBranch"),Pr=h(function(){return d.records.direction},"getDirection"),Wr=h(function(){return d.records.head},"getHead"),sr={commitType:m,getConfig:S,setDirection:Tr,setOptions:Lr,getOptions:Mr,commit:Ir,branch:Rr,merge:Or,cherryPick:_r,checkout:ar,prettyPrint:Gr,clear:Hr,getBranchesAsObjArray:Sr,getBranches:Ar,getCommits:Dr,getCommitsArray:nr,getCurrentBranch:qr,getDirection:Pr,getHead:Wr,setAccTitle:xr,getAccTitle:yr,getAccDescription:ur,setAccDescription:gr,setDiagramTitle:fr,getDiagramTitle:$r},Nr=h((r,e)=>{lr(r,e),r.dir&&e.setDirection(r.dir);for(const t of r.statements)Fr(t,e)},"populate"),Fr=h((r,e)=>{const s={Commit:h(o=>e.commit(zr(o)),"Commit"),Branch:h(o=>e.branch(Yr(o)),"Branch"),Merge:h(o=>e.merge(jr(o)),"Merge"),Checkout:h(o=>e.checkout(Ur(o)),"Checkout"),CherryPicking:h(o=>e.cherryPick(Kr(o)),"CherryPicking")}[r.$type];s?s(r):w.error(`Unknown statement type: ${r.$type}`)},"parseStatement"),zr=h(r=>({id:r.id,msg:r.message??"",type:r.type!==void 0?m[r.type]:m.NORMAL,tags:r.tags??void 0}),"parseCommit"),Yr=h(r=>({name:r.name,order:r.order??0}),"parseBranch"),jr=h(r=>({branch:r.branch,id:r.id??"",type:r.type!==void 0?m[r.type]:void 0,tags:r.tags??void 0}),"parseMerge"),Ur=h(r=>r.branch,"parseCheckout"),Kr=h(r=>({id:r.id,targetId:"",tags:r.tags?.length===0?void 0:r.tags,parent:r.parent}),"parseCherryPicking"),Vr={parse:h(async r=>{const e=await Cr("gitGraph",r);w.debug(e),Nr(e,sr)},"parse")},O=10,_=40,L=4,I=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((r,e,t=!1)=>t&&r>0?(r-1)%(e-1)+1:r%e,"calcColorIndex"),C=new Map,E=new Map,F=30,q=new Map,z=[],R=0,y="LR",Jr=h(()=>{C.clear(),E.clear(),q.clear(),R=0,z=[],y="LR"},"clear"),or=h(r=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof r=="string"?r.split(/\\n|\n|<br\s*\/?>/gi):r).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),e.appendChild(o)}),e},"drawText"),cr=h(r=>{let e,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),r.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(e=o,s=i)}),e},"findClosestParent"),Qr=h(r=>{let e="",t=1/0;return r.forEach(s=>{const o=E.get(s).y;o<=t&&(e=s,t=o)}),e||void 0},"findClosestParentBT"),Zr=h((r,e,t)=>{let s=t,o=t;const i=[];r.forEach(n=>{const a=e.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=ee(a),o=Math.max(s,o)):i.push(a),te(a,s)}),s=o,i.forEach(n=>{ae(n,s,t)}),r.forEach(n=>{const a=e.get(n);if(a?.parents.length){const l=Qr(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),re=h(r=>{const e=cr(r.parents.filter(s=>s!==null));if(!e)throw new Error(`Closest parent not found for commit ${r.id}`);const t=E.get(e)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${r.id}`);return t},"findClosestParentPos"),ee=h(r=>re(r)+_,"calculateCommitPosition"),te=h((r,e)=>{const t=C.get(r.branch);if(!t)throw new Error(`Branch not found for commit ${r.id}`);const s=t.pos,o=e+O;return E.set(r.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ae=h((r,e,t)=>{const s=C.get(r.branch);if(!s)throw new Error(`Branch not found for commit ${r.id}`);const o=e+t,i=s.pos;E.set(r.id,{x:i,y:o})},"setRootPosition"),ne=h((r,e,t,s,o,i)=>{const{theme:n}=W(),a=j.has(n??""),l=Z.has(n??""),f=Xr.has(n??"");if(i===m.HIGHLIGHT)r.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${e.id} commit-highlight${H(o,G,l)} ${s}-outer`),r.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${e.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)r.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${e.id} ${s}`),r.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${e.id} ${s}`),r.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${e.id} ${s}`),r.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${e.id} ${s}`),r.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${e.id} ${s}`);else{const g=r.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${e.id} commit${H(o,G,l)}`),i===m.MERGE){const $=r.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${e.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=r.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${e.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),se=h((r,e,t,s,o)=>{if(e.type!==m.CHERRY_PICK&&(e.customId&&e.type===m.MERGE||e.type!==m.MERGE)&&o.showCommitLabel){const i=r.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(e.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-I).attr("y",t.y+13.5).attr("width",l.width+2*I).attr("height",l.height+2*I),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),oe=h((r,e,t,s)=>{if(e.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of e.tags.reverse()){const f=r.insert("polygon"),g=r.append("circle"),$=r.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
2
2
  ${s-i/2-L/2},${x+I}
3
3
  ${s-i/2-L/2},${x-I}
4
4
  ${t.posWithOffset-i/2-L},${x-c-I}