@render-harness/ui 0.1.1 → 0.1.3

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 (106) hide show
  1. package/dist/index.d.ts +6 -6
  2. package/dist/index.js +25 -14
  3. package/dist/index.js.map +1 -1
  4. package/dist/static/assets/{architectureDiagram-3BPJPVTR-D4589TUy.js → architectureDiagram-3BPJPVTR-DLNRxqTW.js} +2 -2
  5. package/dist/static/assets/{architectureDiagram-3BPJPVTR-D4589TUy.js.map → architectureDiagram-3BPJPVTR-DLNRxqTW.js.map} +1 -1
  6. package/dist/static/assets/{blockDiagram-GPEHLZMM-Cfjv0TRV.js → blockDiagram-GPEHLZMM-CCWTkWe6.js} +2 -2
  7. package/dist/static/assets/{blockDiagram-GPEHLZMM-Cfjv0TRV.js.map → blockDiagram-GPEHLZMM-CCWTkWe6.js.map} +1 -1
  8. package/dist/static/assets/{c4Diagram-AAUBKEIU-BoXkzmRI.js → c4Diagram-AAUBKEIU-qO0tZRXO.js} +2 -2
  9. package/dist/static/assets/{c4Diagram-AAUBKEIU-BoXkzmRI.js.map → c4Diagram-AAUBKEIU-qO0tZRXO.js.map} +1 -1
  10. package/dist/static/assets/channel-CAoVqDgM.js +2 -0
  11. package/dist/static/assets/{channel-DusP3IMn.js.map → channel-CAoVqDgM.js.map} +1 -1
  12. package/dist/static/assets/{chunk-2J33WTMH-Lf1eCW8w.js → chunk-2J33WTMH-DaEvWRZX.js} +2 -2
  13. package/dist/static/assets/{chunk-2J33WTMH-Lf1eCW8w.js.map → chunk-2J33WTMH-DaEvWRZX.js.map} +1 -1
  14. package/dist/static/assets/{chunk-3OPIFGDE-BYpEG0v0.js → chunk-3OPIFGDE-xcRWDOrg.js} +2 -2
  15. package/dist/static/assets/{chunk-3OPIFGDE-BYpEG0v0.js.map → chunk-3OPIFGDE-xcRWDOrg.js.map} +1 -1
  16. package/dist/static/assets/{chunk-5ZQYHXKU-CxDIhrF-.js → chunk-5ZQYHXKU-B_3UEJ_q.js} +2 -2
  17. package/dist/static/assets/{chunk-5ZQYHXKU-CxDIhrF-.js.map → chunk-5ZQYHXKU-B_3UEJ_q.js.map} +1 -1
  18. package/dist/static/assets/{chunk-727SXJPM-BEbDzxvV.js → chunk-727SXJPM-c1bbIj6N.js} +2 -2
  19. package/dist/static/assets/{chunk-727SXJPM-BEbDzxvV.js.map → chunk-727SXJPM-c1bbIj6N.js.map} +1 -1
  20. package/dist/static/assets/{chunk-AQP2D5EJ-DGTbQ17q.js → chunk-AQP2D5EJ-Wv0w6wvH.js} +2 -2
  21. package/dist/static/assets/{chunk-AQP2D5EJ-DGTbQ17q.js.map → chunk-AQP2D5EJ-Wv0w6wvH.js.map} +1 -1
  22. package/dist/static/assets/{chunk-CSCIHK7Q-Bo3glXo1.js → chunk-CSCIHK7Q-BBzr5U3o.js} +3 -3
  23. package/dist/static/assets/{chunk-CSCIHK7Q-Bo3glXo1.js.map → chunk-CSCIHK7Q-BBzr5U3o.js.map} +1 -1
  24. package/dist/static/assets/{chunk-KSCS5N6A-DVQpViur.js → chunk-KSCS5N6A-BZrceHGX.js} +2 -2
  25. package/dist/static/assets/{chunk-KSCS5N6A-DVQpViur.js.map → chunk-KSCS5N6A-BZrceHGX.js.map} +1 -1
  26. package/dist/static/assets/{chunk-L5ZTLDWV-BwOlshrN.js → chunk-L5ZTLDWV-BAcjEn3C.js} +2 -2
  27. package/dist/static/assets/{chunk-L5ZTLDWV-BwOlshrN.js.map → chunk-L5ZTLDWV-BAcjEn3C.js.map} +1 -1
  28. package/dist/static/assets/{chunk-ND2GUHAM-a2zgmbwP.js → chunk-ND2GUHAM-DHtjIa8_.js} +2 -2
  29. package/dist/static/assets/{chunk-ND2GUHAM-a2zgmbwP.js.map → chunk-ND2GUHAM-DHtjIa8_.js.map} +1 -1
  30. package/dist/static/assets/{chunk-NZK2D7GU-BbPAL6yn.js → chunk-NZK2D7GU-DuwDtSGJ.js} +2 -2
  31. package/dist/static/assets/{chunk-NZK2D7GU-BbPAL6yn.js.map → chunk-NZK2D7GU-DuwDtSGJ.js.map} +1 -1
  32. package/dist/static/assets/{chunk-O5CBEL6O-CM0slmy1.js → chunk-O5CBEL6O-KRO56hHQ.js} +2 -2
  33. package/dist/static/assets/{chunk-O5CBEL6O-CM0slmy1.js.map → chunk-O5CBEL6O-KRO56hHQ.js.map} +1 -1
  34. package/dist/static/assets/classDiagram-4FO5ZUOK-oexPF7ww.js +2 -0
  35. package/dist/static/assets/{classDiagram-4FO5ZUOK-SuK_oLpa.js.map → classDiagram-4FO5ZUOK-oexPF7ww.js.map} +1 -1
  36. package/dist/static/assets/classDiagram-v2-Q7XG4LA2-Dc4jeSLj.js +2 -0
  37. package/dist/static/assets/{classDiagram-v2-Q7XG4LA2-DMlc0uaN.js.map → classDiagram-v2-Q7XG4LA2-Dc4jeSLj.js.map} +1 -1
  38. package/dist/static/assets/{dagre-BM42HDAG-4I-9kC-8.js → dagre-BM42HDAG-au4dCVgC.js} +2 -2
  39. package/dist/static/assets/{dagre-BM42HDAG-4I-9kC-8.js.map → dagre-BM42HDAG-au4dCVgC.js.map} +1 -1
  40. package/dist/static/assets/{diagram-2AECGRRQ-pAKf5nK6.js → diagram-2AECGRRQ-rJMnDhBW.js} +2 -2
  41. package/dist/static/assets/{diagram-2AECGRRQ-pAKf5nK6.js.map → diagram-2AECGRRQ-rJMnDhBW.js.map} +1 -1
  42. package/dist/static/assets/{diagram-5GNKFQAL-CzKwZhm6.js → diagram-5GNKFQAL-diIxjA-v.js} +2 -2
  43. package/dist/static/assets/{diagram-5GNKFQAL-CzKwZhm6.js.map → diagram-5GNKFQAL-diIxjA-v.js.map} +1 -1
  44. package/dist/static/assets/{diagram-KO2AKTUF-BZNjYRzg.js → diagram-KO2AKTUF-D9IYocVR.js} +2 -2
  45. package/dist/static/assets/{diagram-KO2AKTUF-BZNjYRzg.js.map → diagram-KO2AKTUF-D9IYocVR.js.map} +1 -1
  46. package/dist/static/assets/{diagram-LMA3HP47-vnkpPjMC.js → diagram-LMA3HP47-BtdvpqaH.js} +2 -2
  47. package/dist/static/assets/{diagram-LMA3HP47-vnkpPjMC.js.map → diagram-LMA3HP47-BtdvpqaH.js.map} +1 -1
  48. package/dist/static/assets/{diagram-OG6HWLK6-CkBTEmTA.js → diagram-OG6HWLK6-CaRkxDoj.js} +2 -2
  49. package/dist/static/assets/{diagram-OG6HWLK6-CkBTEmTA.js.map → diagram-OG6HWLK6-CaRkxDoj.js.map} +1 -1
  50. package/dist/static/assets/{erDiagram-TEJ5UH35-DGrhtXAQ.js → erDiagram-TEJ5UH35-CgifrqeZ.js} +2 -2
  51. package/dist/static/assets/{erDiagram-TEJ5UH35-DGrhtXAQ.js.map → erDiagram-TEJ5UH35-CgifrqeZ.js.map} +1 -1
  52. package/dist/static/assets/{flowDiagram-I6XJVG4X-Cp2YiaJS.js → flowDiagram-I6XJVG4X-DaguIeM_.js} +2 -2
  53. package/dist/static/assets/{flowDiagram-I6XJVG4X-Cp2YiaJS.js.map → flowDiagram-I6XJVG4X-DaguIeM_.js.map} +1 -1
  54. package/dist/static/assets/{ganttDiagram-6RSMTGT7-C-jGZVXC.js → ganttDiagram-6RSMTGT7-DIFubQTa.js} +2 -2
  55. package/dist/static/assets/{ganttDiagram-6RSMTGT7-C-jGZVXC.js.map → ganttDiagram-6RSMTGT7-DIFubQTa.js.map} +1 -1
  56. package/dist/static/assets/{gitGraphDiagram-PVQCEYII-DDwOyc6i.js → gitGraphDiagram-PVQCEYII-Ht-SDjxh.js} +2 -2
  57. package/dist/static/assets/{gitGraphDiagram-PVQCEYII-DDwOyc6i.js.map → gitGraphDiagram-PVQCEYII-Ht-SDjxh.js.map} +1 -1
  58. package/dist/static/assets/index-D5tmHkO_.js +228 -0
  59. package/dist/static/assets/index-D5tmHkO_.js.map +1 -0
  60. package/dist/static/assets/index-luXiT-gK.css +1 -0
  61. package/dist/static/assets/{infoDiagram-5YYISTIA-B_rDp_NJ.js → infoDiagram-5YYISTIA-CwLGA7Zu.js} +2 -2
  62. package/dist/static/assets/{infoDiagram-5YYISTIA-B_rDp_NJ.js.map → infoDiagram-5YYISTIA-CwLGA7Zu.js.map} +1 -1
  63. package/dist/static/assets/{ishikawaDiagram-YF4QCWOH-ggQN-_CZ.js → ishikawaDiagram-YF4QCWOH-CaZCrUUR.js} +2 -2
  64. package/dist/static/assets/{ishikawaDiagram-YF4QCWOH-ggQN-_CZ.js.map → ishikawaDiagram-YF4QCWOH-CaZCrUUR.js.map} +1 -1
  65. package/dist/static/assets/{journeyDiagram-JHISSGLW-BjEC1jFt.js → journeyDiagram-JHISSGLW-C-j_GoJi.js} +2 -2
  66. package/dist/static/assets/{journeyDiagram-JHISSGLW-BjEC1jFt.js.map → journeyDiagram-JHISSGLW-C-j_GoJi.js.map} +1 -1
  67. package/dist/static/assets/{kanban-definition-UN3LZRKU-BVkPEFcm.js → kanban-definition-UN3LZRKU-DlYha85J.js} +2 -2
  68. package/dist/static/assets/{kanban-definition-UN3LZRKU-BVkPEFcm.js.map → kanban-definition-UN3LZRKU-DlYha85J.js.map} +1 -1
  69. package/dist/static/assets/{line-L2DeHwdZ.js → line-GCwXS1Fi.js} +2 -2
  70. package/dist/static/assets/{line-L2DeHwdZ.js.map → line-GCwXS1Fi.js.map} +1 -1
  71. package/dist/static/assets/mermaid-parser.core-BO_-QleW.js +5 -0
  72. package/dist/static/assets/{mermaid-parser.core-CZyyUBUW.js.map → mermaid-parser.core-BO_-QleW.js.map} +1 -1
  73. package/dist/static/assets/{mindmap-definition-RKZ34NQL-uf3ACEiM.js → mindmap-definition-RKZ34NQL-CPJIWJdQ.js} +2 -2
  74. package/dist/static/assets/{mindmap-definition-RKZ34NQL-uf3ACEiM.js.map → mindmap-definition-RKZ34NQL-CPJIWJdQ.js.map} +1 -1
  75. package/dist/static/assets/{pieDiagram-4H26LBE5-Dm2S6Ggt.js → pieDiagram-4H26LBE5-DTVmF_CH.js} +2 -2
  76. package/dist/static/assets/{pieDiagram-4H26LBE5-Dm2S6Ggt.js.map → pieDiagram-4H26LBE5-DTVmF_CH.js.map} +1 -1
  77. package/dist/static/assets/{quadrantDiagram-W4KKPZXB-CgiO6Q9Y.js → quadrantDiagram-W4KKPZXB-Bho6zy_y.js} +2 -2
  78. package/dist/static/assets/{quadrantDiagram-W4KKPZXB-CgiO6Q9Y.js.map → quadrantDiagram-W4KKPZXB-Bho6zy_y.js.map} +1 -1
  79. package/dist/static/assets/{requirementDiagram-4Y6WPE33-BFL5yKh2.js → requirementDiagram-4Y6WPE33-CLyoVwlh.js} +2 -2
  80. package/dist/static/assets/{requirementDiagram-4Y6WPE33-BFL5yKh2.js.map → requirementDiagram-4Y6WPE33-CLyoVwlh.js.map} +1 -1
  81. package/dist/static/assets/{sankeyDiagram-5OEKKPKP-DNSdTx8o.js → sankeyDiagram-5OEKKPKP-V2yvk-0Z.js} +2 -2
  82. package/dist/static/assets/{sankeyDiagram-5OEKKPKP-DNSdTx8o.js.map → sankeyDiagram-5OEKKPKP-V2yvk-0Z.js.map} +1 -1
  83. package/dist/static/assets/{sequenceDiagram-3UESZ5HK-BMNloRY9.js → sequenceDiagram-3UESZ5HK-Dp03aXVk.js} +2 -2
  84. package/dist/static/assets/{sequenceDiagram-3UESZ5HK-BMNloRY9.js.map → sequenceDiagram-3UESZ5HK-Dp03aXVk.js.map} +1 -1
  85. package/dist/static/assets/{stateDiagram-AJRCARHV-B1fkBSkt.js → stateDiagram-AJRCARHV-BEJW-_HK.js} +2 -2
  86. package/dist/static/assets/{stateDiagram-AJRCARHV-B1fkBSkt.js.map → stateDiagram-AJRCARHV-BEJW-_HK.js.map} +1 -1
  87. package/dist/static/assets/stateDiagram-v2-BHNVJYJU-Bo19-vKE.js +2 -0
  88. package/dist/static/assets/{stateDiagram-v2-BHNVJYJU-Fm1RY0qD.js.map → stateDiagram-v2-BHNVJYJU-Bo19-vKE.js.map} +1 -1
  89. package/dist/static/assets/{timeline-definition-PNZ67QCA-CdNdPzQU.js → timeline-definition-PNZ67QCA-C4KTq0mQ.js} +2 -2
  90. package/dist/static/assets/{timeline-definition-PNZ67QCA-CdNdPzQU.js.map → timeline-definition-PNZ67QCA-C4KTq0mQ.js.map} +1 -1
  91. package/dist/static/assets/{vennDiagram-CIIHVFJN-Cfr9Kji9.js → vennDiagram-CIIHVFJN-1jmBZPSZ.js} +2 -2
  92. package/dist/static/assets/{vennDiagram-CIIHVFJN-Cfr9Kji9.js.map → vennDiagram-CIIHVFJN-1jmBZPSZ.js.map} +1 -1
  93. package/dist/static/assets/{wardleyDiagram-YWT4CUSO-BU30t5hg.js → wardleyDiagram-YWT4CUSO-A8XYzYTW.js} +2 -2
  94. package/dist/static/assets/{wardleyDiagram-YWT4CUSO-BU30t5hg.js.map → wardleyDiagram-YWT4CUSO-A8XYzYTW.js.map} +1 -1
  95. package/dist/static/assets/{xychartDiagram-2RQKCTM6-CbAQZMXv.js → xychartDiagram-2RQKCTM6-CuyUQvFt.js} +2 -2
  96. package/dist/static/assets/{xychartDiagram-2RQKCTM6-CbAQZMXv.js.map → xychartDiagram-2RQKCTM6-CuyUQvFt.js.map} +1 -1
  97. package/dist/static/index.html +16 -16
  98. package/package.json +14 -14
  99. package/dist/static/assets/channel-DusP3IMn.js +0 -2
  100. package/dist/static/assets/classDiagram-4FO5ZUOK-SuK_oLpa.js +0 -2
  101. package/dist/static/assets/classDiagram-v2-Q7XG4LA2-DMlc0uaN.js +0 -2
  102. package/dist/static/assets/index-BfPuPCFp.js +0 -228
  103. package/dist/static/assets/index-BfPuPCFp.js.map +0 -1
  104. package/dist/static/assets/index-CyEgx13R.css +0 -1
  105. package/dist/static/assets/mermaid-parser.core-CZyyUBUW.js +0 -5
  106. package/dist/static/assets/stateDiagram-v2-BHNVJYJU-Fm1RY0qD.js +0 -2
