@runfusion/fusion 0.74.0-beta.2 → 0.74.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/bin.js +5416 -3166
  2. package/dist/child-process-worker.js +3540 -1656
  3. package/dist/client/.vite/manifest.json +272 -272
  4. package/dist/client/assets/AgentDetailView-BGXTnuBR.js +13 -0
  5. package/dist/client/assets/AgentDetailView-CH11Ydji.css +1 -0
  6. package/dist/client/assets/{AgentPermissionPolicyEditor-BycC7HhP.js → AgentPermissionPolicyEditor-DswM202p.js} +1 -1
  7. package/dist/client/assets/AgentsView-CEpZDrmC.js +24 -0
  8. package/dist/client/assets/{ChatView-DAsZY1We.js → ChatView-BXXX0q6G.js} +3 -3
  9. package/dist/client/assets/CommandCenter-CqjN1-9X.js +97 -0
  10. package/dist/client/assets/DevServerView-BUO7JRi6.js +1 -0
  11. package/dist/client/assets/{DirectoryPicker-DsCk3Nsw.js → DirectoryPicker-CiP4h5C7.js} +1 -1
  12. package/dist/client/assets/{DocumentsView-8EI6KNBY.js → DocumentsView-DwLD0h2S.js} +1 -1
  13. package/dist/client/assets/EvalsView-C9juKffD.js +1 -0
  14. package/dist/client/assets/{ExperimentalAgentOnboardingModal-ce6DROKD.js → ExperimentalAgentOnboardingModal-DYvw9TEh.js} +1 -1
  15. package/dist/client/assets/{GoalsView-BVlTtw-u.js → GoalsView-BD1AkfVN.js} +1 -1
  16. package/dist/client/assets/{InsightsView-BKQeROkb.js → InsightsView-Q0mu759R.js} +1 -1
  17. package/dist/client/assets/{MemoryView-DCzTnxsV.js → MemoryView-DCTqPpCG.js} +1 -1
  18. package/dist/client/assets/{PiExtensionsManager-C94HwDz5.js → PiExtensionsManager-CSe_uGfa.js} +1 -1
  19. package/dist/client/assets/{PluginManager-C3DegklW.js → PluginManager-DPm8YQC0.js} +1 -1
  20. package/dist/client/assets/{PullRequestView-CrE89UL7.js → PullRequestView-BpJgNDLH.js} +2 -2
  21. package/dist/client/assets/{ReportModal-BD1ZUDdV.js → ReportModal-iGmTZqiF.js} +1 -1
  22. package/dist/client/assets/ResearchView-BfgKB-6z.js +2 -0
  23. package/dist/client/assets/{SecretsView-6qK8Idb7.js → SecretsView-CqvQLK7z.js} +1 -1
  24. package/dist/client/assets/SessionTerminal-A9di8GAo.js +2 -0
  25. package/dist/client/assets/SettingsModal-BsCUsAXe.js +21 -0
  26. package/dist/client/assets/{SettingsModal-BkOSlfyr.js → SettingsModal-D-iyPGZE.js} +1 -1
  27. package/dist/client/assets/SettingsModal-DmfMotcd.css +1 -0
  28. package/dist/client/assets/{SettingsTextareaRow-Btyx5kaR.js → SettingsTextareaRow-DwgHxMMY.js} +1 -1
  29. package/dist/client/assets/{SetupWizardModal-Blhx-dRt.js → SetupWizardModal-CrSnLN44.js} +2 -2
  30. package/dist/client/assets/{SkillsView-DGE5kYc3.js → SkillsView-C_STy7KI.js} +1 -1
  31. package/dist/client/assets/{TodoView-YSGI7ATd.js → TodoView-BJJNGNLq.js} +1 -1
  32. package/dist/client/assets/{WorkflowNodeEditor-CZiEThu2.js → WorkflowNodeEditor-Jp5i_Vxu.js} +3 -3
  33. package/dist/client/assets/{WorkflowNodeEditor-nCx4nqoL.css → WorkflowNodeEditor-sZ96V3Kd.css} +1 -1
  34. package/dist/client/assets/{agent-import-generation-DQeNZMAm.js → agent-import-generation-DbVrl8ou.js} +1 -1
  35. package/dist/client/assets/{app-Dn1u7zJ9.js → app-BYs5Cx-j.js} +2 -2
  36. package/dist/client/assets/{app-DaikOPcV.js → app-CTV8PCYh.js} +3 -3
  37. package/dist/client/assets/{app-DJIiVHdA.js → app-CwdZxrJI.js} +2 -2
  38. package/dist/client/assets/{app-hQw_x2KJ.js → app-DE-MPJxA.js} +2 -2
  39. package/dist/client/assets/{app-DxTbBEMH.js → app-e8c4wb5t.js} +2 -2
  40. package/dist/client/assets/{app-DMZ_RusZ.js → app-yKugq_Ld.js} +2 -2
  41. package/dist/client/assets/{architectureDiagram-3BPJPVTR-DhaJNKa4.js → architectureDiagram-3BPJPVTR-Ctz8GX1N.js} +1 -1
  42. package/dist/client/assets/{blockDiagram-GPEHLZMM-pKpg7gJU.js → blockDiagram-GPEHLZMM-WI_YPphw.js} +1 -1
  43. package/dist/client/assets/{c4Diagram-AAUBKEIU-DVPXKJnr.js → c4Diagram-AAUBKEIU-BLwS5Zfh.js} +1 -1
  44. package/dist/client/assets/channel-CMMrQrQu.js +1 -0
  45. package/dist/client/assets/{chunk-2J33WTMH-CHt90T5z.js → chunk-2J33WTMH-DeXlX12-.js} +1 -1
  46. package/dist/client/assets/{chunk-4BX2VUAB-DsWFYy0a.js → chunk-4BX2VUAB-zvCEraJR.js} +1 -1
  47. package/dist/client/assets/{chunk-55IACEB6-D8XiXEo8.js → chunk-55IACEB6-BgZq96DR.js} +1 -1
  48. package/dist/client/assets/{chunk-727SXJPM-DlUYBn_Y.js → chunk-727SXJPM-CayoVGXL.js} +1 -1
  49. package/dist/client/assets/{chunk-AQP2D5EJ-BSdPOr9q.js → chunk-AQP2D5EJ-BmaktpVP.js} +1 -1
  50. package/dist/client/assets/{chunk-FMBD7UC4-B9IAeBld.js → chunk-FMBD7UC4-qYWgZPF8.js} +1 -1
  51. package/dist/client/assets/{chunk-ND2GUHAM-CmxnYQrR.js → chunk-ND2GUHAM-DIovauCc.js} +1 -1
  52. package/dist/client/assets/{chunk-QZHKN3VN-Dxp6Po_j.js → chunk-QZHKN3VN-DXWnr9LE.js} +1 -1
  53. package/dist/client/assets/classDiagram-4FO5ZUOK-CqxyehbN.js +1 -0
  54. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CqxyehbN.js +1 -0
  55. package/dist/client/assets/common-13IRj_PO.js +1 -0
  56. package/dist/client/assets/common-BBynATth.js +1 -0
  57. package/dist/client/assets/common-BG-vw0tL.js +1 -0
  58. package/dist/client/assets/common-DSo46rnH.js +1 -0
  59. package/dist/client/assets/common-DbOCE-0i.js +1 -0
  60. package/dist/client/assets/common-DnXF4Jmj.js +1 -0
  61. package/dist/client/assets/{cose-bilkent-S5V4N54A-BNl3bhpS.js → cose-bilkent-S5V4N54A-Dee9mTjK.js} +1 -1
  62. package/dist/client/assets/{dagre-BM42HDAG-DFs7WCcz.js → dagre-BM42HDAG-CU-v2zoi.js} +1 -1
  63. package/dist/client/assets/{dashboard-view-DnoTcnIo.js → dashboard-view-BM790i02.js} +1 -1
  64. package/dist/client/assets/{dashboard-view-ZGxLEL9r.js → dashboard-view-CG4rzThC.js} +1 -1
  65. package/dist/client/assets/{dashboard-view-vc8kgLMs.js → dashboard-view-COary9sK.js} +1 -1
  66. package/dist/client/assets/{diagram-2AECGRRQ-C2PVozvu.js → diagram-2AECGRRQ-DIqdnJ5B.js} +1 -1
  67. package/dist/client/assets/{diagram-5GNKFQAL-DFJ5b9H8.js → diagram-5GNKFQAL-ChpdUlpb.js} +1 -1
  68. package/dist/client/assets/{diagram-KO2AKTUF-D335CW-c.js → diagram-KO2AKTUF-BxmzOp-c.js} +1 -1
  69. package/dist/client/assets/{diagram-LMA3HP47-DSfhroAW.js → diagram-LMA3HP47-DLEx-0rl.js} +1 -1
  70. package/dist/client/assets/{diagram-OG6HWLK6-8iGveM-Z.js → diagram-OG6HWLK6-DEpkJ3cG.js} +1 -1
  71. package/dist/client/assets/{erDiagram-TEJ5UH35-Xc56MEEi.js → erDiagram-TEJ5UH35-C3Rjr78a.js} +1 -1
  72. package/dist/client/assets/{flowDiagram-I6XJVG4X-DjCU9WbD.js → flowDiagram-I6XJVG4X-aPbBbeiH.js} +1 -1
  73. package/dist/client/assets/{folder-open-BRrB44UX.js → folder-open-BnNbfyzc.js} +1 -1
  74. package/dist/client/assets/{ganttDiagram-6RSMTGT7-CXQE1bea.js → ganttDiagram-6RSMTGT7-BEzAwvJ4.js} +1 -1
  75. package/dist/client/assets/{gitGraphDiagram-PVQCEYII--mrSABLC.js → gitGraphDiagram-PVQCEYII-Y4hB2swQ.js} +1 -1
  76. package/dist/client/assets/index-8wtfjIkg.js +2675 -0
  77. package/dist/client/assets/index-Bp3UBLOz.css +1 -0
  78. package/dist/client/assets/{infoDiagram-5YYISTIA-CTS_nljP.js → infoDiagram-5YYISTIA-pd3J7fRT.js} +1 -1
  79. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-CpV5x3gk.js → ishikawaDiagram-YF4QCWOH-B968vfOH.js} +1 -1
  80. package/dist/client/assets/{journeyDiagram-JHISSGLW-BK2QCMnt.js → journeyDiagram-JHISSGLW-V4crhYKX.js} +1 -1
  81. package/dist/client/assets/{kanban-definition-UN3LZRKU-B4srpspY.js → kanban-definition-UN3LZRKU-Cl8LxR6k.js} +1 -1
  82. package/dist/client/assets/{mermaid.core-B8DVAt21.js → mermaid.core-rb_bKdHH.js} +4 -4
  83. package/dist/client/assets/{mindmap-definition-RKZ34NQL-CsmmiPpA.js → mindmap-definition-RKZ34NQL-Cnu-LPHz.js} +1 -1
  84. package/dist/client/assets/{pieDiagram-4H26LBE5-BahLDqf4.js → pieDiagram-4H26LBE5-C6hPYepr.js} +1 -1
  85. package/dist/client/assets/{puzzle-BFPQsuIa.js → puzzle-C8AvcmuM.js} +1 -1
  86. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-Bo3u0wTU.js → quadrantDiagram-W4KKPZXB-CUImgAi-.js} +1 -1
  87. package/dist/client/assets/{requirementDiagram-4Y6WPE33-DYkYsz7d.js → requirementDiagram-4Y6WPE33-DzDLxIYz.js} +1 -1
  88. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-BCbh0BSY.js → sankeyDiagram-5OEKKPKP-DSr_oIy8.js} +1 -1
  89. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-C2AP9GlE.js → sequenceDiagram-3UESZ5HK-DO2E98Hv.js} +1 -1
  90. package/dist/client/assets/{shield-alert-tlZOi02c.js → shield-alert-Byjz1VmT.js} +1 -1
  91. package/dist/client/assets/{standing-instructions-template-C0Rzv9Mr.js → standing-instructions-template-Cf9fZ8bv.js} +1 -1
  92. package/dist/client/assets/{stateDiagram-AJRCARHV-CARkH0ug.js → stateDiagram-AJRCARHV-BYPlDS4u.js} +1 -1
  93. package/dist/client/assets/{stateDiagram-v2-BHNVJYJU-C2He043y.js → stateDiagram-v2-BHNVJYJU-Ce_6vh1Q.js} +1 -1
  94. package/dist/client/assets/{timeline-definition-PNZ67QCA-MvbYneEM.js → timeline-definition-PNZ67QCA-CG1FeaKV.js} +1 -1
  95. package/dist/client/assets/{upload-DWK0F17Z.js → upload-yPsE_DRN.js} +1 -1
  96. package/dist/client/assets/{users-1AkDfM14.js → users-C_YmWx9d.js} +1 -1
  97. package/dist/client/assets/{vennDiagram-CIIHVFJN-DOjzzLqc.js → vennDiagram-CIIHVFJN-JLUXqFyb.js} +1 -1
  98. package/dist/client/assets/{wardley-L42UT6IY-Di70vhu2.js → wardley-L42UT6IY-D_UBzrZ2.js} +1 -1
  99. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-nK6ARhDv.js → wardleyDiagram-YWT4CUSO-BzwMrdpL.js} +1 -1
  100. package/dist/client/assets/{xychartDiagram-2RQKCTM6-C7_y76B7.js → xychartDiagram-2RQKCTM6-C5TjbAcZ.js} +1 -1
  101. package/dist/client/index.html +2 -2
  102. package/dist/client/sw.js +633 -13
  103. package/dist/client/version.json +1 -1
  104. package/dist/extension.js +3999 -2008
  105. package/package.json +1 -1
  106. package/skill/fusion/references/engine-tools.md +1 -1
  107. package/dist/client/assets/AgentDetailView-CoeSgMXS.css +0 -1
  108. package/dist/client/assets/AgentDetailView-DH4Cn5iG.js +0 -13
  109. package/dist/client/assets/AgentsView-Dkij8Sm8.js +0 -24
  110. package/dist/client/assets/CommandCenter-jTzBo-pg.js +0 -97
  111. package/dist/client/assets/DevServerView-CxlacYJp.js +0 -1
  112. package/dist/client/assets/EvalsView-kYnaIk11.js +0 -1
  113. package/dist/client/assets/ResearchView-eMiRw1EM.js +0 -2
  114. package/dist/client/assets/SessionTerminal-DtFLyUaK.js +0 -2
  115. package/dist/client/assets/SettingsModal-BTfZlghk.css +0 -1
  116. package/dist/client/assets/SettingsModal-DSq-_qwo.js +0 -21
  117. package/dist/client/assets/channel-xFBfK0sX.js +0 -1
  118. package/dist/client/assets/classDiagram-4FO5ZUOK-BFBVD968.js +0 -1
  119. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BFBVD968.js +0 -1
  120. package/dist/client/assets/common-BDp2y6CF.js +0 -1
  121. package/dist/client/assets/common-BnEo5fLN.js +0 -1
  122. package/dist/client/assets/common-Bzr_Y8h4.js +0 -1
  123. package/dist/client/assets/common-CvwyFzfv.js +0 -1
  124. package/dist/client/assets/common-CztCXRkz.js +0 -1
  125. package/dist/client/assets/common-DPe2mbb7.js +0 -1
  126. package/dist/client/assets/index-C2xsZoNG.js +0 -2671
  127. package/dist/client/assets/index-Dv-95s50.css +0 -1
@@ -1,4 +1,4 @@
1
- import{p as lr}from"./chunk-4BX2VUAB-DsWFYy0a.js";import{I as hr}from"./chunk-QZHKN3VN-Dxp6Po_j.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-B8DVAt21.js";import{p as Cr}from"./wardley-L42UT6IY-Di70vhu2.js";import{s as Er}from"./vendor-reactflow-9C3XTE7_.js";import"./index-C2xsZoNG.js";import"./vendor-react-SZ_qB27O.js";import"./vendor-i18n-GF3RlKbq.js";import"./vendor-codemirror-jBKmHyH0.js";import"./vendor-xterm-BNq00GSj.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-zvCEraJR.js";import{I as hr}from"./chunk-QZHKN3VN-DXWnr9LE.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-rb_bKdHH.js";import{p as Cr}from"./wardley-L42UT6IY-D_UBzrZ2.js";import{s as Er}from"./vendor-reactflow-9C3XTE7_.js";import"./index-8wtfjIkg.js";import"./vendor-react-SZ_qB27O.js";import"./vendor-i18n-GF3RlKbq.js";import"./vendor-codemirror-jBKmHyH0.js";import"./vendor-xterm-BNq00GSj.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}