@@ -1,4 +1,4 @@
1
- import{g as e,h as t}from"./src-DoMhBUqV.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,v as l,w as u,x as d,y as f}from"./chunk-CSCIHK7Q-Bo3glXo1.js";import{i as p}from"./chunk-5ZQYHXKU-CxDIhrF-.js";import{a as m}from"./index-BfPuPCFp.js";import{t as h}from"./chunk-4BX2VUAB-BqYEJTr3.js";import{t as g}from"./mermaid-parser.core-CZyyUBUW.js";var _=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=t((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=t((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:t(async t=>{let n=await g(`wardley`,t);e.debug(n);let r=S.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);x(n,r)},`parse`)},C=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function w(){return d()[`wardley-beta`]}t(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}t(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}t(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}t(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}t(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}t(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}t(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}t(N,`setSize`);function P(e){C.startPipeline(e)}t(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}t(F,`addPipelineComponent`);function I(e){C.setAxes(e)}t(I,`updateAxes`);function L(e){return C.getNode(e)}t(L,`getNode`);function R(e){return C.resolveNodeId(e)}t(R,`resolveNodeId`);function z(){return C.build()}t(z,`getWardleyData`);function B(){C.clear(),o()}t(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:u,getAccDescription:l,setAccDescription:r},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=t(()=>{let{themeVariables:e}=d();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=t(()=>{let e=d()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
1
+ import{g as e,h as t}from"./src-DoMhBUqV.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,v as l,w as u,x as d,y as f}from"./chunk-CSCIHK7Q-BBzr5U3o.js";import{i as p}from"./chunk-5ZQYHXKU-B_3UEJ_q.js";import{a as m}from"./index-D5tmHkO_.js";import{t as h}from"./chunk-4BX2VUAB-BqYEJTr3.js";import{t as g}from"./mermaid-parser.core-BO_-QleW.js";var _=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=t((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=t((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:t(async t=>{let n=await g(`wardley`,t);e.debug(n);let r=S.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);x(n,r)},`parse`)},C=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function w(){return d()[`wardley-beta`]}t(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}t(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}t(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}t(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}t(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}t(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}t(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}t(N,`setSize`);function P(e){C.startPipeline(e)}t(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}t(F,`addPipelineComponent`);function I(e){C.setAxes(e)}t(I,`updateAxes`);function L(e){return C.getNode(e)}t(L,`getNode`);function R(e){return C.resolveNodeId(e)}t(R,`resolveNodeId`);function z(){return C.build()}t(z,`getWardleyData`);function B(){C.clear(),o()}t(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:u,getAccDescription:l,setAccDescription:r},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=t(()=>{let{themeVariables:e}=d();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=t(()=>{let e=d()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
2
2
  `+n);let o=W(),s=U(),l=o.nodeRadius*1.6,u=a.db,d=u.getWardleyData(),f=u.getDiagramTitle(),p=d.size?.width??o.width,h=d.size?.height??o.height,g=m(r);g.selectAll(`*`).remove(),c(g,h,p,o.useMaxWidth),g.attr(`viewBox`,`0 0 ${p} ${h}`);let _=g.append(`g`).attr(`class`,`wardley-map`),v=g.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,p).attr(`height`,h).attr(`fill`,s.backgroundColor);let y=p-o.padding*2,b=h-o.padding*2;f&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,p/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let x=t(e=>o.padding+e/100*y,`projectX`),S=t(e=>h-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,h-o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,h-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:H;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,h-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,h-o.padding-b*n).attr(`y2`,h-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,c=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),c=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=c-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-l/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-l/2).attr(`y`,e=>D.get(e.id).y-l/2).attr(`width`,l).attr(`height`,l).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=p-o.padding-l,m=o.padding,g=h-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(m,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
3
3
  M ${n} ${r-30/2}
4
4
  L ${n+60-20} ${r-30/2}
@@ -76,4 +76,4 @@ import{g as e,h as t}from"./src-DoMhBUqV.js";import{D as n,H as r,K as i,U as a,
76
76
  fill: ${t.axisTextColor};
77
77
  }
78
78
  `},`styles`)};export{G as diagram};
79
- //# sourceMappingURL=wardleyDiagram-YWT4CUSO-BU30t5hg.js.map
79
+ //# sourceMappingURL=wardleyDiagram-YWT4CUSO-A8XYzYTW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wardleyDiagram-YWT4CUSO-BU30t5hg.js","names":["getThemeVariables"],"sources":["../../../../../node_modules/.pnpm/mermaid@11.15.0/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-YWT4CUSO.mjs"],"sourcesContent":["import {\n selectSvgElement\n} from \"./chunk-WU5MYG2G.mjs\";\nimport {\n populateCommonDb\n} from \"./chunk-4BX2VUAB.mjs\";\nimport {\n cleanAndMerge\n} from \"./chunk-5ZQYHXKU.mjs\";\nimport {\n clear,\n configureSvgSize,\n getAccDescription,\n getAccTitle,\n getConfig,\n getConfig2,\n getDiagramTitle,\n getThemeVariables,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-CSCIHK7Q.mjs\";\nimport {\n __name,\n log\n} from \"./chunk-AGHRB4JF.mjs\";\n\n// src/diagrams/wardley/wardleyParser.ts\nimport { parse } from \"@mermaid-js/parser\";\nvar toPercent = /* @__PURE__ */ __name((value, context) => {\n const normalized = value <= 1 ? value * 100 : value;\n if (normalized < 0 || normalized > 100) {\n throw new Error(\n `${context} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${value}`\n );\n }\n return normalized;\n}, \"toPercent\");\nvar toCoordinates = /* @__PURE__ */ __name((visibility, evolution, context) => {\n return {\n x: toPercent(evolution, `${context} evolution`),\n y: toPercent(visibility, `${context} visibility`)\n };\n}, \"toCoordinates\");\nvar getFlowFromPort = /* @__PURE__ */ __name((port) => {\n if (!port) {\n return void 0;\n }\n if (port === \"+<>\") {\n return \"bidirectional\";\n }\n if (port === \"+<\") {\n return \"backward\";\n }\n if (port === \"+>\") {\n return \"forward\";\n }\n return void 0;\n}, \"getFlowFromPort\");\nvar extractFlowFromArrow = /* @__PURE__ */ __name((arrow) => {\n if (!arrow?.startsWith(\"+\")) {\n return {};\n }\n const labelMatch = /^\\+'([^']*)'/.exec(arrow);\n const flowLabel = labelMatch?.[1];\n if (arrow.includes(\"<>\")) {\n return { flow: \"bidirectional\", label: flowLabel };\n }\n if (arrow.includes(\"<\")) {\n return { flow: \"backward\", label: flowLabel };\n }\n if (arrow.includes(\">\")) {\n return { flow: \"forward\", label: flowLabel };\n }\n return { label: flowLabel };\n}, \"extractFlowFromArrow\");\nvar populateDb = /* @__PURE__ */ __name((ast, db) => {\n populateCommonDb(ast, db);\n if (ast.size) {\n db.setSize(ast.size.width, ast.size.height);\n }\n if (ast.evolution) {\n const stages = ast.evolution.stages.map((stage) => {\n if (stage.secondName) {\n return `${stage.name.trim()} / ${stage.secondName.trim()}`;\n }\n return stage.name.trim();\n });\n const stageBoundaries = ast.evolution.stages.filter((stage) => stage.boundary !== void 0).map((stage) => stage.boundary);\n db.updateAxes({ stages, stageBoundaries });\n }\n ast.anchors.forEach((anchor) => {\n const coords = toCoordinates(anchor.visibility, anchor.evolution, `Anchor \"${anchor.name}\"`);\n db.addNode(anchor.name, anchor.name, coords.x, coords.y, \"anchor\");\n });\n ast.components.forEach((component) => {\n const coords = toCoordinates(\n component.visibility,\n component.evolution,\n `Component \"${component.name}\"`\n );\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const sourceStrategy = component.decorator?.strategy;\n db.addNode(\n component.name,\n component.name,\n coords.x,\n coords.y,\n \"component\",\n labelOffsetX,\n labelOffsetY,\n component.inertia,\n sourceStrategy\n );\n });\n ast.notes.forEach((note) => {\n const coords = toCoordinates(note.visibility, note.evolution, `Note \"${note.text}\"`);\n db.addNote(note.text, coords.x, coords.y);\n });\n ast.pipelines.forEach((pipeline) => {\n const parentNode = db.getNode(pipeline.parent);\n if (!parentNode || typeof parentNode.y !== \"number\") {\n throw new Error(\n `Pipeline \"${pipeline.parent}\" must reference an existing component with coordinates.`\n );\n }\n const parentY = parentNode.y;\n db.startPipeline(pipeline.parent);\n pipeline.components.forEach((component) => {\n const componentId = `${pipeline.parent}_${component.name}`;\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const x = toPercent(component.evolution, `Pipeline component \"${component.name}\" evolution`);\n db.addNode(\n componentId,\n component.name,\n x,\n parentY,\n \"pipeline-component\",\n labelOffsetX,\n labelOffsetY\n );\n db.addPipelineComponent(pipeline.parent, componentId);\n });\n });\n ast.links.forEach((link) => {\n const isDashed = !!link.arrow && (link.arrow.includes(\"-.->\") || link.arrow.includes(\".-.\"));\n let flow = getFlowFromPort(link.fromPort) ?? getFlowFromPort(link.toPort);\n const { flow: arrowFlow, label: flowLabel } = extractFlowFromArrow(link.arrow);\n if (!flow && arrowFlow) {\n flow = arrowFlow;\n }\n const annotation = link.linkLabel;\n const label = flowLabel ?? annotation;\n db.addLink(db.resolveNodeId(link.from), db.resolveNodeId(link.to), isDashed, label, flow);\n });\n ast.evolves.forEach((evolve) => {\n const node = db.getNode(evolve.component);\n if (node?.y !== void 0) {\n const target = toPercent(evolve.target, `Evolve target for \"${evolve.component}\"`);\n db.addTrend(evolve.component, target, node.y);\n }\n });\n if (ast.annotations.length > 0) {\n const annotationsBox = ast.annotations[0];\n const coords = toCoordinates(annotationsBox.x, annotationsBox.y, \"Annotations box\");\n db.setAnnotationsBox(coords.x, coords.y);\n }\n ast.annotation.forEach((annotation) => {\n const coords = toCoordinates(annotation.x, annotation.y, `Annotation ${annotation.number}`);\n db.addAnnotation(annotation.number, [{ x: coords.x, y: coords.y }], annotation.text);\n });\n ast.accelerators.forEach((accelerator) => {\n const coords = toCoordinates(accelerator.x, accelerator.y, `Accelerator \"${accelerator.name}\"`);\n db.addAccelerator(accelerator.name, coords.x, coords.y);\n });\n ast.deaccelerators.forEach((deaccelerator) => {\n const coords = toCoordinates(\n deaccelerator.x,\n deaccelerator.y,\n `Deaccelerator \"${deaccelerator.name}\"`\n );\n db.addDeaccelerator(deaccelerator.name, coords.x, coords.y);\n });\n}, \"populateDb\");\nvar parser = {\n parser: {\n // @ts-expect-error - WardleyDB is not assignable to DiagramDB\n yy: void 0\n },\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"wardley\", input);\n log.debug(ast);\n const db = parser.parser?.yy;\n if (!db || typeof db.addNode !== \"function\") {\n throw new Error(\n \"parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.\"\n );\n }\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/wardley/wardleyBuilder.ts\nvar WardleyBuilder = class {\n constructor() {\n this.nodes = /* @__PURE__ */ new Map();\n this.links = [];\n this.trends = /* @__PURE__ */ new Map();\n this.pipelines = /* @__PURE__ */ new Map();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.axes = {};\n }\n static {\n __name(this, \"WardleyBuilder\");\n }\n addNode(node) {\n const existing = this.nodes.get(node.id) ?? { id: node.id, label: node.label };\n const merged = {\n ...existing,\n ...node,\n className: node.className ?? existing.className,\n labelOffsetX: node.labelOffsetX ?? existing.labelOffsetX,\n labelOffsetY: node.labelOffsetY ?? existing.labelOffsetY\n };\n this.nodes.set(node.id, merged);\n }\n addLink(link) {\n this.links.push(link);\n }\n addTrend(trend) {\n this.trends.set(trend.nodeId, trend);\n }\n startPipeline(nodeId) {\n this.pipelines.set(nodeId, { nodeId, componentIds: [] });\n const node = this.nodes.get(nodeId);\n if (node) {\n node.isPipelineParent = true;\n }\n }\n addPipelineComponent(pipelineNodeId, componentId) {\n const pipeline = this.pipelines.get(pipelineNodeId);\n if (pipeline) {\n pipeline.componentIds.push(componentId);\n }\n const node = this.nodes.get(componentId);\n if (node) {\n node.inPipeline = true;\n }\n }\n addAnnotation(annotation) {\n this.annotations.push(annotation);\n }\n addNote(note) {\n this.notes.push(note);\n }\n addAccelerator(accelerator) {\n this.accelerators.push(accelerator);\n }\n addDeaccelerator(deaccelerator) {\n this.deaccelerators.push(deaccelerator);\n }\n setAnnotationsBox(x, y) {\n this.annotationsBox = { x, y };\n }\n setAxes(partial) {\n this.axes = {\n ...this.axes,\n ...partial\n };\n }\n setSize(width, height) {\n this.size = { width, height };\n }\n getNode(id) {\n return this.nodes.get(id);\n }\n /**\n * Resolve a name to a node ID. Tries exact ID match first,\n * then falls back to finding a node whose label matches the name\n * (handles pipeline components which have synthetic IDs like \"Parent_Child\").\n */\n resolveNodeId(name) {\n if (this.nodes.has(name)) {\n return name;\n }\n for (const [id, node] of this.nodes) {\n if (node.label === name) {\n return id;\n }\n }\n return name;\n }\n build() {\n const nodes = [];\n for (const node of this.nodes.values()) {\n if (typeof node.x !== \"number\" || typeof node.y !== \"number\") {\n throw new Error(`Node \"${node.label}\" is missing coordinates`);\n }\n nodes.push(node);\n }\n return {\n nodes,\n links: [...this.links],\n trends: [...this.trends.values()],\n pipelines: [...this.pipelines.values()],\n annotations: [...this.annotations],\n notes: [...this.notes],\n accelerators: [...this.accelerators],\n deaccelerators: [...this.deaccelerators],\n annotationsBox: this.annotationsBox,\n axes: { ...this.axes },\n size: this.size\n };\n }\n clear() {\n this.nodes.clear();\n this.links = [];\n this.trends.clear();\n this.pipelines.clear();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.annotationsBox = void 0;\n this.axes = {};\n this.size = void 0;\n }\n};\n\n// src/diagrams/wardley/wardleyDb.ts\nvar builder = new WardleyBuilder();\nfunction getConfig3() {\n return getConfig2()[\"wardley-beta\"];\n}\n__name(getConfig3, \"getConfig\");\nfunction addNode(id, label, x, y, className, labelOffsetX, labelOffsetY, inertia, sourceStrategy) {\n builder.addNode({\n id,\n label,\n x,\n y,\n className,\n labelOffsetX,\n labelOffsetY,\n inertia,\n sourceStrategy\n });\n}\n__name(addNode, \"addNode\");\nfunction addLink(sourceId, targetId, dashed = false, label, flow) {\n builder.addLink({\n source: sourceId,\n target: targetId,\n dashed,\n label,\n flow\n });\n}\n__name(addLink, \"addLink\");\nfunction addTrend(nodeId, targetX, targetY) {\n builder.addTrend({ nodeId, targetX, targetY });\n}\n__name(addTrend, \"addTrend\");\nfunction addAnnotation(number, coordinates, text) {\n builder.addAnnotation({\n number,\n coordinates,\n text\n });\n}\n__name(addAnnotation, \"addAnnotation\");\nfunction addNote(text, x, y) {\n builder.addNote({\n text,\n x,\n y\n });\n}\n__name(addNote, \"addNote\");\nfunction addAccelerator(name, x, y) {\n builder.addAccelerator({\n name,\n x,\n y\n });\n}\n__name(addAccelerator, \"addAccelerator\");\nfunction addDeaccelerator(name, x, y) {\n builder.addDeaccelerator({\n name,\n x,\n y\n });\n}\n__name(addDeaccelerator, \"addDeaccelerator\");\nfunction setAnnotationsBox(x, y) {\n builder.setAnnotationsBox(x, y);\n}\n__name(setAnnotationsBox, \"setAnnotationsBox\");\nfunction setSize(width, height) {\n builder.setSize(width, height);\n}\n__name(setSize, \"setSize\");\nfunction startPipeline(nodeId) {\n builder.startPipeline(nodeId);\n}\n__name(startPipeline, \"startPipeline\");\nfunction addPipelineComponent(pipelineNodeId, componentId) {\n builder.addPipelineComponent(pipelineNodeId, componentId);\n}\n__name(addPipelineComponent, \"addPipelineComponent\");\nfunction updateAxes(partial) {\n builder.setAxes(partial);\n}\n__name(updateAxes, \"updateAxes\");\nfunction getNode(id) {\n return builder.getNode(id);\n}\n__name(getNode, \"getNode\");\nfunction resolveNodeId(name) {\n return builder.resolveNodeId(name);\n}\n__name(resolveNodeId, \"resolveNodeId\");\nfunction getWardleyData() {\n return builder.build();\n}\n__name(getWardleyData, \"getWardleyData\");\nfunction clear2() {\n builder.clear();\n clear();\n}\n__name(clear2, \"clear\");\nvar wardleyDb_default = {\n getConfig: getConfig3,\n addNode,\n addLink,\n addTrend,\n addAnnotation,\n addNote,\n addAccelerator,\n addDeaccelerator,\n setAnnotationsBox,\n setSize,\n startPipeline,\n addPipelineComponent,\n updateAxes,\n getNode,\n resolveNodeId,\n getWardleyData,\n clear: clear2,\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle,\n getAccDescription,\n setAccDescription\n};\n\n// src/diagrams/wardley/wardleyRenderer.ts\nvar DEFAULT_STAGES = [\"Genesis\", \"Custom Built\", \"Product\", \"Commodity\"];\nvar getTheme = /* @__PURE__ */ __name(() => {\n const { themeVariables } = getConfig2();\n return {\n backgroundColor: themeVariables.wardley?.backgroundColor ?? themeVariables.background ?? \"#fff\",\n axisColor: themeVariables.wardley?.axisColor ?? \"#000\",\n axisTextColor: themeVariables.wardley?.axisTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n gridColor: themeVariables.wardley?.gridColor ?? \"rgba(100, 100, 100, 0.2)\",\n componentFill: themeVariables.wardley?.componentFill ?? \"#fff\",\n componentStroke: themeVariables.wardley?.componentStroke ?? \"#000\",\n componentLabelColor: themeVariables.wardley?.componentLabelColor ?? themeVariables.primaryTextColor ?? \"#222\",\n linkStroke: themeVariables.wardley?.linkStroke ?? \"#000\",\n evolutionStroke: themeVariables.wardley?.evolutionStroke ?? \"#dc3545\",\n annotationStroke: themeVariables.wardley?.annotationStroke ?? \"#000\",\n annotationTextColor: themeVariables.wardley?.annotationTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n annotationFill: themeVariables.wardley?.annotationFill ?? themeVariables.background ?? \"#fff\"\n };\n}, \"getTheme\");\nvar getConfigValues = /* @__PURE__ */ __name(() => {\n const wardleyConfig = getConfig2()[\"wardley-beta\"];\n return {\n width: wardleyConfig?.width ?? 900,\n height: wardleyConfig?.height ?? 600,\n padding: wardleyConfig?.padding ?? 48,\n nodeRadius: wardleyConfig?.nodeRadius ?? 6,\n nodeLabelOffset: wardleyConfig?.nodeLabelOffset ?? 8,\n axisFontSize: wardleyConfig?.axisFontSize ?? 12,\n labelFontSize: wardleyConfig?.labelFontSize ?? 10,\n showGrid: wardleyConfig?.showGrid ?? false,\n useMaxWidth: wardleyConfig?.useMaxWidth ?? true\n };\n}, \"getConfigValues\");\nvar draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {\n log.debug(\"Rendering Wardley map\\n\" + text);\n const configValues = getConfigValues();\n const theme = getTheme();\n const squareSize = configValues.nodeRadius * 1.6;\n const db = diagObj.db;\n const data = db.getWardleyData();\n const title = db.getDiagramTitle();\n const width = data.size?.width ?? configValues.width;\n const height = data.size?.height ?? configValues.height;\n const svg = selectSvgElement(id);\n svg.selectAll(\"*\").remove();\n configureSvgSize(svg, height, width, configValues.useMaxWidth);\n svg.attr(\"viewBox\", `0 0 ${width} ${height}`);\n const root = svg.append(\"g\").attr(\"class\", \"wardley-map\");\n const defs = svg.append(\"defs\");\n defs.append(\"marker\").attr(\"id\", `arrow-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 6).attr(\"markerHeight\", 6).attr(\"orient\", \"auto-start-reverse\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.evolutionStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-end-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-start-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 1).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 10 0 L 0 5 L 10 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n root.append(\"rect\").attr(\"class\", \"wardley-background\").attr(\"width\", width).attr(\"height\", height).attr(\"fill\", theme.backgroundColor);\n const chartWidth = width - configValues.padding * 2;\n const chartHeight = height - configValues.padding * 2;\n if (title) {\n root.append(\"text\").attr(\"class\", \"wardley-title\").attr(\"x\", width / 2).attr(\"y\", configValues.padding / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize * 1.05).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(title);\n }\n const projectX = /* @__PURE__ */ __name((value) => configValues.padding + value / 100 * chartWidth, \"projectX\");\n const projectY = /* @__PURE__ */ __name((value) => height - configValues.padding - value / 100 * chartHeight, \"projectY\");\n const axisGroup = root.append(\"g\").attr(\"class\", \"wardley-axes\");\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", configValues.padding).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n const xLabel = data.axes.xLabel ?? \"Evolution\";\n const yLabel = data.axes.yLabel ?? \"Visibility\";\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-x\").attr(\"x\", configValues.padding + chartWidth / 2).attr(\"y\", height - configValues.padding / 4).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").text(xLabel);\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-y\").attr(\"x\", configValues.padding / 3).attr(\"y\", configValues.padding + chartHeight / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\n \"transform\",\n `rotate(-90 ${configValues.padding / 3} ${configValues.padding + chartHeight / 2})`\n ).text(yLabel);\n const stages = data.axes.stages && data.axes.stages.length > 0 ? data.axes.stages : DEFAULT_STAGES;\n if (stages.length > 0) {\n const stageGroup = root.append(\"g\").attr(\"class\", \"wardley-stages\");\n const boundaries = data.axes.stageBoundaries;\n const stagePositions = [];\n if (boundaries && boundaries.length === stages.length) {\n let prevBoundary = 0;\n boundaries.forEach((boundary) => {\n stagePositions.push({ start: prevBoundary, end: boundary });\n prevBoundary = boundary;\n });\n } else {\n const stageWidth = 1 / stages.length;\n stages.forEach((_, index) => {\n stagePositions.push({\n start: index * stageWidth,\n end: (index + 1) * stageWidth\n });\n });\n }\n stages.forEach((stage, index) => {\n const pos = stagePositions[index];\n const startX = configValues.padding + pos.start * chartWidth;\n const endX = configValues.padding + pos.end * chartWidth;\n const centerX = (startX + endX) / 2;\n if (index > 0) {\n stageGroup.append(\"line\").attr(\"x1\", startX).attr(\"x2\", startX).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"5 5\").attr(\"opacity\", 0.8);\n }\n stageGroup.append(\"text\").attr(\"class\", \"wardley-stage-label\").attr(\"x\", centerX).attr(\"y\", height - configValues.padding / 1.5).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize - 2).attr(\"text-anchor\", \"middle\").text(stage);\n });\n }\n if (configValues.showGrid) {\n const gridGroup = root.append(\"g\").attr(\"class\", \"wardley-grid\");\n for (let i = 1; i < 4; i++) {\n const ratio = i / 4;\n const x = configValues.padding + chartWidth * ratio;\n gridGroup.append(\"line\").attr(\"x1\", x).attr(\"x2\", x).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n gridGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding - chartHeight * ratio).attr(\"y2\", height - configValues.padding - chartHeight * ratio).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n }\n }\n const positions = /* @__PURE__ */ new Map();\n data.nodes.forEach((node) => {\n positions.set(node.id, {\n x: projectX(node.x),\n y: projectY(node.y),\n node\n });\n });\n if (data.pipelines.length > 0) {\n const pipelineGroup = root.append(\"g\").attr(\"class\", \"wardley-pipelines\");\n const pipelineLinksGroup = root.append(\"g\").attr(\"class\", \"wardley-pipeline-links\");\n data.pipelines.forEach((pipeline) => {\n if (pipeline.componentIds.length === 0) {\n return;\n }\n const sortedComponents = pipeline.componentIds.map((id2) => ({ id: id2, pos: positions.get(id2), node: data.nodes.find((n) => n.id === id2) })).filter((c) => c.pos && c.node).sort((a, b) => a.node.x - b.node.x);\n for (let i = 0; i < sortedComponents.length - 1; i++) {\n const current = sortedComponents[i];\n const next = sortedComponents[i + 1];\n pipelineLinksGroup.append(\"line\").attr(\"class\", \"wardley-pipeline-evolution-link\").attr(\"x1\", current.pos.x).attr(\"y1\", current.pos.y).attr(\"x2\", next.pos.x).attr(\"y2\", next.pos.y).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\");\n }\n let minX = Infinity;\n let maxX = -Infinity;\n let y = 0;\n pipeline.componentIds.forEach((componentId) => {\n const pos = positions.get(componentId);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x);\n y = pos.y;\n }\n });\n if (minX !== Infinity && maxX !== -Infinity) {\n const padding = 15;\n const height2 = configValues.nodeRadius * 4;\n const boxTop = y - height2 / 2;\n const parentPos = positions.get(pipeline.nodeId);\n if (parentPos) {\n const centerX = (minX + maxX) / 2;\n parentPos.x = centerX;\n parentPos.y = boxTop - squareSize / 6;\n }\n pipelineGroup.append(\"rect\").attr(\"class\", \"wardley-pipeline-box\").attr(\"x\", minX - padding).attr(\"y\", boxTop).attr(\"width\", maxX - minX + padding * 2).attr(\"height\", height2).attr(\"fill\", \"none\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n });\n }\n const linksGroup = root.append(\"g\").attr(\"class\", \"wardley-links\");\n const pipelineMap = /* @__PURE__ */ new Map();\n data.pipelines.forEach((pipeline) => {\n pipelineMap.set(pipeline.nodeId, new Set(pipeline.componentIds));\n });\n const validLinks = data.links.filter((link) => {\n if (!positions.has(link.source) || !positions.has(link.target)) {\n return false;\n }\n const pipelineComponents = pipelineMap.get(link.target);\n if (pipelineComponents?.has(link.source)) {\n return false;\n }\n return true;\n });\n linksGroup.selectAll(\"line\").data(validLinks).enter().append(\"line\").attr(\"class\", (link) => `wardley-link${link.dashed ? \" wardley-link--dashed\" : \"\"}`).attr(\"x1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.x + dx / distance * radius;\n }).attr(\"y1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.y + dy / distance * radius;\n }).attr(\"x2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.x + dx / distance * radius;\n }).attr(\"y2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.y + dy / distance * radius;\n }).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", (link) => link.dashed ? \"6 6\" : null).attr(\"marker-end\", (link) => {\n if (link.flow === \"forward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-end-${id})`;\n }\n return null;\n }).attr(\"marker-start\", (link) => {\n if (link.flow === \"backward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-start-${id})`;\n }\n return null;\n });\n linksGroup.selectAll(\"text\").data(validLinks.filter((link) => link.label)).enter().append(\"text\").attr(\"class\", \"wardley-link-label\").attr(\"x\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const dy = targetPos.y - sourcePos.y;\n const dx = targetPos.x - sourcePos.x;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n return midX + perpX * offset;\n }).attr(\"y\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpY = -dx / distance;\n return midY + perpY * offset;\n }).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.labelFontSize).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").attr(\"transform\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n const perpY = -dx / distance;\n const labelX = midX + perpX * offset;\n const labelY = midY + perpY * offset;\n let angle = Math.atan2(dy, dx) * 180 / Math.PI;\n if (angle > 90 || angle < -90) {\n angle += 180;\n }\n return `rotate(${angle} ${labelX} ${labelY})`;\n }).text((link) => link.label);\n const trendGroup = root.append(\"g\").attr(\"class\", \"wardley-trends\");\n const trendsWithPositions = data.trends.map((trend) => {\n const origin = positions.get(trend.nodeId);\n if (!origin) {\n return null;\n }\n const targetX = projectX(trend.targetX);\n const targetY = projectY(trend.targetY);\n const dx = targetX - origin.x;\n const dy = targetY - origin.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const shortenBy = configValues.nodeRadius + 2;\n const adjustedX2 = distance > shortenBy ? targetX - dx / distance * shortenBy : targetX;\n const adjustedY2 = distance > shortenBy ? targetY - dy / distance * shortenBy : targetY;\n return {\n origin,\n targetX,\n targetY,\n adjustedX2,\n adjustedY2\n };\n }).filter((trend) => trend !== null);\n trendGroup.selectAll(\"line\").data(trendsWithPositions).enter().append(\"line\").attr(\"class\", \"wardley-trend\").attr(\"x1\", (trend) => trend.origin.x).attr(\"y1\", (trend) => trend.origin.y).attr(\"x2\", (trend) => trend.adjustedX2).attr(\"y2\", (trend) => trend.adjustedY2).attr(\"stroke\", theme.evolutionStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\").attr(\"marker-end\", `url(#arrow-${id})`);\n const nodesGroup = root.append(\"g\").attr(\"class\", \"wardley-nodes\");\n const nodeEnter = nodesGroup.selectAll(\"g\").data(data.nodes).enter().append(\"g\").attr(\n \"class\",\n (node) => [\"wardley-node\", node.className ? `wardley-node--${node.className}` : \"\"].filter(Boolean).join(\" \")\n );\n nodeEnter.filter((node) => node.sourceStrategy === \"outsource\").append(\"circle\").attr(\"class\", \"wardley-outsource-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#666\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"buy\").append(\"circle\").attr(\"class\", \"wardley-buy-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#ccc\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"build\").append(\"circle\").attr(\"class\", \"wardley-build-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#eee\").attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1);\n const marketNodes = nodeEnter.filter((node) => node.sourceStrategy === \"market\");\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter(\n (node) => !node.isPipelineParent && node.sourceStrategy !== \"market\" && node.className !== \"anchor\"\n ).append(\"circle\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n const smallCircleRadius = configValues.nodeRadius * 0.7;\n const triangleRadius = configValues.nodeRadius * 1.2;\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x).attr(\"y1\", (node) => positions.get(node.id).y - triangleRadius).attr(\"x2\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x).attr(\"y2\", (node) => positions.get(node.id).y - triangleRadius).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y - triangleRadius).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n nodeEnter.filter((node) => node.isPipelineParent === true).append(\"rect\").attr(\"x\", (node) => positions.get(node.id).x - squareSize / 2).attr(\"y\", (node) => positions.get(node.id).y - squareSize / 2).attr(\"width\", squareSize).attr(\"height\", squareSize).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.inertia === true).append(\"line\").attr(\"class\", \"wardley-inertia\").attr(\"x1\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y1\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y - lineHeight / 2;\n }).attr(\"x2\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y2\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y + lineHeight / 2;\n }).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 6);\n nodeEnter.append(\"text\").attr(\"x\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetX !== void 0 ? pos.x + node.labelOffsetX : pos.x;\n }\n let defaultOffset = configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetX === void 0) {\n defaultOffset += 10;\n }\n const customOffset = node.labelOffsetX ?? defaultOffset;\n return pos.x + customOffset;\n }).attr(\"y\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetY !== void 0 ? pos.y + node.labelOffsetY : pos.y - 3;\n }\n let defaultOffset = -configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetY === void 0) {\n defaultOffset -= 10;\n }\n const customOffset = node.labelOffsetY ?? defaultOffset;\n return pos.y + customOffset;\n }).attr(\"class\", \"wardley-node-label\").attr(\"fill\", (node) => {\n if (node.className === \"evolved\") {\n return theme.evolutionStroke;\n }\n if (node.className === \"anchor\") {\n return \"#000\";\n }\n return theme.componentLabelColor;\n }).attr(\"font-size\", configValues.labelFontSize).attr(\"font-weight\", (node) => node.className === \"anchor\" ? \"bold\" : \"normal\").attr(\"text-anchor\", (node) => node.className === \"anchor\" ? \"middle\" : \"start\").attr(\"dominant-baseline\", (node) => node.className === \"anchor\" ? \"middle\" : \"auto\").text((node) => node.label);\n if (data.annotations.length > 0) {\n const annotationsGroup = root.append(\"g\").attr(\"class\", \"wardley-annotations\");\n data.annotations.forEach((annotation) => {\n const projectedCoords = annotation.coordinates.map((coord) => ({\n x: projectX(coord.x),\n y: projectY(coord.y)\n }));\n if (projectedCoords.length > 1) {\n for (let i = 0; i < projectedCoords.length - 1; i++) {\n annotationsGroup.append(\"line\").attr(\"class\", \"wardley-annotation-line\").attr(\"x1\", projectedCoords[i].x).attr(\"y1\", projectedCoords[i].y).attr(\"x2\", projectedCoords[i + 1].x).attr(\"y2\", projectedCoords[i + 1].y).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"stroke-dasharray\", \"4 4\");\n }\n }\n projectedCoords.forEach((coord) => {\n const annotationNode = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotation\");\n annotationNode.append(\"circle\").attr(\"cx\", coord.x).attr(\"cy\", coord.y).attr(\"r\", 10).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5);\n annotationNode.append(\"text\").attr(\"x\", coord.x).attr(\"y\", coord.y).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"central\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(annotation.number);\n });\n });\n if (data.annotationsBox) {\n let boxX = projectX(data.annotationsBox.x);\n let boxY = projectY(data.annotationsBox.y);\n const padding = 10;\n const lineHeight = 16;\n const fontSize = 11;\n const textBoxGroup = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotations-box\");\n const sortedAnnotations = [...data.annotations].filter((a) => a.text).sort((a, b) => a.number - b.number);\n const textElements = [];\n sortedAnnotations.forEach((annotation, idx) => {\n const text2 = textBoxGroup.append(\"text\").attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight).attr(\"font-size\", fontSize).attr(\"fill\", theme.axisTextColor).attr(\"text-anchor\", \"start\").attr(\"dominant-baseline\", \"middle\").text(`${annotation.number}. ${annotation.text}`);\n textElements.push(text2);\n });\n if (textElements.length > 0) {\n let maxWidth = 0;\n let maxHeight = 0;\n textElements.forEach((text2) => {\n const textNode = text2.node();\n const textWidth = textNode.getComputedTextLength();\n maxWidth = Math.max(maxWidth, textWidth);\n const bbox = textNode.getBBox();\n maxHeight = Math.max(maxHeight, bbox.height);\n });\n const boxWidth = maxWidth + padding * 2 + 105;\n const boxHeight = sortedAnnotations.length * lineHeight + padding * 2 + maxHeight / 2;\n const minX = configValues.padding;\n const maxX = width - configValues.padding - boxWidth;\n const minY = configValues.padding;\n const maxY = height - configValues.padding - boxHeight;\n boxX = Math.max(minX, Math.min(boxX, maxX));\n boxY = Math.max(minY, Math.min(boxY, maxY));\n textElements.forEach((text2, idx) => {\n text2.attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight);\n });\n textBoxGroup.insert(\"rect\", \"text\").attr(\"x\", boxX).attr(\"y\", boxY).attr(\"width\", boxWidth).attr(\"height\", boxHeight).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n }\n }\n if (data.notes.length > 0) {\n const notesGroup = root.append(\"g\").attr(\"class\", \"wardley-notes\");\n data.notes.forEach((note) => {\n const noteX = projectX(note.x);\n const noteY = projectY(note.y);\n notesGroup.append(\"text\").attr(\"x\", noteX).attr(\"y\", noteY).attr(\"text-anchor\", \"start\").attr(\"font-size\", 11).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(note.text);\n });\n }\n if (data.accelerators.length > 0) {\n const acceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-accelerators\");\n data.accelerators.forEach((accelerator) => {\n const accX = projectX(accelerator.x);\n const accY = projectY(accelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${accX} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2 - 8}\n L ${accX + arrowWidth} ${accY}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2 + 8}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2}\n L ${accX} ${accY + arrowHeight / 2}\n Z\n `;\n acceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n acceleratorsGroup.append(\"text\").attr(\"x\", accX + arrowWidth / 2).attr(\"y\", accY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(accelerator.name);\n });\n }\n if (data.deaccelerators.length > 0) {\n const deacceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-deaccelerators\");\n data.deaccelerators.forEach((deaccelerator) => {\n const decX = projectX(deaccelerator.x);\n const decY = projectY(deaccelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${decX + arrowWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2 - 8}\n L ${decX} ${decY}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2 + 8}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2}\n L ${decX + arrowWidth} ${decY + arrowHeight / 2}\n Z\n `;\n deacceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n deacceleratorsGroup.append(\"text\").attr(\"x\", decX + arrowWidth / 2).attr(\"y\", decY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(deaccelerator.name);\n });\n }\n}, \"draw\");\nvar wardleyRenderer_default = {\n draw\n};\n\n// src/diagrams/wardley/styles.ts\nvar styles = /* @__PURE__ */ __name(({\n wardley\n} = {}) => {\n const defaultThemeVariables = getThemeVariables();\n const currentConfig = getConfig();\n const themeVariables = cleanAndMerge(defaultThemeVariables, currentConfig.themeVariables);\n const w = cleanAndMerge(themeVariables.wardley, wardley);\n return `\n .wardley-background {\n fill: ${w.backgroundColor};\n }\n .wardley-axes line, .wardley-axes path {\n stroke: ${w.axisColor};\n }\n .wardley-axis-label {\n fill: ${w.axisTextColor};\n }\n .wardley-stage-label {\n fill: ${w.axisTextColor};\n }\n .wardley-grid line {\n stroke: ${w.gridColor};\n }\n .wardley-node circle {\n fill: ${w.componentFill};\n stroke: ${w.componentStroke};\n }\n .wardley-node-label {\n fill: ${w.componentLabelColor};\n }\n .wardley-link {\n stroke: ${w.linkStroke};\n }\n .wardley-link--dashed {\n stroke-dasharray: 4 4;\n }\n .wardley-link-label {\n fill: ${w.axisTextColor};\n }\n .wardley-trend line {\n stroke: ${w.evolutionStroke};\n }\n .wardley-annotation-line {\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation circle {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation text {\n fill: ${w.annotationTextColor};\n }\n .wardley-annotations-box rect {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotations-box text {\n fill: ${w.annotationTextColor};\n }\n .wardley-pipeline-box {\n stroke: ${w.componentStroke};\n }\n .wardley-notes text {\n fill: ${w.axisTextColor};\n }\n `;\n}, \"styles\");\n\n// src/diagrams/wardley/wardleyDiagram.ts\nvar diagram = {\n parser,\n db: wardleyDb_default,\n renderer: wardleyRenderer_default,\n styles\n};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AG,EAAO,GAAc,EAAE;;QAGlD,EAAoB,OAAO,OAAO,CAAC,KAAK,IAAK,EAAU,CAAC,KAAK,OAAQ,QAAQ,CAAC,KAAK,SAAU,EAAM,gBAAgB,CAAC,KAAK,eAAgB,EAAE,CAC3I,EAAoB,OAAO,OAAO,CAAC,KAAK,IAAK,EAAO,GAAa,EAAE,CAAC,KAAK,IAAK,EAAO,GAAc,EAAI,GAAG,CAAC,KAAK,cAAe,SAAS,CAAC,KAAK,YAAa,GAAG,CAAC,KAAK,OAAQ,EAAM,cAAc,CAAC,KAAK,cAAe,OAAO,CAAC,KAAK,EAAc,KAAK,EACrP,GAEH,OAEG,CA4E6B,CACjC,OAzE2B,GAAQ,CACnC,WACE,EAAE,GAAK,CAIT,IAAM,EAAI,EADa,EAFOA,GAE4B,CADpC,GACmD,CAAC,eACpC,CAAC,QAAS,EAAQ,CACxD,MAAO;;YAEG,EAAE,gBAAgB;;;cAGhB,EAAE,UAAU;;;YAGd,EAAE,cAAc;;;YAGhB,EAAE,cAAc;;;cAGd,EAAE,UAAU;;;YAGd,EAAE,cAAc;cACd,EAAE,gBAAgB;;;YAGpB,EAAE,oBAAoB;;;cAGpB,EAAE,WAAW;;;;;;YAMf,EAAE,cAAc;;;cAGd,EAAE,gBAAgB;;;cAGlB,EAAE,iBAAiB;;;YAGrB,EAAE,eAAe;cACf,EAAE,iBAAiB;;;YAGrB,EAAE,oBAAoB;;;YAGtB,EAAE,eAAe;cACf,EAAE,iBAAiB;;;YAGrB,EAAE,oBAAoB;;;cAGpB,EAAE,gBAAgB;;;YAGpB,EAAE,cAAc;;KAGzB,SAOK,CACP"}
1
+ {"version":3,"file":"wardleyDiagram-YWT4CUSO-A8XYzYTW.js","names":["getThemeVariables"],"sources":["../../../../../node_modules/.pnpm/mermaid@11.15.0/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-YWT4CUSO.mjs"],"sourcesContent":["import {\n selectSvgElement\n} from \"./chunk-WU5MYG2G.mjs\";\nimport {\n populateCommonDb\n} from \"./chunk-4BX2VUAB.mjs\";\nimport {\n cleanAndMerge\n} from \"./chunk-5ZQYHXKU.mjs\";\nimport {\n clear,\n configureSvgSize,\n getAccDescription,\n getAccTitle,\n getConfig,\n getConfig2,\n getDiagramTitle,\n getThemeVariables,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-CSCIHK7Q.mjs\";\nimport {\n __name,\n log\n} from \"./chunk-AGHRB4JF.mjs\";\n\n// src/diagrams/wardley/wardleyParser.ts\nimport { parse } from \"@mermaid-js/parser\";\nvar toPercent = /* @__PURE__ */ __name((value, context) => {\n const normalized = value <= 1 ? value * 100 : value;\n if (normalized < 0 || normalized > 100) {\n throw new Error(\n `${context} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${value}`\n );\n }\n return normalized;\n}, \"toPercent\");\nvar toCoordinates = /* @__PURE__ */ __name((visibility, evolution, context) => {\n return {\n x: toPercent(evolution, `${context} evolution`),\n y: toPercent(visibility, `${context} visibility`)\n };\n}, \"toCoordinates\");\nvar getFlowFromPort = /* @__PURE__ */ __name((port) => {\n if (!port) {\n return void 0;\n }\n if (port === \"+<>\") {\n return \"bidirectional\";\n }\n if (port === \"+<\") {\n return \"backward\";\n }\n if (port === \"+>\") {\n return \"forward\";\n }\n return void 0;\n}, \"getFlowFromPort\");\nvar extractFlowFromArrow = /* @__PURE__ */ __name((arrow) => {\n if (!arrow?.startsWith(\"+\")) {\n return {};\n }\n const labelMatch = /^\\+'([^']*)'/.exec(arrow);\n const flowLabel = labelMatch?.[1];\n if (arrow.includes(\"<>\")) {\n return { flow: \"bidirectional\", label: flowLabel };\n }\n if (arrow.includes(\"<\")) {\n return { flow: \"backward\", label: flowLabel };\n }\n if (arrow.includes(\">\")) {\n return { flow: \"forward\", label: flowLabel };\n }\n return { label: flowLabel };\n}, \"extractFlowFromArrow\");\nvar populateDb = /* @__PURE__ */ __name((ast, db) => {\n populateCommonDb(ast, db);\n if (ast.size) {\n db.setSize(ast.size.width, ast.size.height);\n }\n if (ast.evolution) {\n const stages = ast.evolution.stages.map((stage) => {\n if (stage.secondName) {\n return `${stage.name.trim()} / ${stage.secondName.trim()}`;\n }\n return stage.name.trim();\n });\n const stageBoundaries = ast.evolution.stages.filter((stage) => stage.boundary !== void 0).map((stage) => stage.boundary);\n db.updateAxes({ stages, stageBoundaries });\n }\n ast.anchors.forEach((anchor) => {\n const coords = toCoordinates(anchor.visibility, anchor.evolution, `Anchor \"${anchor.name}\"`);\n db.addNode(anchor.name, anchor.name, coords.x, coords.y, \"anchor\");\n });\n ast.components.forEach((component) => {\n const coords = toCoordinates(\n component.visibility,\n component.evolution,\n `Component \"${component.name}\"`\n );\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const sourceStrategy = component.decorator?.strategy;\n db.addNode(\n component.name,\n component.name,\n coords.x,\n coords.y,\n \"component\",\n labelOffsetX,\n labelOffsetY,\n component.inertia,\n sourceStrategy\n );\n });\n ast.notes.forEach((note) => {\n const coords = toCoordinates(note.visibility, note.evolution, `Note \"${note.text}\"`);\n db.addNote(note.text, coords.x, coords.y);\n });\n ast.pipelines.forEach((pipeline) => {\n const parentNode = db.getNode(pipeline.parent);\n if (!parentNode || typeof parentNode.y !== \"number\") {\n throw new Error(\n `Pipeline \"${pipeline.parent}\" must reference an existing component with coordinates.`\n );\n }\n const parentY = parentNode.y;\n db.startPipeline(pipeline.parent);\n pipeline.components.forEach((component) => {\n const componentId = `${pipeline.parent}_${component.name}`;\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const x = toPercent(component.evolution, `Pipeline component \"${component.name}\" evolution`);\n db.addNode(\n componentId,\n component.name,\n x,\n parentY,\n \"pipeline-component\",\n labelOffsetX,\n labelOffsetY\n );\n db.addPipelineComponent(pipeline.parent, componentId);\n });\n });\n ast.links.forEach((link) => {\n const isDashed = !!link.arrow && (link.arrow.includes(\"-.->\") || link.arrow.includes(\".-.\"));\n let flow = getFlowFromPort(link.fromPort) ?? getFlowFromPort(link.toPort);\n const { flow: arrowFlow, label: flowLabel } = extractFlowFromArrow(link.arrow);\n if (!flow && arrowFlow) {\n flow = arrowFlow;\n }\n const annotation = link.linkLabel;\n const label = flowLabel ?? annotation;\n db.addLink(db.resolveNodeId(link.from), db.resolveNodeId(link.to), isDashed, label, flow);\n });\n ast.evolves.forEach((evolve) => {\n const node = db.getNode(evolve.component);\n if (node?.y !== void 0) {\n const target = toPercent(evolve.target, `Evolve target for \"${evolve.component}\"`);\n db.addTrend(evolve.component, target, node.y);\n }\n });\n if (ast.annotations.length > 0) {\n const annotationsBox = ast.annotations[0];\n const coords = toCoordinates(annotationsBox.x, annotationsBox.y, \"Annotations box\");\n db.setAnnotationsBox(coords.x, coords.y);\n }\n ast.annotation.forEach((annotation) => {\n const coords = toCoordinates(annotation.x, annotation.y, `Annotation ${annotation.number}`);\n db.addAnnotation(annotation.number, [{ x: coords.x, y: coords.y }], annotation.text);\n });\n ast.accelerators.forEach((accelerator) => {\n const coords = toCoordinates(accelerator.x, accelerator.y, `Accelerator \"${accelerator.name}\"`);\n db.addAccelerator(accelerator.name, coords.x, coords.y);\n });\n ast.deaccelerators.forEach((deaccelerator) => {\n const coords = toCoordinates(\n deaccelerator.x,\n deaccelerator.y,\n `Deaccelerator \"${deaccelerator.name}\"`\n );\n db.addDeaccelerator(deaccelerator.name, coords.x, coords.y);\n });\n}, \"populateDb\");\nvar parser = {\n parser: {\n // @ts-expect-error - WardleyDB is not assignable to DiagramDB\n yy: void 0\n },\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"wardley\", input);\n log.debug(ast);\n const db = parser.parser?.yy;\n if (!db || typeof db.addNode !== \"function\") {\n throw new Error(\n \"parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.\"\n );\n }\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/wardley/wardleyBuilder.ts\nvar WardleyBuilder = class {\n constructor() {\n this.nodes = /* @__PURE__ */ new Map();\n this.links = [];\n this.trends = /* @__PURE__ */ new Map();\n this.pipelines = /* @__PURE__ */ new Map();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.axes = {};\n }\n static {\n __name(this, \"WardleyBuilder\");\n }\n addNode(node) {\n const existing = this.nodes.get(node.id) ?? { id: node.id, label: node.label };\n const merged = {\n ...existing,\n ...node,\n className: node.className ?? existing.className,\n labelOffsetX: node.labelOffsetX ?? existing.labelOffsetX,\n labelOffsetY: node.labelOffsetY ?? existing.labelOffsetY\n };\n this.nodes.set(node.id, merged);\n }\n addLink(link) {\n this.links.push(link);\n }\n addTrend(trend) {\n this.trends.set(trend.nodeId, trend);\n }\n startPipeline(nodeId) {\n this.pipelines.set(nodeId, { nodeId, componentIds: [] });\n const node = this.nodes.get(nodeId);\n if (node) {\n node.isPipelineParent = true;\n }\n }\n addPipelineComponent(pipelineNodeId, componentId) {\n const pipeline = this.pipelines.get(pipelineNodeId);\n if (pipeline) {\n pipeline.componentIds.push(componentId);\n }\n const node = this.nodes.get(componentId);\n if (node) {\n node.inPipeline = true;\n }\n }\n addAnnotation(annotation) {\n this.annotations.push(annotation);\n }\n addNote(note) {\n this.notes.push(note);\n }\n addAccelerator(accelerator) {\n this.accelerators.push(accelerator);\n }\n addDeaccelerator(deaccelerator) {\n this.deaccelerators.push(deaccelerator);\n }\n setAnnotationsBox(x, y) {\n this.annotationsBox = { x, y };\n }\n setAxes(partial) {\n this.axes = {\n ...this.axes,\n ...partial\n };\n }\n setSize(width, height) {\n this.size = { width, height };\n }\n getNode(id) {\n return this.nodes.get(id);\n }\n /**\n * Resolve a name to a node ID. Tries exact ID match first,\n * then falls back to finding a node whose label matches the name\n * (handles pipeline components which have synthetic IDs like \"Parent_Child\").\n */\n resolveNodeId(name) {\n if (this.nodes.has(name)) {\n return name;\n }\n for (const [id, node] of this.nodes) {\n if (node.label === name) {\n return id;\n }\n }\n return name;\n }\n build() {\n const nodes = [];\n for (const node of this.nodes.values()) {\n if (typeof node.x !== \"number\" || typeof node.y !== \"number\") {\n throw new Error(`Node \"${node.label}\" is missing coordinates`);\n }\n nodes.push(node);\n }\n return {\n nodes,\n links: [...this.links],\n trends: [...this.trends.values()],\n pipelines: [...this.pipelines.values()],\n annotations: [...this.annotations],\n notes: [...this.notes],\n accelerators: [...this.accelerators],\n deaccelerators: [...this.deaccelerators],\n annotationsBox: this.annotationsBox,\n axes: { ...this.axes },\n size: this.size\n };\n }\n clear() {\n this.nodes.clear();\n this.links = [];\n this.trends.clear();\n this.pipelines.clear();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.annotationsBox = void 0;\n this.axes = {};\n this.size = void 0;\n }\n};\n\n// src/diagrams/wardley/wardleyDb.ts\nvar builder = new WardleyBuilder();\nfunction getConfig3() {\n return getConfig2()[\"wardley-beta\"];\n}\n__name(getConfig3, \"getConfig\");\nfunction addNode(id, label, x, y, className, labelOffsetX, labelOffsetY, inertia, sourceStrategy) {\n builder.addNode({\n id,\n label,\n x,\n y,\n className,\n labelOffsetX,\n labelOffsetY,\n inertia,\n sourceStrategy\n });\n}\n__name(addNode, \"addNode\");\nfunction addLink(sourceId, targetId, dashed = false, label, flow) {\n builder.addLink({\n source: sourceId,\n target: targetId,\n dashed,\n label,\n flow\n });\n}\n__name(addLink, \"addLink\");\nfunction addTrend(nodeId, targetX, targetY) {\n builder.addTrend({ nodeId, targetX, targetY });\n}\n__name(addTrend, \"addTrend\");\nfunction addAnnotation(number, coordinates, text) {\n builder.addAnnotation({\n number,\n coordinates,\n text\n });\n}\n__name(addAnnotation, \"addAnnotation\");\nfunction addNote(text, x, y) {\n builder.addNote({\n text,\n x,\n y\n });\n}\n__name(addNote, \"addNote\");\nfunction addAccelerator(name, x, y) {\n builder.addAccelerator({\n name,\n x,\n y\n });\n}\n__name(addAccelerator, \"addAccelerator\");\nfunction addDeaccelerator(name, x, y) {\n builder.addDeaccelerator({\n name,\n x,\n y\n });\n}\n__name(addDeaccelerator, \"addDeaccelerator\");\nfunction setAnnotationsBox(x, y) {\n builder.setAnnotationsBox(x, y);\n}\n__name(setAnnotationsBox, \"setAnnotationsBox\");\nfunction setSize(width, height) {\n builder.setSize(width, height);\n}\n__name(setSize, \"setSize\");\nfunction startPipeline(nodeId) {\n builder.startPipeline(nodeId);\n}\n__name(startPipeline, \"startPipeline\");\nfunction addPipelineComponent(pipelineNodeId, componentId) {\n builder.addPipelineComponent(pipelineNodeId, componentId);\n}\n__name(addPipelineComponent, \"addPipelineComponent\");\nfunction updateAxes(partial) {\n builder.setAxes(partial);\n}\n__name(updateAxes, \"updateAxes\");\nfunction getNode(id) {\n return builder.getNode(id);\n}\n__name(getNode, \"getNode\");\nfunction resolveNodeId(name) {\n return builder.resolveNodeId(name);\n}\n__name(resolveNodeId, \"resolveNodeId\");\nfunction getWardleyData() {\n return builder.build();\n}\n__name(getWardleyData, \"getWardleyData\");\nfunction clear2() {\n builder.clear();\n clear();\n}\n__name(clear2, \"clear\");\nvar wardleyDb_default = {\n getConfig: getConfig3,\n addNode,\n addLink,\n addTrend,\n addAnnotation,\n addNote,\n addAccelerator,\n addDeaccelerator,\n setAnnotationsBox,\n setSize,\n startPipeline,\n addPipelineComponent,\n updateAxes,\n getNode,\n resolveNodeId,\n getWardleyData,\n clear: clear2,\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle,\n getAccDescription,\n setAccDescription\n};\n\n// src/diagrams/wardley/wardleyRenderer.ts\nvar DEFAULT_STAGES = [\"Genesis\", \"Custom Built\", \"Product\", \"Commodity\"];\nvar getTheme = /* @__PURE__ */ __name(() => {\n const { themeVariables } = getConfig2();\n return {\n backgroundColor: themeVariables.wardley?.backgroundColor ?? themeVariables.background ?? \"#fff\",\n axisColor: themeVariables.wardley?.axisColor ?? \"#000\",\n axisTextColor: themeVariables.wardley?.axisTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n gridColor: themeVariables.wardley?.gridColor ?? \"rgba(100, 100, 100, 0.2)\",\n componentFill: themeVariables.wardley?.componentFill ?? \"#fff\",\n componentStroke: themeVariables.wardley?.componentStroke ?? \"#000\",\n componentLabelColor: themeVariables.wardley?.componentLabelColor ?? themeVariables.primaryTextColor ?? \"#222\",\n linkStroke: themeVariables.wardley?.linkStroke ?? \"#000\",\n evolutionStroke: themeVariables.wardley?.evolutionStroke ?? \"#dc3545\",\n annotationStroke: themeVariables.wardley?.annotationStroke ?? \"#000\",\n annotationTextColor: themeVariables.wardley?.annotationTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n annotationFill: themeVariables.wardley?.annotationFill ?? themeVariables.background ?? \"#fff\"\n };\n}, \"getTheme\");\nvar getConfigValues = /* @__PURE__ */ __name(() => {\n const wardleyConfig = getConfig2()[\"wardley-beta\"];\n return {\n width: wardleyConfig?.width ?? 900,\n height: wardleyConfig?.height ?? 600,\n padding: wardleyConfig?.padding ?? 48,\n nodeRadius: wardleyConfig?.nodeRadius ?? 6,\n nodeLabelOffset: wardleyConfig?.nodeLabelOffset ?? 8,\n axisFontSize: wardleyConfig?.axisFontSize ?? 12,\n labelFontSize: wardleyConfig?.labelFontSize ?? 10,\n showGrid: wardleyConfig?.showGrid ?? false,\n useMaxWidth: wardleyConfig?.useMaxWidth ?? true\n };\n}, \"getConfigValues\");\nvar draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {\n log.debug(\"Rendering Wardley map\\n\" + text);\n const configValues = getConfigValues();\n const theme = getTheme();\n const squareSize = configValues.nodeRadius * 1.6;\n const db = diagObj.db;\n const data = db.getWardleyData();\n const title = db.getDiagramTitle();\n const width = data.size?.width ?? configValues.width;\n const height = data.size?.height ?? configValues.height;\n const svg = selectSvgElement(id);\n svg.selectAll(\"*\").remove();\n configureSvgSize(svg, height, width, configValues.useMaxWidth);\n svg.attr(\"viewBox\", `0 0 ${width} ${height}`);\n const root = svg.append(\"g\").attr(\"class\", \"wardley-map\");\n const defs = svg.append(\"defs\");\n defs.append(\"marker\").attr(\"id\", `arrow-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 6).attr(\"markerHeight\", 6).attr(\"orient\", \"auto-start-reverse\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.evolutionStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-end-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-start-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 1).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 10 0 L 0 5 L 10 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n root.append(\"rect\").attr(\"class\", \"wardley-background\").attr(\"width\", width).attr(\"height\", height).attr(\"fill\", theme.backgroundColor);\n const chartWidth = width - configValues.padding * 2;\n const chartHeight = height - configValues.padding * 2;\n if (title) {\n root.append(\"text\").attr(\"class\", \"wardley-title\").attr(\"x\", width / 2).attr(\"y\", configValues.padding / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize * 1.05).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(title);\n }\n const projectX = /* @__PURE__ */ __name((value) => configValues.padding + value / 100 * chartWidth, \"projectX\");\n const projectY = /* @__PURE__ */ __name((value) => height - configValues.padding - value / 100 * chartHeight, \"projectY\");\n const axisGroup = root.append(\"g\").attr(\"class\", \"wardley-axes\");\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", configValues.padding).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n const xLabel = data.axes.xLabel ?? \"Evolution\";\n const yLabel = data.axes.yLabel ?? \"Visibility\";\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-x\").attr(\"x\", configValues.padding + chartWidth / 2).attr(\"y\", height - configValues.padding / 4).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").text(xLabel);\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-y\").attr(\"x\", configValues.padding / 3).attr(\"y\", configValues.padding + chartHeight / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\n \"transform\",\n `rotate(-90 ${configValues.padding / 3} ${configValues.padding + chartHeight / 2})`\n ).text(yLabel);\n const stages = data.axes.stages && data.axes.stages.length > 0 ? data.axes.stages : DEFAULT_STAGES;\n if (stages.length > 0) {\n const stageGroup = root.append(\"g\").attr(\"class\", \"wardley-stages\");\n const boundaries = data.axes.stageBoundaries;\n const stagePositions = [];\n if (boundaries && boundaries.length === stages.length) {\n let prevBoundary = 0;\n boundaries.forEach((boundary) => {\n stagePositions.push({ start: prevBoundary, end: boundary });\n prevBoundary = boundary;\n });\n } else {\n const stageWidth = 1 / stages.length;\n stages.forEach((_, index) => {\n stagePositions.push({\n start: index * stageWidth,\n end: (index + 1) * stageWidth\n });\n });\n }\n stages.forEach((stage, index) => {\n const pos = stagePositions[index];\n const startX = configValues.padding + pos.start * chartWidth;\n const endX = configValues.padding + pos.end * chartWidth;\n const centerX = (startX + endX) / 2;\n if (index > 0) {\n stageGroup.append(\"line\").attr(\"x1\", startX).attr(\"x2\", startX).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"5 5\").attr(\"opacity\", 0.8);\n }\n stageGroup.append(\"text\").attr(\"class\", \"wardley-stage-label\").attr(\"x\", centerX).attr(\"y\", height - configValues.padding / 1.5).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize - 2).attr(\"text-anchor\", \"middle\").text(stage);\n });\n }\n if (configValues.showGrid) {\n const gridGroup = root.append(\"g\").attr(\"class\", \"wardley-grid\");\n for (let i = 1; i < 4; i++) {\n const ratio = i / 4;\n const x = configValues.padding + chartWidth * ratio;\n gridGroup.append(\"line\").attr(\"x1\", x).attr(\"x2\", x).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n gridGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding - chartHeight * ratio).attr(\"y2\", height - configValues.padding - chartHeight * ratio).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n }\n }\n const positions = /* @__PURE__ */ new Map();\n data.nodes.forEach((node) => {\n positions.set(node.id, {\n x: projectX(node.x),\n y: projectY(node.y),\n node\n });\n });\n if (data.pipelines.length > 0) {\n const pipelineGroup = root.append(\"g\").attr(\"class\", \"wardley-pipelines\");\n const pipelineLinksGroup = root.append(\"g\").attr(\"class\", \"wardley-pipeline-links\");\n data.pipelines.forEach((pipeline) => {\n if (pipeline.componentIds.length === 0) {\n return;\n }\n const sortedComponents = pipeline.componentIds.map((id2) => ({ id: id2, pos: positions.get(id2), node: data.nodes.find((n) => n.id === id2) })).filter((c) => c.pos && c.node).sort((a, b) => a.node.x - b.node.x);\n for (let i = 0; i < sortedComponents.length - 1; i++) {\n const current = sortedComponents[i];\n const next = sortedComponents[i + 1];\n pipelineLinksGroup.append(\"line\").attr(\"class\", \"wardley-pipeline-evolution-link\").attr(\"x1\", current.pos.x).attr(\"y1\", current.pos.y).attr(\"x2\", next.pos.x).attr(\"y2\", next.pos.y).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\");\n }\n let minX = Infinity;\n let maxX = -Infinity;\n let y = 0;\n pipeline.componentIds.forEach((componentId) => {\n const pos = positions.get(componentId);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x);\n y = pos.y;\n }\n });\n if (minX !== Infinity && maxX !== -Infinity) {\n const padding = 15;\n const height2 = configValues.nodeRadius * 4;\n const boxTop = y - height2 / 2;\n const parentPos = positions.get(pipeline.nodeId);\n if (parentPos) {\n const centerX = (minX + maxX) / 2;\n parentPos.x = centerX;\n parentPos.y = boxTop - squareSize / 6;\n }\n pipelineGroup.append(\"rect\").attr(\"class\", \"wardley-pipeline-box\").attr(\"x\", minX - padding).attr(\"y\", boxTop).attr(\"width\", maxX - minX + padding * 2).attr(\"height\", height2).attr(\"fill\", \"none\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n });\n }\n const linksGroup = root.append(\"g\").attr(\"class\", \"wardley-links\");\n const pipelineMap = /* @__PURE__ */ new Map();\n data.pipelines.forEach((pipeline) => {\n pipelineMap.set(pipeline.nodeId, new Set(pipeline.componentIds));\n });\n const validLinks = data.links.filter((link) => {\n if (!positions.has(link.source) || !positions.has(link.target)) {\n return false;\n }\n const pipelineComponents = pipelineMap.get(link.target);\n if (pipelineComponents?.has(link.source)) {\n return false;\n }\n return true;\n });\n linksGroup.selectAll(\"line\").data(validLinks).enter().append(\"line\").attr(\"class\", (link) => `wardley-link${link.dashed ? \" wardley-link--dashed\" : \"\"}`).attr(\"x1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.x + dx / distance * radius;\n }).attr(\"y1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.y + dy / distance * radius;\n }).attr(\"x2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.x + dx / distance * radius;\n }).attr(\"y2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.y + dy / distance * radius;\n }).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", (link) => link.dashed ? \"6 6\" : null).attr(\"marker-end\", (link) => {\n if (link.flow === \"forward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-end-${id})`;\n }\n return null;\n }).attr(\"marker-start\", (link) => {\n if (link.flow === \"backward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-start-${id})`;\n }\n return null;\n });\n linksGroup.selectAll(\"text\").data(validLinks.filter((link) => link.label)).enter().append(\"text\").attr(\"class\", \"wardley-link-label\").attr(\"x\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const dy = targetPos.y - sourcePos.y;\n const dx = targetPos.x - sourcePos.x;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n return midX + perpX * offset;\n }).attr(\"y\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpY = -dx / distance;\n return midY + perpY * offset;\n }).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.labelFontSize).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").attr(\"transform\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n const perpY = -dx / distance;\n const labelX = midX + perpX * offset;\n const labelY = midY + perpY * offset;\n let angle = Math.atan2(dy, dx) * 180 / Math.PI;\n if (angle > 90 || angle < -90) {\n angle += 180;\n }\n return `rotate(${angle} ${labelX} ${labelY})`;\n }).text((link) => link.label);\n const trendGroup = root.append(\"g\").attr(\"class\", \"wardley-trends\");\n const trendsWithPositions = data.trends.map((trend) => {\n const origin = positions.get(trend.nodeId);\n if (!origin) {\n return null;\n }\n const targetX = projectX(trend.targetX);\n const targetY = projectY(trend.targetY);\n const dx = targetX - origin.x;\n const dy = targetY - origin.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const shortenBy = configValues.nodeRadius + 2;\n const adjustedX2 = distance > shortenBy ? targetX - dx / distance * shortenBy : targetX;\n const adjustedY2 = distance > shortenBy ? targetY - dy / distance * shortenBy : targetY;\n return {\n origin,\n targetX,\n targetY,\n adjustedX2,\n adjustedY2\n };\n }).filter((trend) => trend !== null);\n trendGroup.selectAll(\"line\").data(trendsWithPositions).enter().append(\"line\").attr(\"class\", \"wardley-trend\").attr(\"x1\", (trend) => trend.origin.x).attr(\"y1\", (trend) => trend.origin.y).attr(\"x2\", (trend) => trend.adjustedX2).attr(\"y2\", (trend) => trend.adjustedY2).attr(\"stroke\", theme.evolutionStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\").attr(\"marker-end\", `url(#arrow-${id})`);\n const nodesGroup = root.append(\"g\").attr(\"class\", \"wardley-nodes\");\n const nodeEnter = nodesGroup.selectAll(\"g\").data(data.nodes).enter().append(\"g\").attr(\n \"class\",\n (node) => [\"wardley-node\", node.className ? `wardley-node--${node.className}` : \"\"].filter(Boolean).join(\" \")\n );\n nodeEnter.filter((node) => node.sourceStrategy === \"outsource\").append(\"circle\").attr(\"class\", \"wardley-outsource-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#666\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"buy\").append(\"circle\").attr(\"class\", \"wardley-buy-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#ccc\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"build\").append(\"circle\").attr(\"class\", \"wardley-build-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#eee\").attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1);\n const marketNodes = nodeEnter.filter((node) => node.sourceStrategy === \"market\");\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter(\n (node) => !node.isPipelineParent && node.sourceStrategy !== \"market\" && node.className !== \"anchor\"\n ).append(\"circle\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n const smallCircleRadius = configValues.nodeRadius * 0.7;\n const triangleRadius = configValues.nodeRadius * 1.2;\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x).attr(\"y1\", (node) => positions.get(node.id).y - triangleRadius).attr(\"x2\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x).attr(\"y2\", (node) => positions.get(node.id).y - triangleRadius).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y - triangleRadius).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n nodeEnter.filter((node) => node.isPipelineParent === true).append(\"rect\").attr(\"x\", (node) => positions.get(node.id).x - squareSize / 2).attr(\"y\", (node) => positions.get(node.id).y - squareSize / 2).attr(\"width\", squareSize).attr(\"height\", squareSize).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.inertia === true).append(\"line\").attr(\"class\", \"wardley-inertia\").attr(\"x1\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y1\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y - lineHeight / 2;\n }).attr(\"x2\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y2\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y + lineHeight / 2;\n }).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 6);\n nodeEnter.append(\"text\").attr(\"x\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetX !== void 0 ? pos.x + node.labelOffsetX : pos.x;\n }\n let defaultOffset = configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetX === void 0) {\n defaultOffset += 10;\n }\n const customOffset = node.labelOffsetX ?? defaultOffset;\n return pos.x + customOffset;\n }).attr(\"y\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetY !== void 0 ? pos.y + node.labelOffsetY : pos.y - 3;\n }\n let defaultOffset = -configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetY === void 0) {\n defaultOffset -= 10;\n }\n const customOffset = node.labelOffsetY ?? defaultOffset;\n return pos.y + customOffset;\n }).attr(\"class\", \"wardley-node-label\").attr(\"fill\", (node) => {\n if (node.className === \"evolved\") {\n return theme.evolutionStroke;\n }\n if (node.className === \"anchor\") {\n return \"#000\";\n }\n return theme.componentLabelColor;\n }).attr(\"font-size\", configValues.labelFontSize).attr(\"font-weight\", (node) => node.className === \"anchor\" ? \"bold\" : \"normal\").attr(\"text-anchor\", (node) => node.className === \"anchor\" ? \"middle\" : \"start\").attr(\"dominant-baseline\", (node) => node.className === \"anchor\" ? \"middle\" : \"auto\").text((node) => node.label);\n if (data.annotations.length > 0) {\n const annotationsGroup = root.append(\"g\").attr(\"class\", \"wardley-annotations\");\n data.annotations.forEach((annotation) => {\n const projectedCoords = annotation.coordinates.map((coord) => ({\n x: projectX(coord.x),\n y: projectY(coord.y)\n }));\n if (projectedCoords.length > 1) {\n for (let i = 0; i < projectedCoords.length - 1; i++) {\n annotationsGroup.append(\"line\").attr(\"class\", \"wardley-annotation-line\").attr(\"x1\", projectedCoords[i].x).attr(\"y1\", projectedCoords[i].y).attr(\"x2\", projectedCoords[i + 1].x).attr(\"y2\", projectedCoords[i + 1].y).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"stroke-dasharray\", \"4 4\");\n }\n }\n projectedCoords.forEach((coord) => {\n const annotationNode = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotation\");\n annotationNode.append(\"circle\").attr(\"cx\", coord.x).attr(\"cy\", coord.y).attr(\"r\", 10).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5);\n annotationNode.append(\"text\").attr(\"x\", coord.x).attr(\"y\", coord.y).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"central\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(annotation.number);\n });\n });\n if (data.annotationsBox) {\n let boxX = projectX(data.annotationsBox.x);\n let boxY = projectY(data.annotationsBox.y);\n const padding = 10;\n const lineHeight = 16;\n const fontSize = 11;\n const textBoxGroup = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotations-box\");\n const sortedAnnotations = [...data.annotations].filter((a) => a.text).sort((a, b) => a.number - b.number);\n const textElements = [];\n sortedAnnotations.forEach((annotation, idx) => {\n const text2 = textBoxGroup.append(\"text\").attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight).attr(\"font-size\", fontSize).attr(\"fill\", theme.axisTextColor).attr(\"text-anchor\", \"start\").attr(\"dominant-baseline\", \"middle\").text(`${annotation.number}. ${annotation.text}`);\n textElements.push(text2);\n });\n if (textElements.length > 0) {\n let maxWidth = 0;\n let maxHeight = 0;\n textElements.forEach((text2) => {\n const textNode = text2.node();\n const textWidth = textNode.getComputedTextLength();\n maxWidth = Math.max(maxWidth, textWidth);\n const bbox = textNode.getBBox();\n maxHeight = Math.max(maxHeight, bbox.height);\n });\n const boxWidth = maxWidth + padding * 2 + 105;\n const boxHeight = sortedAnnotations.length * lineHeight + padding * 2 + maxHeight / 2;\n const minX = configValues.padding;\n const maxX = width - configValues.padding - boxWidth;\n const minY = configValues.padding;\n const maxY = height - configValues.padding - boxHeight;\n boxX = Math.max(minX, Math.min(boxX, maxX));\n boxY = Math.max(minY, Math.min(boxY, maxY));\n textElements.forEach((text2, idx) => {\n text2.attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight);\n });\n textBoxGroup.insert(\"rect\", \"text\").attr(\"x\", boxX).attr(\"y\", boxY).attr(\"width\", boxWidth).attr(\"height\", boxHeight).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n }\n }\n if (data.notes.length > 0) {\n const notesGroup = root.append(\"g\").attr(\"class\", \"wardley-notes\");\n data.notes.forEach((note) => {\n const noteX = projectX(note.x);\n const noteY = projectY(note.y);\n notesGroup.append(\"text\").attr(\"x\", noteX).attr(\"y\", noteY).attr(\"text-anchor\", \"start\").attr(\"font-size\", 11).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(note.text);\n });\n }\n if (data.accelerators.length > 0) {\n const acceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-accelerators\");\n data.accelerators.forEach((accelerator) => {\n const accX = projectX(accelerator.x);\n const accY = projectY(accelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${accX} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2 - 8}\n L ${accX + arrowWidth} ${accY}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2 + 8}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2}\n L ${accX} ${accY + arrowHeight / 2}\n Z\n `;\n acceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n acceleratorsGroup.append(\"text\").attr(\"x\", accX + arrowWidth / 2).attr(\"y\", accY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(accelerator.name);\n });\n }\n if (data.deaccelerators.length > 0) {\n const deacceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-deaccelerators\");\n data.deaccelerators.forEach((deaccelerator) => {\n const decX = projectX(deaccelerator.x);\n const decY = projectY(deaccelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${decX + arrowWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2 - 8}\n L ${decX} ${decY}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2 + 8}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2}\n L ${decX + arrowWidth} ${decY + arrowHeight / 2}\n Z\n `;\n deacceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n deacceleratorsGroup.append(\"text\").attr(\"x\", decX + arrowWidth / 2).attr(\"y\", decY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(deaccelerator.name);\n });\n }\n}, \"draw\");\nvar wardleyRenderer_default = {\n draw\n};\n\n// src/diagrams/wardley/styles.ts\nvar styles = /* @__PURE__ */ __name(({\n wardley\n} = {}) => {\n const defaultThemeVariables = getThemeVariables();\n const currentConfig = getConfig();\n const themeVariables = cleanAndMerge(defaultThemeVariables, currentConfig.themeVariables);\n const w = cleanAndMerge(themeVariables.wardley, wardley);\n return `\n .wardley-background {\n fill: ${w.backgroundColor};\n }\n .wardley-axes line, .wardley-axes path {\n stroke: ${w.axisColor};\n }\n .wardley-axis-label {\n fill: ${w.axisTextColor};\n }\n .wardley-stage-label {\n fill: ${w.axisTextColor};\n }\n .wardley-grid line {\n stroke: ${w.gridColor};\n }\n .wardley-node circle {\n fill: ${w.componentFill};\n stroke: ${w.componentStroke};\n }\n .wardley-node-label {\n fill: ${w.componentLabelColor};\n }\n .wardley-link {\n stroke: ${w.linkStroke};\n }\n .wardley-link--dashed {\n stroke-dasharray: 4 4;\n }\n .wardley-link-label {\n fill: ${w.axisTextColor};\n }\n .wardley-trend line {\n stroke: ${w.evolutionStroke};\n }\n .wardley-annotation-line {\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation circle {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation text {\n fill: ${w.annotationTextColor};\n }\n .wardley-annotations-box rect {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotations-box text {\n fill: ${w.annotationTextColor};\n }\n .wardley-pipeline-box {\n stroke: ${w.componentStroke};\n }\n .wardley-notes text {\n fill: ${w.axisTextColor};\n }\n `;\n}, \"styles\");\n\n// src/diagrams/wardley/wardleyDiagram.ts\nvar diagram = {\n parser,\n db: wardleyDb_default,\n renderer: wardleyRenderer_default,\n styles\n};\nexport {\n diagram\n};\n"],"x_google_ignoreList":[0],"mappings":"+VA6BA,IAAI,EAA4B,GAAQ,EAAO,IAAY,CACzD,IAAM,EAAa,GAAS,EAAI,EAAQ,IAAM,EAC9C,GAAI,EAAa,GAAK,EAAa,IACjC,MAAU,MACR,GAAG,EAAQ,kEAAkE,IAC9E,CAEH,OAAO,GACN,YAAY,CACX,EAAgC,GAAQ,EAAY,EAAW,KAC1D,CACL,EAAG,EAAU,EAAW,GAAG,EAAQ,YAAY,CAC/C,EAAG,EAAU,EAAY,GAAG,EAAQ,aAAa,CAClD,EACA,gBAAgB,CACf,EAAkC,EAAQ,GAAS,CAChD,KAGL,IAAI,IAAS,MACX,MAAO,gBAET,GAAI,IAAS,KACX,MAAO,WAET,GAAI,IAAS,KACX,MAAO,YAGR,kBAAkB,CACjB,EAAuC,EAAQ,GAAU,CAC3D,GAAI,CAAC,GAAO,WAAW,IAAI,CACzB,MAAO,EAAE,CAGX,IAAM,EADa,eAAe,KAAK,EACX,GAAG,GAU/B,OATI,EAAM,SAAS,KAAK,CACf,CAAE,KAAM,gBAAiB,MAAO,EAAW,CAEhD,EAAM,SAAS,IAAI,CACd,CAAE,KAAM,WAAY,MAAO,EAAW,CAE3C,EAAM,SAAS,IAAI,CACd,CAAE,KAAM,UAAW,MAAO,EAAW,CAEvC,CAAE,MAAO,EAAW,EAC1B,uBAAuB,CACtB,EAA6B,GAAQ,EAAK,IAAO,CAKnD,GAJA,EAAiB,EAAK,EAAG,CACrB,EAAI,MACN,EAAG,QAAQ,EAAI,KAAK,MAAO,EAAI,KAAK,OAAO,CAEzC,EAAI,UAAW,CACjB,IAAM,EAAS,EAAI,UAAU,OAAO,IAAK,GACnC,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-DoMhBUqV.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-CSCIHK7Q-Bo3glXo1.js";import{t as m}from"./linear-CTnL8jvu.js";import{t as h}from"./ordinal-DjeI0KOh.js";import{t as g}from"./init-Dfd1k18d.js";import{i as _}from"./chunk-5ZQYHXKU-CxDIhrF-.js";import{t as v}from"./line-L2DeHwdZ.js";import{t as y}from"./chunk-O5CBEL6O-CM0slmy1.js";import{a as b}from"./index-BfPuPCFp.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],D=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],O=[1,64],k={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,27:`NUMBER_WITH_DECIMAL`,28:`COMMA`,31:`ARROW_DELIMITER`,34:`NEWLINE`,35:`SEMI`,36:`EOF`,38:`STR`,39:`MD_STR`,41:`AMP`,42:`NUM`,43:`ALPHA`,44:`PLUS`,45:`EQUALS`,46:`MULT`,47:`DOT`,48:`BRKT`,49:`MINUS`,50:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:`text`,text:``});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 27:this.$=a[s-1];break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:`text`,text:``});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:this.$={text:a[s],type:`text`};break;case 38:this.$={text:a[s],type:`text`};break;case 39:this.$={text:a[s],type:`markdown`};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(n,r,{3:1,4:2,7:4,5:i,34:a,35:o,36:s}),{1:[3]},e(n,r,{4:2,7:4,3:8,5:i,34:a,35:o,36:s}),e(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],34:a,35:o,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,34]),e(c,[2,35]),e(c,[2,36]),{1:[2,1]},e(n,r,{4:2,7:4,3:21,5:i,34:a,35:o,36:s}),{1:[2,3]},e(c,[2,5]),e(n,[2,7],{4:22,34:a,35:o,36:s}),{11:23,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:39,13:38,24:x,27:S,29:40,30:41,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:45,15:44,27:C,33:46,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:49,17:48,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:52,17:51,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,37],{40:55,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b}),e(E,[2,38]),e(E,[2,39]),e(D,[2,40]),e(D,[2,42]),e(D,[2,43]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:S}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:C}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:O},e(T,[2,14]),{17:65,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:O},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,h as t}from"./src-DoMhBUqV.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-CSCIHK7Q-BBzr5U3o.js";import{t as m}from"./linear-CTnL8jvu.js";import{t as h}from"./ordinal-DjeI0KOh.js";import{t as g}from"./init-Dfd1k18d.js";import{i as _}from"./chunk-5ZQYHXKU-B_3UEJ_q.js";import{t as v}from"./line-GCwXS1Fi.js";import{t as y}from"./chunk-O5CBEL6O-KRO56hHQ.js";import{a as b}from"./index-D5tmHkO_.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],D=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],O=[1,64],k={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,27:`NUMBER_WITH_DECIMAL`,28:`COMMA`,31:`ARROW_DELIMITER`,34:`NEWLINE`,35:`SEMI`,36:`EOF`,38:`STR`,39:`MD_STR`,41:`AMP`,42:`NUM`,43:`ALPHA`,44:`PLUS`,45:`EQUALS`,46:`MULT`,47:`DOT`,48:`BRKT`,49:`MINUS`,50:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:`text`,text:``});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 27:this.$=a[s-1];break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:`text`,text:``});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:this.$={text:a[s],type:`text`};break;case 38:this.$={text:a[s],type:`text`};break;case 39:this.$={text:a[s],type:`markdown`};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(n,r,{3:1,4:2,7:4,5:i,34:a,35:o,36:s}),{1:[3]},e(n,r,{4:2,7:4,3:8,5:i,34:a,35:o,36:s}),e(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],34:a,35:o,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,34]),e(c,[2,35]),e(c,[2,36]),{1:[2,1]},e(n,r,{4:2,7:4,3:21,5:i,34:a,35:o,36:s}),{1:[2,3]},e(c,[2,5]),e(n,[2,7],{4:22,34:a,35:o,36:s}),{11:23,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:39,13:38,24:x,27:S,29:40,30:41,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:45,15:44,27:C,33:46,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:49,17:48,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:52,17:51,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,37],{40:55,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b}),e(E,[2,38]),e(E,[2,39]),e(D,[2,40]),e(D,[2,42]),e(D,[2,43]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:S}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:C}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:O},e(T,[2,14]),{17:65,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:O},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};k.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,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]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
5
  `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
6
  `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;case 11:this.pushState(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState(`axis_data`),`X_AXIS`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 31;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState(`string`);break;case 28:this.popState();break;case 29:return`STR`;case 30:return 24;case 31:return 26;case 32:return 43;case 33:return`COLON`;case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}})();function A(){this.yy={}}return t(A,`Parser`),A.prototype=k,k.Parser=A,new A})();C.parser=C;var w=C;function T(e){return e.type===`bar`}t(T,`isBarPlot`);function E(e){return e.type===`band`}t(E,`isBandAxisData`);function D(e){return e.type===`linear`}t(D,`isLinearAxisData`);var O=class{constructor(e){this.parentGroup=e}static{t(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=y(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},k=.7,A=.2,j=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`}static{t(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){k*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(k*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`left-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`left-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`bottom-axis`,`title`],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`top-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`top-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},M=class extends j{static{t(this,`BandAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=S().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=S().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),e.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ee=class extends j{static{t(this,`LinearAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.domain=n,this.scale=m().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=m().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function N(e,t,n,r){let i=new O(r);return E(e)?new M(t,n,e.categories,e.title,i):new ee(t,n,[e.min,e.max],e.title,i)}t(N,`getAxis`);var te=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.push({groupTexts:[`chart-title`],type:`text`,data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:`middle`,horizontalPos:`center`,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function ne(e,t,n,r){return new te(new O(r),e,t,n)}t(ne,`getChartTitleComponent`);var re=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{t(this,`LinePlot`)}getDrawableElement(){let e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t;return t=this.orientation===`horizontal`?v().y(e=>e[0]).x(e=>e[1])(e):v().x(e=>e[0]).y(e=>e[1])(e),t?[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},ie=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{t(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ae=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error(`Axes must be passed to render Plots`);let e=[];for(let[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new re(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new ie(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break}return e}};function P(e,t,n){return new ae(e,t,n)}t(P,`getPlotComponent`);var oe=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:ne(e,t,n,r),plot:P(e,t,n),xAxis:N(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:N(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{t(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:i,height:a});e-=o.width,t-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=o.height,t-=o.height,this.componentStore.xAxis.setAxisPosition(`bottom`),o=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=o.height,this.componentStore.yAxis.setAxisPosition(`left`),o=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=o.width,e-=o.width,e>0&&(i+=e,e=0),t>0&&(a+=t,t=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`left`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=s.width,r=s.width,this.componentStore.yAxis.setAxisPosition(`top`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=s.height,i=n+s.height,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},se=class{static{t(this,`XYChartBuilder`)}static build(e,t,n,r){return new oe(e,t,n,r).getDrawableElement()}},F=0,I,L=W(),R=U(),z=G(),B=R.plotColorPalette.split(`,`).map(e=>e.trim()),V=!1,H=!1;function U(){let e=n(),t=s();return _(e.xyChart,t.themeVariables.xyChart)}t(U,`getChartDefaultThemeConfig`);function W(){let e=s();return _(l.xyChart,e.xyChart)}t(W,`getChartDefaultConfig`);function G(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}t(G,`getChartDefaultData`);function K(e){let t=s();return p(e.trim(),t)}t(K,`textSanitizer`);function q(e){I=e}t(q,`setTmpSVGG`);function J(e){e===`horizontal`?L.chartOrientation=`horizontal`:L.chartOrientation=`vertical`}t(J,`setOrientation`);function Y(e){z.xAxis.title=K(e.text)}t(Y,`setXAxisTitle`);function X(e,t){z.xAxis={type:`linear`,title:z.xAxis.title,min:e,max:t},V=!0}t(X,`setXAxisRangeData`);function ce(e){z.xAxis={type:`band`,title:z.xAxis.title,categories:e.map(e=>K(e.text))},V=!0}t(ce,`setXAxisBand`);function le(e){z.yAxis.title=K(e.text)}t(le,`setYAxisTitle`);function ue(e,t){z.yAxis={type:`linear`,title:z.yAxis.title,min:e,max:t},H=!0}t(ue,`setYAxisRangeData`);function de(e){let t=Math.min(...e),n=Math.max(...e),r=D(z.yAxis)?z.yAxis.min:1/0,i=D(z.yAxis)?z.yAxis.max:-1/0;z.yAxis={type:`linear`,title:z.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}t(de,`setYAxisRangeFromPlotData`);function Z(e){let t=[];if(e.length===0)return t;if(!V){let t=D(z.xAxis)?z.xAxis.min:1/0,n=D(z.xAxis)?z.xAxis.max:-1/0;X(Math.min(t,1),Math.max(n,e.length))}if(H||de(e),E(z.xAxis)&&(t=z.xAxis.categories.map((t,n)=>[t,e[n]])),D(z.xAxis)){let n=z.xAxis.min,r=z.xAxis.max,i=(r-n)/(e.length-1),a=[];for(let e=n;e<=r;e+=i)a.push(`${e}`);t=a.map((t,n)=>[t,e[n]])}return t}t(Z,`transformDataWithoutCategory`);function Q(e){return B[e===0?0:e%B.length]}t(Q,`getPlotColorFromPalette`);function fe(e,t){let n=Z(t);z.plots.push({type:`line`,strokeFill:Q(F),strokeWidth:2,data:n}),F++}t(fe,`setLineData`);function pe(e,t){let n=Z(t);z.plots.push({type:`bar`,fill:Q(F),data:n}),F++}t(pe,`setBarData`);function me(){if(z.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return z.title=d(),se.build(L,z,R,I)}t(me,`getDrawableElem`);function he(){return R}t(he,`getChartThemeConfig`);function ge(){return L}t(ge,`getChartConfig`);function $(){return z}t($,`getXYChartData`);var _e={parser:w,db:{getDrawableElem:me,clear:t(function(){o(),F=0,L=W(),z=G(),R=U(),B=R.plotColorPalette.split(`,`).map(e=>e.trim()),V=!1,H=!1},`clear`),setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:d,getAccDescription:u,setAccDescription:r,setOrientation:J,setXAxisTitle:Y,setXAxisRangeData:X,setXAxisBand:ce,setYAxisTitle:le,setYAxisRangeData:ue,setLineData:fe,setBarData:pe,setTmpSVGG:q,getChartThemeConfig:he,getChartConfig:ge,getXYChartData:$},renderer:{draw:t((n,r,i,a)=>{let o=a.db,s=o.getChartThemeConfig(),l=o.getChartConfig(),u=o.getXYChartData().plots[0].data.map(e=>e[1]);function d(e){return e===`top`?`text-before-edge`:`middle`}t(d,`getDominantBaseLine`);function f(e){return e===`left`?`start`:e===`right`?`end`:`middle`}t(f,`getTextAnchor`);function p(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}t(p,`getTextTransformation`),e.debug(`Rendering xychart chart
7
7
  `+n);let m=b(r),h=m.append(`g`).attr(`class`,`main`),g=h.append(`rect`).attr(`width`,l.width).attr(`height`,l.height).attr(`class`,`background`);c(m,l.height,l.width,!0),m.attr(`viewBox`,`0 0 ${l.width} ${l.height}`),g.attr(`fill`,s.backgroundColor),o.setTmpSVGG(m.append(`g`).attr(`class`,`mermaid-tmp-group`));let _=o.getDrawableElem(),v={};function y(e){let t=h,n=``;for(let[r]of e.entries()){let i=h;r>0&&v[n]&&(i=v[n]),n+=e[r],t=v[n],t||=v[n]=i.append(`g`).attr(`class`,e[r])}return t}t(y,`getGroup`);for(let e of _){if(e.data.length===0)continue;let n=y(e.groupTexts);switch(e.type){case`rect`:if(n.selectAll(`rect`).data(e.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),l.showDataLabel){let r=l.showDataLabelOutsideBar;if(l.chartOrientation===`horizontal`){let i=function(e,t){let{data:n,label:r}=e;return t*r.length*a<=n.width-o};t(i,`fitsHorizontally`);let a=.7,o=10,c=e.data.map((e,t)=>({data:e,label:u[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),l=c.map(e=>{let{data:t}=e,n=t.height*.7;for(;!i(e,n)&&n>0;)--n;return n}),d=Math.floor(Math.min(...l)),f=t(e=>r?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);n.selectAll(`text`).data(c).enter().append(`text`).attr(`x`,f).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,r?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${d}px`).text(e=>e.label)}else{let i=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,c=o+a/2,l=s>=r.x&&c<=r.x+r.width,u=r.y+n+t<=r.y+r.height;return l&&u};t(i,`fitsInBar`);let a=e.data.map((e,t)=>({data:e,label:u[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=a.map(e=>{let{data:t,label:n}=e,r=t.width/(n.length*.7);for(;!i(e,r,10)&&r>0;)--r;return r}),c=Math.floor(Math.min(...o)),l=t(e=>r?e.data.y-10:e.data.y+10,`determineLabelYPosition`);n.selectAll(`text`).data(a).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,l).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,r?`auto`:`hanging`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${c}px`).text(e=>e.label)}}break;case`text`:n.selectAll(`text`).data(e.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>d(e.verticalPos)).attr(`text-anchor`,e=>f(e.horizontalPos)).attr(`transform`,e=>p(e)).text(e=>e.text);break;case`path`:n.selectAll(`path`).data(e.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth);break}}},`draw`)}};export{_e as diagram};
8
- //# sourceMappingURL=xychartDiagram-2RQKCTM6-CbAQZMXv.js.map
8
+ //# sourceMappingURL=xychartDiagram-2RQKCTM6-CuyUQvFt.js.map