@leanspec/ui 0.2.21 → 0.2.22

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 (129) hide show
  1. package/dist/assets/_baseUniq-D7Jo4wA--B2TRxPWE.js +1 -0
  2. package/dist/assets/{_baseUniq--5gbTAb8.js → _baseUniq-iT192ZJn.js} +1 -1
  3. package/dist/assets/{arc-4N6yDHjl.js → arc-BpF2CtTd.js} +1 -1
  4. package/dist/assets/arc-bSbgZKu2-DL3rNhb4.js +1 -0
  5. package/dist/assets/architectureDiagram-VXUJARFQ-B9csKaKv-CjjNwF-J.js +36 -0
  6. package/dist/assets/{architectureDiagram-VXUJARFQ-DDCzyF2V.js → architectureDiagram-VXUJARFQ-RJJR00DR.js} +1 -1
  7. package/dist/assets/{blockDiagram-VD42YOAC-CqzgSlfV.js → blockDiagram-VD42YOAC-1uTfdDe0.js} +1 -1
  8. package/dist/assets/blockDiagram-VD42YOAC-DrRsdznF-BABvqVBT.js +122 -0
  9. package/dist/assets/c4Diagram-YG6GDRKO-Di2rkJ8i-Ds0QfElR.js +10 -0
  10. package/dist/assets/{c4Diagram-YG6GDRKO-DcDDI9XD.js → c4Diagram-YG6GDRKO-f40n5_vc.js} +1 -1
  11. package/dist/assets/channel-B6afjgOL.js +1 -0
  12. package/dist/assets/channel-CTeTHv-y-DAoPNf9o.js +1 -0
  13. package/dist/assets/{chunk-4BX2VUAB-CVAs-OQz.js → chunk-4BX2VUAB-BWm6jvkB.js} +1 -1
  14. package/dist/assets/chunk-4BX2VUAB-Dkr-Egsj-hwESrSLd.js +1 -0
  15. package/dist/assets/{chunk-55IACEB6-Dd3NjClm-icx5kZVe.js → chunk-55IACEB6-D_uwi6CC-CwcdTnFf.js} +1 -1
  16. package/dist/assets/{chunk-55IACEB6-Ccr-HMFu.js → chunk-55IACEB6-SXD_npDw.js} +1 -1
  17. package/dist/assets/{chunk-B4BG7PRW-DLUrgkJI-Cic_-nsr.js → chunk-B4BG7PRW-BipBIVhj-1FtWONL8.js} +6 -6
  18. package/dist/assets/{chunk-B4BG7PRW-xLNbTmXA.js → chunk-B4BG7PRW-UGjCd_Gn.js} +1 -1
  19. package/dist/assets/chunk-DI55MBZ5-8tWOlvAD-Cye13dPz.js +220 -0
  20. package/dist/assets/{chunk-DI55MBZ5-BsHIkgDC.js → chunk-DI55MBZ5-BQAFhPjX.js} +1 -1
  21. package/dist/assets/{chunk-FMBD7UC4-6dsbMKM7-DZVEYpsF.js → chunk-FMBD7UC4-CLc8_72--CGehZjII.js} +1 -1
  22. package/dist/assets/{chunk-FMBD7UC4-CN5kw4_J.js → chunk-FMBD7UC4-GQVp2u3C.js} +1 -1
  23. package/dist/assets/chunk-QN33PNHL-QKH9jByz-BVKajMNG.js +1 -0
  24. package/dist/assets/{chunk-QN33PNHL-CHu6LVbN.js → chunk-QN33PNHL-xEzemp3c.js} +1 -1
  25. package/dist/assets/{chunk-QZHKN3VN-CVAEdzef-CICjYRZu.js → chunk-QZHKN3VN-BPpgPA2g-DfaPwKB_.js} +1 -1
  26. package/dist/assets/{chunk-QZHKN3VN-DOlyc5a_.js → chunk-QZHKN3VN-DmaRauNH.js} +1 -1
  27. package/dist/assets/{chunk-TZMSLE5B-qgYeZfVw.js → chunk-TZMSLE5B-Bx7Kyzw7.js} +1 -1
  28. package/dist/assets/{chunk-TZMSLE5B-Cc8_PJIq-DBNHj8Jc.js → chunk-TZMSLE5B-Coq49FaX-CdOY_0Y9.js} +1 -1
  29. package/dist/assets/classDiagram-2ON5EDUG-DDdP3lEc.js +1 -0
  30. package/dist/assets/classDiagram-2ON5EDUG-DYaKkEXb-BMs1bhMY.js +1 -0
  31. package/dist/assets/classDiagram-v2-WZHVMYZB-DDdP3lEc.js +1 -0
  32. package/dist/assets/classDiagram-v2-WZHVMYZB-DYaKkEXb-BMs1bhMY.js +1 -0
  33. package/dist/assets/clone-B4FGNCC9.js +1 -0
  34. package/dist/assets/clone-Ctm6tjrV-cgncjIrI.js +1 -0
  35. package/dist/assets/code-block-37QAKDTI-3zaK1Sok-DkWCKnjc.js +2 -0
  36. package/dist/assets/{cose-bilkent-S5V4N54A-aMn5Snue.js → cose-bilkent-S5V4N54A-OjaorTGT.js} +1 -1
  37. package/dist/assets/{cose-bilkent-S5V4N54A-0O3dLIoy-Au1JV0Hr.js → cose-bilkent-S5V4N54A-iUMgKFJZ-CcWe6Gov.js} +1 -1
  38. package/dist/assets/{cytoscape.esm-CjI2IsL8-U70Mzu-N.js → cytoscape.esm-Cvf3sx9F-DgU3JdRZ.js} +1 -1
  39. package/dist/assets/{dagre-6UL2VRFP-C0nN6YID.js → dagre-6UL2VRFP-BLazRBE2.js} +1 -1
  40. package/dist/assets/dagre-6UL2VRFP-CKc2IEbO-CPlhk_ig.js +4 -0
  41. package/dist/assets/{diagram-PSM6KHXK-DhvTMswv.js → diagram-PSM6KHXK-Cz_Zed26.js} +1 -1
  42. package/dist/assets/diagram-PSM6KHXK-DERIvROx-B9mGRCGq.js +24 -0
  43. package/dist/assets/diagram-QEK2KX5R-B6CdcylU-lSCL2dm4.js +43 -0
  44. package/dist/assets/{diagram-QEK2KX5R-w4lZ6XEJ.js → diagram-QEK2KX5R-BAMwQLy8.js} +1 -1
  45. package/dist/assets/diagram-S2PKOQOG-5f_4uCtF-CUC-ZBue.js +24 -0
  46. package/dist/assets/{diagram-S2PKOQOG-DOXHCu2g.js → diagram-S2PKOQOG-v5vZ9P70.js} +1 -1
  47. package/dist/assets/{erDiagram-Q2GNP2WA-CXv6THpi-Cd4jg1J5.js → erDiagram-Q2GNP2WA-CnN7DF_N-yqb-l1CZ.js} +5 -5
  48. package/dist/assets/{erDiagram-Q2GNP2WA-B0P-TPNi.js → erDiagram-Q2GNP2WA-DFCKi0mZ.js} +1 -1
  49. package/dist/assets/{flowDiagram-NV44I4VS-KDzE7AT1.js → flowDiagram-NV44I4VS-3Rq7lbgS.js} +1 -1
  50. package/dist/assets/flowDiagram-NV44I4VS-Dl3ZZj2W-C9K7yiSN.js +162 -0
  51. package/dist/assets/{ganttDiagram-JELNMOA3-Ce3vKfsr.js → ganttDiagram-JELNMOA3-D76DQdCK.js} +1 -1
  52. package/dist/assets/{ganttDiagram-JELNMOA3-CqVYbgbk-Dm-Q7o3L.js → ganttDiagram-JELNMOA3-q87tSGGF-CKPOItTI.js} +1 -1
  53. package/dist/assets/{gitGraphDiagram-NY62KEGX-DDQ3wMsb.js → gitGraphDiagram-NY62KEGX-Db2iqJeU.js} +1 -1
  54. package/dist/assets/gitGraphDiagram-NY62KEGX-NeHUXng4-DDlIETSy.js +65 -0
  55. package/dist/assets/{graph-CIQI-Qnx.js → graph-D9RB6DwV.js} +1 -1
  56. package/dist/assets/{graph-rt_wscbL-BYOC6Zos.js → graph-Da1z0n_J-yJ-tLMG7.js} +1 -1
  57. package/dist/assets/index-B7GqH6If.js +2542 -0
  58. package/dist/assets/index-Blg_AJgc.css +1 -0
  59. package/dist/assets/{infoDiagram-WHAUD3N6-CKi2MdjK.js → infoDiagram-WHAUD3N6-CgNeND0m.js} +1 -1
  60. package/dist/assets/infoDiagram-WHAUD3N6-Cj-s-gtw-B2FbdsVb.js +2 -0
  61. package/dist/assets/{journeyDiagram-XKPGCS4Q-BzZgPZwu-FS4BVd7N.js → journeyDiagram-XKPGCS4Q-BbXXFBC--Cb6ONhr6.js} +4 -4
  62. package/dist/assets/{journeyDiagram-XKPGCS4Q-C8gYN3B8.js → journeyDiagram-XKPGCS4Q-D0meuzwF.js} +1 -1
  63. package/dist/assets/{kanban-definition-3W4ZIXB7-CJBvuSy_.js → kanban-definition-3W4ZIXB7-BCx2MTD3.js} +1 -1
  64. package/dist/assets/kanban-definition-3W4ZIXB7-ClCUbNCO-DyL1fJFZ.js +89 -0
  65. package/dist/assets/{layout-CX9neEHw-DZXKxUst.js → layout-BoJlbrAK-CAQ1YqzH.js} +1 -1
  66. package/dist/assets/{layout-BoDR3kQT.js → layout-DFWNR-Y1.js} +1 -1
  67. package/dist/assets/{linear-CkUVga7d-DcwQdvDv.js → linear-4rmylyIU-DexK5wO7.js} +1 -1
  68. package/dist/assets/min-C8aXS73f-D0DvW8t2.js +1 -0
  69. package/dist/assets/{min-USsdh-HW.js → min-CRMSN7nx.js} +1 -1
  70. package/dist/assets/{mindmap-definition-VGOIOE7T-CahlRCoo.js → mindmap-definition-VGOIOE7T-BGABgSVt.js} +1 -1
  71. package/dist/assets/mindmap-definition-VGOIOE7T-BRNm-2aJ-DQQO6TMa.js +68 -0
  72. package/dist/assets/{pieDiagram-ADFJNKIX-B3ej6Rof.js → pieDiagram-ADFJNKIX-BAPQcD4y.js} +1 -1
  73. package/dist/assets/pieDiagram-ADFJNKIX-BVRqurYx-QWWibrkj.js +30 -0
  74. package/dist/assets/quadrantDiagram-AYHSOK5B-CcsZBY3e-DjxqpMlH.js +7 -0
  75. package/dist/assets/{quadrantDiagram-AYHSOK5B-Di2kSbDD.js → quadrantDiagram-AYHSOK5B-kNxQZTX1.js} +1 -1
  76. package/dist/assets/{requirementDiagram-UZGBJVZJ-BIKMHzOU.js → requirementDiagram-UZGBJVZJ-BZ08al2Y.js} +1 -1
  77. package/dist/assets/{requirementDiagram-UZGBJVZJ-MnXD59Yw-DoLLmzEr.js → requirementDiagram-UZGBJVZJ-CV5SUGj--Crvo94rv.js} +7 -7
  78. package/dist/assets/{sankeyDiagram-TZEHDZUN-Dfyu7oJ6-upd_w6uL.js → sankeyDiagram-TZEHDZUN-BFPvVGcz-DAajH7lE.js} +8 -8
  79. package/dist/assets/{sankeyDiagram-TZEHDZUN-B45aWneB.js → sankeyDiagram-TZEHDZUN-BQT0X4qe.js} +1 -1
  80. package/dist/assets/{sequenceDiagram-WL72ISMW-0WGvejjk.js → sequenceDiagram-WL72ISMW-BcmegQjZ.js} +1 -1
  81. package/dist/assets/sequenceDiagram-WL72ISMW-CQ5u3b_o-B7RzlL6P.js +145 -0
  82. package/dist/assets/{stateDiagram-FKZM4ZOC-CyN90BQP.js → stateDiagram-FKZM4ZOC-C-u3YY-3.js} +1 -1
  83. package/dist/assets/{stateDiagram-FKZM4ZOC-DYV-na53-BrTgUi_v.js → stateDiagram-FKZM4ZOC-zOb-V3pD-D2k2TVkN.js} +1 -1
  84. package/dist/assets/stateDiagram-v2-4FDKWEC3-CvvobAsa.js +1 -0
  85. package/dist/assets/stateDiagram-v2-4FDKWEC3-_Mzc1jVl-lAsEHEbp.js +1 -0
  86. package/dist/assets/timeline-definition-IT6M3QCI-B2T2QrC5-eoEFP1Po.js +61 -0
  87. package/dist/assets/{timeline-definition-IT6M3QCI-B_SrPNXx.js → timeline-definition-IT6M3QCI-Dx4HH0C5.js} +1 -1
  88. package/dist/assets/{treemap-KMMF4GRG-Bj5u1csA.js → treemap-KMMF4GRG-DfaADvmb.js} +1 -1
  89. package/dist/assets/{treemap-KMMF4GRG-l6HrdCLC-BpLaQV_H.js → treemap-KMMF4GRG-wB3pBnFc-DQrUn2c6.js} +59 -59
  90. package/dist/assets/{xychartDiagram-PRI3JC2R-CkfCv2o_-BblxmbGy.js → xychartDiagram-PRI3JC2R-BSPghzKh-CYIgkUk9.js} +3 -3
  91. package/dist/assets/{xychartDiagram-PRI3JC2R-Ca3wGEm0.js → xychartDiagram-PRI3JC2R-DusIzSwm.js} +1 -1
  92. package/dist/index.html +2 -2
  93. package/package.json +4 -7
  94. package/dist/assets/_baseUniq-KSDS6tgF-vSUSx1j2.js +0 -1
  95. package/dist/assets/arc-C-X5Xt_b-DxNTmc8E.js +0 -1
  96. package/dist/assets/architectureDiagram-VXUJARFQ-Bal8NTn4-C3CDAmmj.js +0 -36
  97. package/dist/assets/blockDiagram-VD42YOAC-B2gTo5wW-Chk-bWEZ.js +0 -122
  98. package/dist/assets/c4Diagram-YG6GDRKO-dIf_vNCY-B78U9OXb.js +0 -10
  99. package/dist/assets/channel-CXjddKEr.js +0 -1
  100. package/dist/assets/channel-klR7o7JB-D3KnrQ1u.js +0 -1
  101. package/dist/assets/chunk-4BX2VUAB-BQgzc1Sm-3MUJBN6J.js +0 -1
  102. package/dist/assets/chunk-DI55MBZ5-BwHLqSW9-Dg6tgfWJ.js +0 -220
  103. package/dist/assets/chunk-QN33PNHL-DHNejhbC-DbJMzG-e.js +0 -1
  104. package/dist/assets/classDiagram-2ON5EDUG-Cf3QVtDa.js +0 -1
  105. package/dist/assets/classDiagram-2ON5EDUG-D7bjndmT-0h2otGW6.js +0 -1
  106. package/dist/assets/classDiagram-v2-WZHVMYZB-Cf3QVtDa.js +0 -1
  107. package/dist/assets/classDiagram-v2-WZHVMYZB-D7bjndmT-0h2otGW6.js +0 -1
  108. package/dist/assets/clone-7srXemyd-DGxkCAtg.js +0 -1
  109. package/dist/assets/clone-DZrMJ9hz.js +0 -1
  110. package/dist/assets/code-block-37QAKDTI-MRm4xHKr-DLRpbM4W.js +0 -2
  111. package/dist/assets/dagre-6UL2VRFP-BqaZre9N-vdYA4a1q.js +0 -4
  112. package/dist/assets/diagram-PSM6KHXK-s2xYLlND-B6BOy07D.js +0 -24
  113. package/dist/assets/diagram-QEK2KX5R-D700jvoY-tTlqymfs.js +0 -43
  114. package/dist/assets/diagram-S2PKOQOG-BkgBSa1Q-59esupTS.js +0 -24
  115. package/dist/assets/flowDiagram-NV44I4VS-Dsrv00Gy-Cz-kjEu8.js +0 -162
  116. package/dist/assets/gitGraphDiagram-NY62KEGX-DOanbk62-D2EAn-OM.js +0 -65
  117. package/dist/assets/index-BXRJOAs4.js +0 -2540
  118. package/dist/assets/index-C5i0a-mH.css +0 -1
  119. package/dist/assets/infoDiagram-WHAUD3N6-Fq8ToFQ6-BmtVQ1WU.js +0 -2
  120. package/dist/assets/kanban-definition-3W4ZIXB7-CrmrjRAg-BJFHq-Xg.js +0 -89
  121. package/dist/assets/min-Ar5ebLd--DYc60i1a.js +0 -1
  122. package/dist/assets/mindmap-definition-VGOIOE7T-DeGZNL21-hbAsMota.js +0 -68
  123. package/dist/assets/pieDiagram-ADFJNKIX-C_V2NX6O-BNls6JWQ.js +0 -30
  124. package/dist/assets/quadrantDiagram-AYHSOK5B-B8fSnYQi-BEGj5HDN.js +0 -7
  125. package/dist/assets/sequenceDiagram-WL72ISMW-D2pgAoWi-CIx9uPOq.js +0 -145
  126. package/dist/assets/stateDiagram-v2-4FDKWEC3-Kp4sxr9o--i7eh5f-.js +0 -1
  127. package/dist/assets/stateDiagram-v2-4FDKWEC3-yJXh1tES.js +0 -1
  128. package/dist/assets/timeline-definition-IT6M3QCI-621ePKJ0-i5oeWE__.js +0 -61
  129. /package/dist/assets/{ordinal-DfAQgscy-Pc8f3NoK.js → ordinal-B6-f3MAq-Pc8f3NoK.js} +0 -0
@@ -1,220 +0,0 @@
1
- import{g as Jt}from"./chunk-55IACEB6-Dd3NjClm-icx5kZVe.js";import{d as te}from"./chunk-QN33PNHL-DHNejhbC-DbJMzG-e.js";import{H as d,a as T,z as P,am as ee,an as se,a9 as ie,aa as re,a8 as ae,a7 as ne,ao as oe,ap as le,bg as ce,ah as K,au as he}from"./index-BXRJOAs4.js";var Dt=(function(){var t=d(function(B,r,a,y){for(a=a||{},y=B.length;y--;a[B[y]]=r);return a},"o"),e=[1,2],n=[1,3],s=[1,4],c=[2,4],o=[1,9],f=[1,11],m=[1,16],u=[1,17],g=[1,18],E=[1,19],S=[1,33],O=[1,20],A=[1,21],R=[1,22],D=[1,23],I=[1,24],h=[1,26],$=[1,27],v=[1,28],w=[1,29],z=[1,30],Y=[1,31],G=[1,32],it=[1,35],rt=[1,36],at=[1,37],nt=[1,38],V=[1,34],p=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ot=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Ct=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],St={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:d(function(B,r,a,y,_,i,x){var l=i.length-1;switch(_){case 3:return y.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=y.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=y.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var M=i[l],X=i[l-2].trim();if(i[l].match(":")){var ct=i[l].split(":");M=ct[0],X=[X,ct[1]]}this.$={stmt:"state",id:M,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:y.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),y.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),y.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:y.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:y.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:y.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:y.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:n,6:s},{1:[3]},{3:5,4:e,5:n,6:s},{3:6,4:e,5:n,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:f,8:8,9:10,10:12,11:13,12:14,13:15,16:m,17:u,19:g,22:E,24:S,25:O,26:A,27:R,28:D,29:I,32:25,33:h,35:$,37:v,38:w,41:z,45:Y,48:G,51:it,52:rt,53:at,54:nt,57:V},t(p,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:m,17:u,19:g,22:E,24:S,25:O,26:A,27:R,28:D,29:I,32:25,33:h,35:$,37:v,38:w,41:z,45:Y,48:G,51:it,52:rt,53:at,54:nt,57:V},t(p,[2,7]),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(p,[2,11]),t(p,[2,12],{14:[1,40],15:[1,41]}),t(p,[2,16]),{18:[1,42]},t(p,[2,18],{20:[1,43]}),{23:[1,44]},t(p,[2,22]),t(p,[2,23]),t(p,[2,24]),t(p,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(p,[2,28]),{34:[1,49]},{36:[1,50]},t(p,[2,31]),{13:51,24:S,57:V},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ot,[2,44],{58:[1,56]}),t(ot,[2,45],{58:[1,57]}),t(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,41]),t(p,[2,6]),t(p,[2,13]),{13:58,24:S,57:V},t(p,[2,17]),t(Ct,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(p,[2,29]),t(p,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(p,[2,14],{14:[1,71]}),{4:o,5:f,8:8,9:10,10:12,11:13,12:14,13:15,16:m,17:u,19:g,21:[1,72],22:E,24:S,25:O,26:A,27:R,28:D,29:I,32:25,33:h,35:$,37:v,38:w,41:z,45:Y,48:G,51:it,52:rt,53:at,54:nt,57:V},t(p,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(p,[2,34]),t(p,[2,35]),t(p,[2,36]),t(p,[2,37]),t(ot,[2,46]),t(ot,[2,47]),t(p,[2,15]),t(p,[2,19]),t(Ct,c,{7:78}),t(p,[2,26]),t(p,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:f,8:8,9:10,10:12,11:13,12:14,13:15,16:m,17:u,19:g,21:[1,81],22:E,24:S,25:O,26:A,27:R,28:D,29:I,32:25,33:h,35:$,37:v,38:w,41:z,45:Y,48:G,51:it,52:rt,53:at,54:nt,57:V},t(p,[2,32]),t(p,[2,33]),t(p,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:d(function(B,r){if(r.recoverable)this.trace(B);else{var a=new Error(B);throw a.hash=r,a}},"parseError"),parse:d(function(B){var r=this,a=[0],y=[],_=[null],i=[],x=this.table,l="",M=0,X=0,ct=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),W={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&(W.yy[mt]=this.yy[mt]);b.setInput(B,W.yy),W.yy.lexer=b,W.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var _t=b.yylloc;i.push(_t);var qt=b.options&&b.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Qt(L){a.length=a.length-2*L,_.length=_.length-L,i.length=i.length-L}d(Qt,"popStack");function $t(){var L;return L=y.pop()||b.lex()||Q,typeof L!="number"&&(L instanceof Array&&(y=L,L=y.pop()),L=r.symbols_[L]||L),L}d($t,"lex");for(var C,U,N,Tt,H={},ht,F,Lt,dt;;){if(U=a[a.length-1],this.defaultActions[U]?N=this.defaultActions[U]:((C===null||typeof C>"u")&&(C=$t()),N=x[U]&&x[U][C]),typeof N>"u"||!N.length||!N[0]){var bt="";dt=[];for(ht in x[U])this.terminals_[ht]&&ht>ct&&dt.push("'"+this.terminals_[ht]+"'");b.showPosition?bt="Parse error on line "+(M+1)+`:
2
- `+b.showPosition()+`
3
- Expecting `+dt.join(", ")+", got '"+(this.terminals_[C]||C)+"'":bt="Parse error on line "+(M+1)+": Unexpected "+(C==Q?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(bt,{text:b.match,token:this.terminals_[C]||C,line:b.yylineno,loc:_t,expected:dt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+C);switch(N[0]){case 1:a.push(C),_.push(b.yytext),i.push(b.yylloc),a.push(N[1]),C=null,X=b.yyleng,l=b.yytext,M=b.yylineno,_t=b.yylloc;break;case 2:if(F=this.productions_[N[1]][1],H.$=_[_.length-F],H._$={first_line:i[i.length-(F||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(F||1)].first_column,last_column:i[i.length-1].last_column},qt&&(H._$.range=[i[i.length-(F||1)].range[0],i[i.length-1].range[1]]),Tt=this.performAction.apply(H,[l,X,M,W.yy,N[1],_,i].concat(gt)),typeof Tt<"u")return Tt;F&&(a=a.slice(0,-1*F*2),_=_.slice(0,-1*F),i=i.slice(0,-1*F)),a.push(this.productions_[N[1]][0]),_.push(H.$),i.push(H._$),Lt=x[a[a.length-2]][a[a.length-1]],a.push(Lt);break;case 3:return!0}}return!0},"parse")},Zt=(function(){var B={EOF:1,parseError:d(function(r,a){if(this.yy.parser)this.yy.parser.parseError(r,a);else throw new Error(r)},"parseError"),setInput:d(function(r,a){return this.yy=a||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:d(function(r){var a=r.length,y=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var _=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),y.length-1&&(this.yylineno-=y.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:y?(y.length===_.length?this.yylloc.first_column:0)+_[_.length-y.length].length-y[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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
- `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(r){this.unput(this.match.slice(r))},"less"),pastInput:d(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
5
- `+a+"^"},"showPosition"),test_match:d(function(r,a){var y,_,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[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,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(r[0].length),this.matched+=r[0],y=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),y)return y;if(this._backtrack){for(var x in i)this[x]=i[x];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,a,y,_;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),x=0;x<i.length;x++)if(y=this._input.match(this.rules[i[x]]),y&&(!a||y[0].length>a[0].length)){if(a=y,_=x,this.options.backtrack_lexer){if(r=this.test_match(y,i[x]),r!==!1)return r;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(r=this.test_match(a,i[_]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var r=this.next();return r||this.lex()},"lex"),begin:d(function(r){this.conditionStack.push(r)},"begin"),popState:d(function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(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:d(function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},"topState"),pushState:d(function(r){this.begin(r)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(r,a,y,_){switch(y){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:break;case 9:break;case 10:return 5;case 11:break;case 12:break;case 13:break;case 14:break;case 15:return this.pushState("SCALE"),17;case 16:return 18;case 17:this.popState();break;case 18:return this.begin("acc_title"),33;case 19:return this.popState(),"acc_title_value";case 20:return this.begin("acc_descr"),35;case 21:return this.popState(),"acc_descr_value";case 22:this.begin("acc_descr_multiline");break;case 23:this.popState();break;case 24:return"acc_descr_multiline_value";case 25:return this.pushState("CLASSDEF"),41;case 26:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 27:return this.popState(),this.pushState("CLASSDEFID"),42;case 28:return this.popState(),43;case 29:return this.pushState("CLASS"),48;case 30:return this.popState(),this.pushState("CLASS_STYLE"),49;case 31:return this.popState(),50;case 32:return this.pushState("STYLE"),45;case 33:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 34:return this.popState(),47;case 35:return this.pushState("SCALE"),17;case 36:return 18;case 37:this.popState();break;case 38:this.pushState("STATE");break;case 39:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;case 45:return 51;case 46:return 52;case 47:return 53;case 48:return 54;case 49:this.pushState("STATE_STRING");break;case 50:return this.pushState("STATE_ID"),"AS";case 51:return this.popState(),"ID";case 52:this.popState();break;case 53:return"STATE_DESCR";case 54:return 19;case 55:this.popState();break;case 56:return this.popState(),this.pushState("struct"),20;case 57:break;case 58:return this.popState(),21;case 59:break;case 60:return this.begin("NOTE"),29;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:return this.popState(),this.pushState("NOTE_ID"),60;case 63:this.popState(),this.pushState("FLOATING_NOTE");break;case 64:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:break;case 66:return"NOTE_TEXT";case 67:return this.popState(),"ID";case 68:return this.popState(),this.pushState("NOTE_TEXT"),24;case 69:return this.popState(),a.yytext=a.yytext.substr(2).trim(),31;case 70:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),31;case 71:return 6;case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return a.yytext=a.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 80:return 5;case 81:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}};return B})();St.lexer=Zt;function lt(){this.yy={}}return d(lt,"Parser"),lt.prototype=St,St.Parser=lt,new lt})();Dt.parser=Dt;var Ye=Dt,de="TB",Pt="TB",At="dir",q="state",Z="root",vt="relation",ue="classDef",pe="style",ye="applyClass",et="default",Ft="divider",Yt="fill:none",Gt="fill: #333",jt="c",zt="text",Mt="normal",kt="rect",Et="rectWithTitle",fe="stateStart",Se="stateEnd",It="divider",Nt="roundedWithTitle",ge="note",me="noteGroup",st="statediagram",_e="state",Te=`${st}-${_e}`,Wt="transition",be="note",ke="note-edge",Ee=`${Wt} ${ke}`,De=`${st}-${be}`,ve="cluster",xe=`${st}-${ve}`,Ce="cluster-alt",$e=`${st}-${Ce}`,Ut="parent",Kt="note",Le="state",xt="----",Ae=`${xt}${Kt}`,Ot=`${xt}${Ut}`,Vt=d((t,e=Pt)=>{if(!t.doc)return e;let n=e;for(const s of t.doc)s.stmt==="dir"&&(n=s.value);return n},"getDir"),Ie=d(function(t,e){return e.db.getClasses()},"getClasses"),Ne=d(async function(t,e,n,s){T.info("REF0:"),T.info("Drawing state diagram (v2)",e);const{securityLevel:c,state:o,layout:f}=P();s.db.extract(s.db.getRootDocV2());const m=s.db.getData(),u=Jt(e,c);m.type=s.type,m.layoutAlgorithm=f,m.nodeSpacing=o?.nodeSpacing||50,m.rankSpacing=o?.rankSpacing||50,m.markers=["barb"],m.diagramId=e,await ee(m,u);const g=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((E,S)=>{var O;const A=typeof S=="string"?S:typeof S?.id=="string"?S.id:"";if(!A){T.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(S));return}const R=(O=u.node())==null?void 0:O.querySelectorAll("g");let D;if(R?.forEach(v=>{var w;((w=v.textContent)==null?void 0:w.trim())===A&&(D=v)}),!D){T.warn("⚠️ Could not find node matching text:",A);return}const I=D.parentNode;if(!I){T.warn("⚠️ Node has no parent, cannot wrap:",A);return}const h=document.createElementNS("http://www.w3.org/2000/svg","a"),$=E.url.replace(/^"+|"+$/g,"");if(h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",$),h.setAttribute("target","_blank"),E.tooltip){const v=E.tooltip.replace(/^"+|"+$/g,"");h.setAttribute("title",v)}I.replaceChild(h,D),h.appendChild(D),T.info("🔗 Wrapped node in <a> tag for:",A,E.url)})}catch(E){T.error("❌ Error injecting clickable links:",E)}se.insertTitle(u,"statediagramTitleText",o?.titleTopMargin??25,s.db.getDiagramTitle()),te(u,g,st,o?.useMaxWidth??!0)},"draw"),Ge={getClasses:Ie,draw:Ne,getDir:Vt},yt=new Map,j=0;function ft(t="",e=0,n="",s=xt){const c=n!==null&&n.length>0?`${s}${n}`:"";return`${Le}-${t}${c}-${e}`}d(ft,"stateDomId");var Oe=d((t,e,n,s,c,o,f,m)=>{T.trace("items",e),e.forEach(u=>{switch(u.stmt){case q:tt(t,u,n,s,c,o,f,m);break;case et:tt(t,u,n,s,c,o,f,m);break;case vt:{tt(t,u.state1,n,s,c,o,f,m),tt(t,u.state2,n,s,c,o,f,m);const g={id:"edge"+j,start:u.state1.id,end:u.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:Yt,labelStyle:"",label:K.sanitizeText(u.description??"",P()),arrowheadStyle:Gt,labelpos:jt,labelType:zt,thickness:Mt,classes:Wt,look:f};c.push(g),j++}break}})},"setupDoc"),Rt=d((t,e=Pt)=>{let n=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(n=s.value);return n},"getDir");function J(t,e,n){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(c=>{const o=n.get(c);o&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...o.styles])}));const s=t.find(c=>c.id===e.id);s?Object.assign(s,e):t.push(e)}d(J,"insertOrUpdateNode");function Xt(t){var e;return((e=t?.classes)==null?void 0:e.join(" "))??""}d(Xt,"getClassesFromDbInfo");function Ht(t){return t?.styles??[]}d(Ht,"getStylesFromDbInfo");var tt=d((t,e,n,s,c,o,f,m)=>{var u,g,E;const S=e.id,O=n.get(S),A=Xt(O),R=Ht(O),D=P();if(T.info("dataFetcher parsedItem",e,O,R),S!=="root"){let I=kt;e.start===!0?I=fe:e.start===!1&&(I=Se),e.type!==et&&(I=e.type),yt.get(S)||yt.set(S,{id:S,shape:I,description:K.sanitizeText(S,D),cssClasses:`${A} ${Te}`,cssStyles:R});const h=yt.get(S);e.description&&(Array.isArray(h.description)?(h.shape=Et,h.description.push(e.description)):(u=h.description)!=null&&u.length&&h.description.length>0?(h.shape=Et,h.description===S?h.description=[e.description]:h.description=[h.description,e.description]):(h.shape=kt,h.description=e.description),h.description=K.sanitizeTextOrArray(h.description,D)),((g=h.description)==null?void 0:g.length)===1&&h.shape===Et&&(h.type==="group"?h.shape=Nt:h.shape=kt),!h.type&&e.doc&&(T.info("Setting cluster for XCX",S,Rt(e)),h.type="group",h.isGroup=!0,h.dir=Rt(e),h.shape=e.type===Ft?It:Nt,h.cssClasses=`${h.cssClasses} ${xe} ${o?$e:""}`);const $={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:S,dir:h.dir,domId:ft(S,j),type:h.type,isGroup:h.type==="group",padding:8,rx:10,ry:10,look:f};if($.shape===It&&($.label=""),t&&t.id!=="root"&&(T.trace("Setting node ",S," to be child of its parent ",t.id),$.parentId=t.id),$.centerLabel=!0,e.note){const v={labelStyle:"",shape:ge,label:e.note.text,cssClasses:De,cssStyles:[],cssCompiledStyles:[],id:S+Ae+"-"+j,domId:ft(S,j,Kt),type:h.type,isGroup:h.type==="group",padding:(E=D.flowchart)==null?void 0:E.padding,look:f,position:e.note.position},w=S+Ot,z={labelStyle:"",shape:me,label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:S+Ot,domId:ft(S,j,Ut),type:"group",isGroup:!0,padding:16,look:f,position:e.note.position};j++,z.id=w,v.parentId=w,J(s,z,m),J(s,v,m),J(s,$,m);let Y=S,G=v.id;e.note.position==="left of"&&(Y=v.id,G=S),c.push({id:Y+"-"+G,start:Y,end:G,arrowhead:"none",arrowTypeEnd:"",style:Yt,labelStyle:"",classes:Ee,arrowheadStyle:Gt,labelpos:jt,labelType:zt,thickness:Mt,look:f})}else J(s,$,m)}e.doc&&(T.trace("Adding nodes children "),Oe(e,e.doc,n,s,c,!o,f,m))},"dataFetcher"),Re=d(()=>{yt.clear(),j=0},"reset"),k={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},wt=d(()=>new Map,"newClassesList"),Bt=d(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ut=d(t=>JSON.parse(JSON.stringify(t)),"clone"),pt,je=(pt=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=wt(),this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=ie,this.setAccTitle=re,this.getAccDescription=ae,this.setAccDescription=ne,this.setDiagramTitle=oe,this.getDiagramTitle=le,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case q:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case vt:this.addRelation(s.state1,s.state2,s.description);break;case ue:this.addStyleClass(s.id.trim(),s.classes);break;case pe:this.handleStyleDef(s);break;case ye:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),n=P();Re(),tt(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,n.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),n=t.styleClass.split(",");for(const s of e){let c=this.getState(s);if(!c){const o=s.trim();this.addState(o),c=this.getState(o)}c&&(c.styles=n.map(o=>{var f;return(f=o.replace(/;/g,""))==null?void 0:f.trim()}))}}setRootDoc(t){T.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,n){if(e.stmt===vt){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===q&&(e.id===k.START_NODE?(e.id=t.id+(n?"_start":"_end"),e.start=n):e.id=e.id.trim()),e.stmt!==Z&&e.stmt!==q||!e.doc)return;const s=[];let c=[];for(const o of e.doc)if(o.type===Ft){const f=ut(o);f.doc=ut(c),s.push(f),c=[]}else c.push(o);if(s.length>0&&c.length>0){const o={stmt:q,id:ce(),type:"divider",doc:ut(c)};s.push(ut(o)),e.doc=s}e.doc.forEach(o=>this.docTranslator(e,o,!0))}getRootDocV2(){return this.docTranslator({id:Z,stmt:Z},{id:Z,stmt:Z,doc:this.rootDoc},!0),{id:Z,doc:this.rootDoc}}addState(t,e=et,n=void 0,s=void 0,c=void 0,o=void 0,f=void 0,m=void 0){const u=t?.trim();if(!this.currentDocument.states.has(u))T.info("Adding state ",u,s),this.currentDocument.states.set(u,{stmt:q,id:u,descriptions:[],type:e,doc:n,note:c,classes:[],styles:[],textStyles:[]});else{const g=this.currentDocument.states.get(u);if(!g)throw new Error(`State not found: ${u}`);g.doc||(g.doc=n),g.type||(g.type=e)}if(s&&(T.info("Setting state description",u,s),(Array.isArray(s)?s:[s]).forEach(g=>this.addDescription(u,g.trim()))),c){const g=this.currentDocument.states.get(u);if(!g)throw new Error(`State not found: ${u}`);g.note=c,g.note.text=K.sanitizeText(g.note.text,P())}o&&(T.info("Setting state classes",u,o),(Array.isArray(o)?o:[o]).forEach(g=>this.setCssClass(u,g.trim()))),f&&(T.info("Setting state styles",u,f),(Array.isArray(f)?f:[f]).forEach(g=>this.setStyle(u,g.trim()))),m&&(T.info("Setting state styles",u,f),(Array.isArray(m)?m:[m]).forEach(g=>this.setTextStyle(u,g.trim())))}clear(t){this.nodes=[],this.edges=[],this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=wt(),t||(this.links=new Map,he())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){T.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,n){this.links.set(t,{url:e,tooltip:n}),T.warn("Adding link",t,e,n)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===k.START_NODE?(this.startEndCount++,`${k.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=et){return t===k.START_NODE?k.START_TYPE:e}endIdIfNeeded(t=""){return t===k.END_NODE?(this.startEndCount++,`${k.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=et){return t===k.END_NODE?k.END_TYPE:e}addRelationObjs(t,e,n=""){const s=this.startIdIfNeeded(t.id.trim()),c=this.startTypeIfNeeded(t.id.trim(),t.type),o=this.startIdIfNeeded(e.id.trim()),f=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,c,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(o,f,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:o,relationTitle:K.sanitizeText(n,P())})}addRelation(t,e,n){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,n);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),c=this.startTypeIfNeeded(t),o=this.endIdIfNeeded(e.trim()),f=this.endTypeIfNeeded(e);this.addState(s,c),this.addState(o,f),this.currentDocument.relations.push({id1:s,id2:o,relationTitle:n?K.sanitizeText(n,P()):void 0})}}addDescription(t,e){var n;const s=this.currentDocument.states.get(t),c=e.startsWith(":")?e.replace(":","").trim():e;(n=s?.descriptions)==null||n.push(K.sanitizeText(c,P()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const n=this.classes.get(t);e&&n&&e.split(k.STYLECLASS_SEP).forEach(s=>{const c=s.replace(/([^;]*);/,"$1").trim();if(RegExp(k.COLOR_KEYWORD).exec(s)){const o=c.replace(k.FILL_KEYWORD,k.BG_FILL).replace(k.COLOR_KEYWORD,k.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(c)})}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach(n=>{var s;let c=this.getState(n);if(!c){const o=n.trim();this.addState(o),c=this.getState(o)}(s=c?.classes)==null||s.push(e)})}setStyle(t,e){var n,s;(s=(n=this.getState(t))==null?void 0:n.styles)==null||s.push(e)}setTextStyle(t,e){var n,s;(s=(n=this.getState(t))==null?void 0:n.textStyles)==null||s.push(e)}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===At)}getDirection(){var t;return((t=this.getDirectionStatement())==null?void 0:t.value)??de}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:At,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=P();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:Vt(this.getRootDocV2())}}getConfig(){return P().state}},d(pt,"StateDB"),pt.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},pt),we=d(t=>`
7
- defs #statediagram-barbEnd {
8
- fill: ${t.transitionColor};
9
- stroke: ${t.transitionColor};
10
- }
11
- g.stateGroup text {
12
- fill: ${t.nodeBorder};
13
- stroke: none;
14
- font-size: 10px;
15
- }
16
- g.stateGroup text {
17
- fill: ${t.textColor};
18
- stroke: none;
19
- font-size: 10px;
20
-
21
- }
22
- g.stateGroup .state-title {
23
- font-weight: bolder;
24
- fill: ${t.stateLabelColor};
25
- }
26
-
27
- g.stateGroup rect {
28
- fill: ${t.mainBkg};
29
- stroke: ${t.nodeBorder};
30
- }
31
-
32
- g.stateGroup line {
33
- stroke: ${t.lineColor};
34
- stroke-width: 1;
35
- }
36
-
37
- .transition {
38
- stroke: ${t.transitionColor};
39
- stroke-width: 1;
40
- fill: none;
41
- }
42
-
43
- .stateGroup .composit {
44
- fill: ${t.background};
45
- border-bottom: 1px
46
- }
47
-
48
- .stateGroup .alt-composit {
49
- fill: #e0e0e0;
50
- border-bottom: 1px
51
- }
52
-
53
- .state-note {
54
- stroke: ${t.noteBorderColor};
55
- fill: ${t.noteBkgColor};
56
-
57
- text {
58
- fill: ${t.noteTextColor};
59
- stroke: none;
60
- font-size: 10px;
61
- }
62
- }
63
-
64
- .stateLabel .box {
65
- stroke: none;
66
- stroke-width: 0;
67
- fill: ${t.mainBkg};
68
- opacity: 0.5;
69
- }
70
-
71
- .edgeLabel .label rect {
72
- fill: ${t.labelBackgroundColor};
73
- opacity: 0.5;
74
- }
75
- .edgeLabel {
76
- background-color: ${t.edgeLabelBackground};
77
- p {
78
- background-color: ${t.edgeLabelBackground};
79
- }
80
- rect {
81
- opacity: 0.5;
82
- background-color: ${t.edgeLabelBackground};
83
- fill: ${t.edgeLabelBackground};
84
- }
85
- text-align: center;
86
- }
87
- .edgeLabel .label text {
88
- fill: ${t.transitionLabelColor||t.tertiaryTextColor};
89
- }
90
- .label div .edgeLabel {
91
- color: ${t.transitionLabelColor||t.tertiaryTextColor};
92
- }
93
-
94
- .stateLabel text {
95
- fill: ${t.stateLabelColor};
96
- font-size: 10px;
97
- font-weight: bold;
98
- }
99
-
100
- .node circle.state-start {
101
- fill: ${t.specialStateColor};
102
- stroke: ${t.specialStateColor};
103
- }
104
-
105
- .node .fork-join {
106
- fill: ${t.specialStateColor};
107
- stroke: ${t.specialStateColor};
108
- }
109
-
110
- .node circle.state-end {
111
- fill: ${t.innerEndBackground};
112
- stroke: ${t.background};
113
- stroke-width: 1.5
114
- }
115
- .end-state-inner {
116
- fill: ${t.compositeBackground||t.background};
117
- // stroke: ${t.background};
118
- stroke-width: 1.5
119
- }
120
-
121
- .node rect {
122
- fill: ${t.stateBkg||t.mainBkg};
123
- stroke: ${t.stateBorder||t.nodeBorder};
124
- stroke-width: 1px;
125
- }
126
- .node polygon {
127
- fill: ${t.mainBkg};
128
- stroke: ${t.stateBorder||t.nodeBorder};;
129
- stroke-width: 1px;
130
- }
131
- #statediagram-barbEnd {
132
- fill: ${t.lineColor};
133
- }
134
-
135
- .statediagram-cluster rect {
136
- fill: ${t.compositeTitleBackground};
137
- stroke: ${t.stateBorder||t.nodeBorder};
138
- stroke-width: 1px;
139
- }
140
-
141
- .cluster-label, .nodeLabel {
142
- color: ${t.stateLabelColor};
143
- // line-height: 1;
144
- }
145
-
146
- .statediagram-cluster rect.outer {
147
- rx: 5px;
148
- ry: 5px;
149
- }
150
- .statediagram-state .divider {
151
- stroke: ${t.stateBorder||t.nodeBorder};
152
- }
153
-
154
- .statediagram-state .title-state {
155
- rx: 5px;
156
- ry: 5px;
157
- }
158
- .statediagram-cluster.statediagram-cluster .inner {
159
- fill: ${t.compositeBackground||t.background};
160
- }
161
- .statediagram-cluster.statediagram-cluster-alt .inner {
162
- fill: ${t.altBackground?t.altBackground:"#efefef"};
163
- }
164
-
165
- .statediagram-cluster .inner {
166
- rx:0;
167
- ry:0;
168
- }
169
-
170
- .statediagram-state rect.basic {
171
- rx: 5px;
172
- ry: 5px;
173
- }
174
- .statediagram-state rect.divider {
175
- stroke-dasharray: 10,10;
176
- fill: ${t.altBackground?t.altBackground:"#efefef"};
177
- }
178
-
179
- .note-edge {
180
- stroke-dasharray: 5;
181
- }
182
-
183
- .statediagram-note rect {
184
- fill: ${t.noteBkgColor};
185
- stroke: ${t.noteBorderColor};
186
- stroke-width: 1px;
187
- rx: 0;
188
- ry: 0;
189
- }
190
- .statediagram-note rect {
191
- fill: ${t.noteBkgColor};
192
- stroke: ${t.noteBorderColor};
193
- stroke-width: 1px;
194
- rx: 0;
195
- ry: 0;
196
- }
197
-
198
- .statediagram-note text {
199
- fill: ${t.noteTextColor};
200
- }
201
-
202
- .statediagram-note .nodeLabel {
203
- color: ${t.noteTextColor};
204
- }
205
- .statediagram .edgeLabel {
206
- color: red; // ${t.noteTextColor};
207
- }
208
-
209
- #dependencyStart, #dependencyEnd {
210
- fill: ${t.lineColor};
211
- stroke: ${t.lineColor};
212
- stroke-width: 1;
213
- }
214
-
215
- .statediagramTitleText {
216
- text-anchor: middle;
217
- font-size: 18px;
218
- fill: ${t.textColor};
219
- }
220
- `,"getStyles"),ze=we;export{Ye as B,je as M,ze as U,Ge as V};
@@ -1 +0,0 @@
1
- import{H as a,ab as c,a as g}from"./index-BXRJOAs4.js";var l=a((i,t,o,e)=>{i.attr("class",o);const{width:h,height:d,x:n,y:s}=w(i,t);c(i,d,h,e);const r=x(n,s,h,d,t);i.attr("viewBox",r),g.debug(`viewBox configured: ${r} with padding: ${t}`)},"setupViewPortForSVG"),w=a((i,t)=>{var o;const e=((o=i.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:e.width+t*2,height:e.height+t*2,x:e.x,y:e.y}},"calculateDimensionsWithPadding"),x=a((i,t,o,e,h)=>`${i-h} ${t-h} ${o} ${e}`,"createViewBox");export{l as d};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-xLNbTmXA.js";import{bE as i}from"./index-BXRJOAs4.js";import"./chunk-FMBD7UC4-CN5kw4_J.js";import"./chunk-55IACEB6-Ccr-HMFu.js";import"./chunk-QN33PNHL-CHu6LVbN.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1 +0,0 @@
1
- import{D as t,F as s,T as a,k as e}from"./chunk-B4BG7PRW-DLUrgkJI-Cic_-nsr.js";import{H as o}from"./index-BXRJOAs4.js";import"./chunk-FMBD7UC4-6dsbMKM7-DZVEYpsF.js";import"./chunk-55IACEB6-Dd3NjClm-icx5kZVe.js";import"./chunk-QN33PNHL-DHNejhbC-DbJMzG-e.js";var d={parser:a,get db(){return new e},renderer:s,styles:t,init:o(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{d as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-xLNbTmXA.js";import{bE as i}from"./index-BXRJOAs4.js";import"./chunk-FMBD7UC4-CN5kw4_J.js";import"./chunk-55IACEB6-Ccr-HMFu.js";import"./chunk-QN33PNHL-CHu6LVbN.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1 +0,0 @@
1
- import{D as t,F as s,T as a,k as e}from"./chunk-B4BG7PRW-DLUrgkJI-Cic_-nsr.js";import{H as o}from"./index-BXRJOAs4.js";import"./chunk-FMBD7UC4-6dsbMKM7-DZVEYpsF.js";import"./chunk-55IACEB6-Dd3NjClm-icx5kZVe.js";import"./chunk-QN33PNHL-DHNejhbC-DbJMzG-e.js";var d={parser:a,get db(){return new e},renderer:s,styles:t,init:o(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{d as diagram};
@@ -1 +0,0 @@
1
- import{O as o}from"./graph-rt_wscbL-BYOC6Zos.js";var t=4;function n(r){return o(r,t)}export{n as a};
@@ -1 +0,0 @@
1
- import{b as r}from"./graph-CIQI-Qnx.js";var e=4;function a(o){return r(o,e)}export{a as c};
@@ -1,2 +0,0 @@
1
- import{by as n,bz as f,bA as h,bB as a,bC as x,bD as u}from"./index-BXRJOAs4.js";var k=u("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),p=n.memo(({children:t,result:e,language:o,className:c,...m})=>{let d=n.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]);return a.jsx("pre",{className:u(c,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":o,"data-streamdown":"code-block-body",style:d,...m,children:a.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:e.tokens.map((i,s)=>a.jsx("span",{className:k,children:i.map((r,l)=>a.jsx("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:r.color,backgroundColor:r.bgColor,...r.htmlStyle},...r.htmlAttrs,children:r.content},l))},s))})})},(t,e)=>t.result===e.result&&t.language===e.language&&t.className===e.className),j=({className:t,language:e,style:o,...c})=>a.jsx("div",{className:u("my-4 w-full overflow-hidden rounded-xl border border-border",t),"data-language":e,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...o},...c}),N=({language:t,children:e})=>a.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":t,"data-streamdown":"code-block-header",children:[a.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),a.jsx("div",{className:"flex items-center gap-2",children:e})]}),w=({code:t,language:e,className:o,children:c,...m})=>{let{shikiTheme:d}=n.useContext(f),i=h(),s=n.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:t.split(`
2
- `).map(g=>[{content:g,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[t]),[r,l]=n.useState(s);return n.useEffect(()=>{if(!i){l(s);return}let g=i.highlight({code:t,language:e,themes:d},b=>{l(b)});if(g){l(g);return}l(s)},[t,e,d,i,s]),a.jsx(x.Provider,{value:{code:t},children:a.jsxs(j,{language:e,children:[a.jsx(N,{language:e,children:c}),a.jsx(p,{className:o,language:e,result:r,...m})]})})};export{w as CodeBlock};
@@ -1,4 +0,0 @@
1
- import{H as v,Y as M,W as j,j as Y,V as F,a as t,z as L,D as H,q as V,m as _,k as q,_ as z,G as D,r as W,N as Z,T as $}from"./index-BXRJOAs4.js";import{X as k,_ as S}from"./graph-rt_wscbL-BYOC6Zos.js";import{B as K}from"./layout-CX9neEHw-DZXKxUst.js";import{a as Q}from"./clone-7srXemyd-DGxkCAtg.js";import{M as G}from"./min-Ar5ebLd--DYc60i1a.js";import"./_baseUniq-KSDS6tgF-vSUSx1j2.js";function X(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:U(e),edges:ee(e)};return S(e.graph())||(n.value=Q(e.graph())),n}function U(e){return G(e.nodes(),function(n){var r=e.node(n),s=e.parent(n),d={v:n};return S(r)||(d.value=r),S(s)||(d.parent=s),d})}function ee(e){return G(e.edges(),function(n){var r=e.edge(n),s={v:n.v,w:n.w};return S(n.name)||(s.name=n.name),S(r)||(s.value=r),s})}var u=new Map,E=new Map,B=new Map,ne=v(()=>{E.clear(),B.clear(),u.clear()},"clear"),I=v((e,n)=>{const r=E.get(n)||[];return t.trace("In isDescendant",n," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),re=v((e,n)=>{const r=E.get(n)||[];return t.info("Descendants of ",n," is ",r),t.info("Edge is ",e),e.v===n||e.w===n?!1:r?r.includes(e.v)||I(e.v,n)||I(e.w,n)||r.includes(e.w):(t.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),T=v((e,n,r,s)=>{t.warn("Copying children of ",e,"root",s,"data",n.node(e),s);const d=n.children(e)||[];e!==s&&d.push(e),t.warn("Copying (nodes) clusterId",e,"nodes",d),d.forEach(c=>{if(n.children(c).length>0)T(c,n,r,s);else{const a=n.node(c);t.info("cp ",c," to ",s," with parent ",e),r.setNode(c,a),s!==n.parent(c)&&(t.warn("Setting parent",c,n.parent(c)),r.setParent(c,n.parent(c))),e!==s&&c!==e?(t.debug("Setting parent",c,e),r.setParent(c,e)):(t.info("In copy ",e,"root",s,"data",n.node(e),s),t.debug("Not Setting parent for node=",c,"cluster!==rootId",e!==s,"node!==clusterId",c!==e));const l=n.edges(c);t.debug("Copying Edges",l),l.forEach(f=>{t.info("Edge",f);const N=n.edge(f.v,f.w,f.name);t.info("Edge data",N,s);try{re(f,s)?(t.info("Copying as ",f.v,f.w,N,f.name),r.setEdge(f.v,f.w,N,f.name),t.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):t.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",s," clusterId:",e)}catch(C){t.error(C)}})}t.debug("Removing node",c),n.removeNode(c)})},"copy"),J=v((e,n)=>{const r=n.children(e);let s=[...r];for(const d of r)B.set(d,e),s=[...s,...J(d,n)];return s},"extractDescendants"),te=v((e,n,r)=>{const s=e.edges().filter(l=>l.v===n||l.w===n),d=e.edges().filter(l=>l.v===r||l.w===r),c=s.map(l=>({v:l.v===n?r:l.v,w:l.w===n?n:l.w})),a=d.map(l=>({v:l.v,w:l.w}));return c.filter(l=>a.some(f=>l.v===f.v&&l.w===f.w))},"findCommonEdges"),x=v((e,n,r)=>{const s=n.children(e);if(t.trace("Searching children of id ",e,s),s.length<1)return e;let d;for(const c of s){const a=x(c,n,r),l=te(n,r,a);if(a)if(l.length>0)d=a;else return a}return d},"findNonClusterChild"),O=v(e=>!u.has(e)||!u.get(e).externalConnections?e:u.has(e)?u.get(e).id:e,"getAnchorId"),ie=v((e,n)=>{if(!e||n>10){t.debug("Opting out, no graph ");return}else t.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(t.warn("Cluster identified",r," Replacement id in edges: ",x(r,e,r)),E.set(r,J(r,e)),u.set(r,{id:x(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const s=e.children(r),d=e.edges();s.length>0?(t.debug("Cluster identified",r,E),d.forEach(c=>{const a=I(c.v,r),l=I(c.w,r);a^l&&(t.warn("Edge: ",c," leaves cluster ",r),t.warn("Descendants of XXX ",r,": ",E.get(r)),u.get(r).externalConnections=!0)})):t.debug("Not a cluster ",r,E)});for(let r of u.keys()){const s=u.get(r).id,d=e.parent(s);d!==r&&u.has(d)&&!u.get(d).externalConnections&&(u.get(r).id=d)}e.edges().forEach(function(r){const s=e.edge(r);t.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),t.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let d=r.v,c=r.w;if(t.warn("Fix XXX",u,"ids:",r.v,r.w,"Translating: ",u.get(r.v)," --- ",u.get(r.w)),u.get(r.v)||u.get(r.w)){if(t.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),d=O(r.v),c=O(r.w),e.removeEdge(r.v,r.w,r.name),d!==r.v){const a=e.parent(d);u.get(a).externalConnections=!0,s.fromCluster=r.v}if(c!==r.w){const a=e.parent(c);u.get(a).externalConnections=!0,s.toCluster=r.w}t.warn("Fix Replacing with XXX",d,c,r.name),e.setEdge(d,c,s,r.name)}}),t.warn("Adjusted Graph",X(e)),P(e,0),t.trace(u)},"adjustClustersAndEdges"),P=v((e,n)=>{var r,s;if(t.warn("extractor - ",n,X(e),e.children("D")),n>10){t.error("Bailing out");return}let d=e.nodes(),c=!1;for(const a of d){const l=e.children(a);c=c||l.length>0}if(!c){t.debug("Done, no node has children",e.nodes());return}t.debug("Nodes = ",d,n);for(const a of d)if(t.debug("Extracting node",a,u,u.has(a)&&!u.get(a).externalConnections,!e.parent(a),e.node(a),e.children("D")," Depth ",n),!u.has(a))t.debug("Not a cluster",a,n);else if(!u.get(a).externalConnections&&e.children(a)&&e.children(a).length>0){t.warn("Cluster without external connections, without a parent and with children",a,n);let l=e.graph().rankdir==="TB"?"LR":"TB";(s=(r=u.get(a))==null?void 0:r.clusterData)!=null&&s.dir&&(l=u.get(a).clusterData.dir,t.warn("Fixing dir",u.get(a).clusterData.dir,l));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});t.warn("Old graph before copy",X(e)),T(a,e,f,a),e.setNode(a,{clusterNode:!0,id:a,clusterData:u.get(a).clusterData,label:u.get(a).label,graph:f}),t.warn("New graph after copy node: (",a,")",X(f)),t.debug("Old graph after copy",X(e))}else t.warn("Cluster ** ",a," **not meeting the criteria !externalConnections:",!u.get(a).externalConnections," no parent: ",!e.parent(a)," children ",e.children(a)&&e.children(a).length>0,e.children("D"),n),t.debug(u);d=e.nodes(),t.warn("New list of nodes",d);for(const a of d){const l=e.node(a);t.warn(" Now next level",a,l),l!=null&&l.clusterNode&&P(l.graph,n+1)}},"extractor"),A=v((e,n)=>{if(n.length===0)return[];let r=Object.assign([],n);return n.forEach(s=>{const d=e.children(s),c=A(e,d);r=[...r,...c]}),r},"sorter"),ae=v(e=>A(e,e.children()),"sortNodesByHierarchy"),R=v(async(e,n,r,s,d,c)=>{t.warn("Graph in recursive render:XAX",X(n),d);const a=n.graph().rankdir;t.trace("Dir in recursive render - dir:",a);const l=e.insert("g").attr("class","root");n.nodes()?t.info("Recursive render XXX",n.nodes()):t.info("No nodes found for",n),n.edges().length>0&&t.info("Recursive edges",n.edge(n.edges()[0]));const f=l.insert("g").attr("class","clusters"),N=l.insert("g").attr("class","edgePaths"),C=l.insert("g").attr("class","edgeLabels"),h=l.insert("g").attr("class","nodes");await Promise.all(n.nodes().map(async function(g){const o=n.node(g);if(d!==void 0){const i=JSON.parse(JSON.stringify(d.clusterData));t.trace(`Setting data for parent cluster XXX
2
- Node.id = `,g,`
3
- data=`,i.height,`
4
- Parent cluster`,d.height),n.setNode(d.id,i),n.parent(g)||(t.trace("Setting parent",g,d.id),n.setParent(g,d.id,i))}if(t.info("(Insert) Node XXX"+g+": "+JSON.stringify(n.node(g))),o!=null&&o.clusterNode){t.info("Cluster identified XBX",g,o.width,n.node(g));const{ranksep:i,nodesep:w}=n.graph();o.graph.setGraph({...o.graph.graph(),ranksep:i+25,nodesep:w});const m=await R(h,o.graph,r,s,n.node(g),c),b=m.elem;H(o,b),o.diff=m.diff||0,t.info("New compound node after recursive render XAX",g,"width",o.width,"height",o.height),V(b,o)}else n.children(g).length>0?(t.trace("Cluster - the non recursive path XBX",g,o.id,o,o.width,"Graph:",n),t.trace(x(o.id,n)),u.set(o.id,{id:x(o.id,n),node:o})):(t.trace("Node - the non recursive path XAX",g,h,n.node(g),a),await _(h,n.node(g),{config:c,dir:a}))})),await v(async()=>{const g=n.edges().map(async function(o){const i=n.edge(o.v,o.w,o.name);t.info("Edge "+o.v+" -> "+o.w+": "+JSON.stringify(o)),t.info("Edge "+o.v+" -> "+o.w+": ",o," ",JSON.stringify(n.edge(o))),t.info("Fix",u,"ids:",o.v,o.w,"Translating: ",u.get(o.v),u.get(o.w)),await q(C,i)});await Promise.all(g)},"processEdges")(),t.info("Graph before layout:",JSON.stringify(X(n))),t.info("############################################# XXX"),t.info("### Layout ### XXX"),t.info("############################################# XXX"),K(n),t.info("Graph after layout:",JSON.stringify(X(n)));let p=0,{subGraphTitleTotalMargin:y}=z(c);return await Promise.all(ae(n).map(async function(g){var o;const i=n.node(g);if(t.info("Position XBX => "+g+": ("+i.x,","+i.y,") width: ",i.width," height: ",i.height),i!=null&&i.clusterNode)i.y+=y,t.info("A tainted cluster node XBX1",g,i.id,i.width,i.height,i.x,i.y,n.parent(g)),u.get(i.id).node=i,D(i);else if(n.children(g).length>0){t.info("A pure cluster node XBX1",g,i.id,i.x,i.y,i.width,i.height,n.parent(g)),i.height+=y,n.node(i.parentId);const w=i?.padding/2||0,m=((o=i?.labelBBox)==null?void 0:o.height)||0,b=m-w||0;t.debug("OffsetY",b,"labelHeight",m,"halfPadding",w),await W(f,i),u.get(i.id).node=i}else{const w=n.node(i.parentId);i.y+=y/2,t.info("A regular node XBX1 - using the padding",i.id,"parent",i.parentId,i.width,i.height,i.x,i.y,"offsetY",i.offsetY,"parent",w,w?.offsetY,i),D(i)}})),n.edges().forEach(function(g){const o=n.edge(g);t.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(o),o),o.points.forEach(b=>b.y+=y/2);const i=n.node(g.v);var w=n.node(g.w);const m=Z(N,o,u,r,i,w,s);$(o,m)}),n.nodes().forEach(function(g){const o=n.node(g);t.info(g,o.type,o.diff),o.isGroup&&(p=o.diff)}),t.warn("Returning from recursive render XAX",l,p),{elem:l,diff:p}},"recursiveRender"),ue=v(async(e,n)=>{var r,s,d,c,a,l;const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((r=e.config)==null?void 0:r.nodeSpacing)||((d=(s=e.config)==null?void 0:s.flowchart)==null?void 0:d.nodeSpacing)||e.nodeSpacing,ranksep:((c=e.config)==null?void 0:c.rankSpacing)||((l=(a=e.config)==null?void 0:a.flowchart)==null?void 0:l.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),N=n.select("g");M(N,e.markers,e.type,e.diagramId),j(),Y(),F(),ne(),e.nodes.forEach(h=>{f.setNode(h.id,{...h}),h.parentId&&f.setParent(h.id,h.parentId)}),t.debug("Edges:",e.edges),e.edges.forEach(h=>{if(h.start===h.end){const p=h.start,y=p+"---"+p+"---1",g=p+"---"+p+"---2",o=f.node(p);f.setNode(y,{domId:y,id:y,parentId:o.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),f.setParent(y,o.parentId),f.setNode(g,{domId:g,id:g,parentId:o.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),f.setParent(g,o.parentId);const i=structuredClone(h),w=structuredClone(h),m=structuredClone(h);i.label="",i.arrowTypeEnd="none",i.id=p+"-cyclic-special-1",w.arrowTypeStart="none",w.arrowTypeEnd="none",w.id=p+"-cyclic-special-mid",m.label="",o.isGroup&&(i.fromCluster=p,m.toCluster=p),m.id=p+"-cyclic-special-2",m.arrowTypeStart="none",f.setEdge(p,y,i,p+"-cyclic-special-0"),f.setEdge(y,g,w,p+"-cyclic-special-1"),f.setEdge(g,p,m,p+"-cyc<lic-special-2")}else f.setEdge(h.start,h.end,{...h},h.id)}),t.warn("Graph at first:",JSON.stringify(X(f))),ie(f),t.warn("Graph after XAX:",JSON.stringify(X(f)));const C=L();await R(N,f,e.type,e.diagramId,void 0,C)},"render");export{ue as render};
@@ -1,24 +0,0 @@
1
- import{H as b,aB as ee,aC as te,aP as ie,ab as ce,a as J,bw as P,a5 as Q,aa as de,a9 as he,ao as pe,ap as ue,a8 as fe,a7 as me,aD as ye,bx as ge,au as xe}from"./index-BXRJOAs4.js";import{d as Se}from"./chunk-QN33PNHL-DHNejhbC-DbJMzG-e.js";import{m as ve}from"./chunk-4BX2VUAB-BQgzc1Sm-3MUJBN6J.js";import{B as Ce}from"./treemap-KMMF4GRG-l6HrdCLC-BpLaQV_H.js";import{n as H}from"./defaultLocale-D7EN2tov-DTlwZUNI.js";import{h as Z}from"./ordinal-DfAQgscy-Pc8f3NoK.js";import"./min-Ar5ebLd--DYc60i1a.js";import"./_baseUniq-KSDS6tgF-vSUSx1j2.js";import"./init-DjUOC4st-DHuO7-vr.js";function be(t){var a=0,n=t.children,r=n&&n.length;if(!r)a=1;else for(;--r>=0;)a+=n[r].value;t.value=a}function $e(){return this.eachAfter(be)}function we(t,a){let n=-1;for(const r of this)t.call(a,r,++n,this);return this}function Le(t,a){for(var n=this,r=[n],o,s,d=-1;n=r.pop();)if(t.call(a,n,++d,this),o=n.children)for(s=o.length-1;s>=0;--s)r.push(o[s]);return this}function Me(t,a){for(var n=this,r=[n],o=[],s,d,h,f=-1;n=r.pop();)if(o.push(n),s=n.children)for(d=0,h=s.length;d<h;++d)r.push(s[d]);for(;n=o.pop();)t.call(a,n,++f,this);return this}function ke(t,a){let n=-1;for(const r of this)if(t.call(a,r,++n,this))return r}function Te(t){return this.eachAfter(function(a){for(var n=+t(a.data)||0,r=a.children,o=r&&r.length;--o>=0;)n+=r[o].value;a.value=n})}function ze(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Fe(t){for(var a=this,n=Ae(a,t),r=[a];a!==n;)a=a.parent,r.push(a);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function Ae(t,a){if(t===a)return t;var n=t.ancestors(),r=a.ancestors(),o=null;for(t=n.pop(),a=r.pop();t===a;)o=t,t=n.pop(),a=r.pop();return o}function Be(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Pe(){return Array.from(this)}function De(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function We(){var t=this,a=[];return t.each(function(n){n!==t&&a.push({source:n.parent,target:n})}),a}function*Re(){var t=this,a,n=[t],r,o,s;do for(a=n.reverse(),n=[];t=a.pop();)if(yield t,r=t.children)for(o=0,s=r.length;o<s;++o)n.push(r[o]);while(n.length)}function U(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=He)):a===void 0&&(a=je);for(var n=new X(t),r,o=[n],s,d,h,f;r=o.pop();)if((d=a(r.data))&&(f=(d=Array.from(d)).length))for(r.children=d,h=f-1;h>=0;--h)o.push(s=d[h]=new X(d[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Ve)}function Ne(){return U(this).eachBefore(Ie)}function je(t){return t.children}function He(t){return Array.isArray(t)?t[1]:null}function Ie(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ve(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function X(t){this.data=t,this.depth=this.height=0,this.parent=null}X.prototype=U.prototype={constructor:X,count:$e,each:we,eachAfter:Me,eachBefore:Le,find:ke,sum:Te,sort:ze,path:Fe,ancestors:Be,descendants:Pe,leaves:De,links:We,copy:Ne,[Symbol.iterator]:Re};function Ee(t){if(typeof t!="function")throw new Error;return t}function I(){return 0}function V(t){return function(){return t}}function Ge(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ke(t,a,n,r,o){for(var s=t.children,d,h=-1,f=s.length,i=t.value&&(r-a)/t.value;++h<f;)d=s[h],d.y0=n,d.y1=o,d.x0=a,d.x1=a+=d.value*i}function qe(t,a,n,r,o){for(var s=t.children,d,h=-1,f=s.length,i=t.value&&(o-n)/t.value;++h<f;)d=s[h],d.x0=a,d.x1=r,d.y0=n,d.y1=n+=d.value*i}var Oe=(1+Math.sqrt(5))/2;function Qe(t,a,n,r,o,s){for(var d=[],h=a.children,f,i,p=0,C=0,l=h.length,v,x,S=a.value,u,y,A,k,B,W,L;p<l;){v=o-n,x=s-r;do u=h[C++].value;while(!u&&C<l);for(y=A=u,W=Math.max(x/v,v/x)/(S*t),L=u*u*W,B=Math.max(A/L,L/y);C<l;++C){if(u+=i=h[C].value,i<y&&(y=i),i>A&&(A=i),L=u*u*W,k=Math.max(A/L,L/y),k>B){u-=i;break}B=k}d.push(f={value:u,dice:v<x,children:h.slice(p,C)}),f.dice?Ke(f,n,r,o,S?r+=x*u/S:s):qe(f,n,r,S?n+=v*u/S:o,s),S-=u,p=C}return d}const Xe=(function t(a){function n(r,o,s,d,h){Qe(a,r,o,s,d,h)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(Oe);function Ze(){var t=Xe,a=!1,n=1,r=1,o=[0],s=I,d=I,h=I,f=I,i=I;function p(l){return l.x0=l.y0=0,l.x1=n,l.y1=r,l.eachBefore(C),o=[0],a&&l.eachBefore(Ge),l}function C(l){var v=o[l.depth],x=l.x0+v,S=l.y0+v,u=l.x1-v,y=l.y1-v;u<x&&(x=u=(x+u)/2),y<S&&(S=y=(S+y)/2),l.x0=x,l.y0=S,l.x1=u,l.y1=y,l.children&&(v=o[l.depth+1]=s(l)/2,x+=i(l)-v,S+=d(l)-v,u-=h(l)-v,y-=f(l)-v,u<x&&(x=u=(x+u)/2),y<S&&(S=y=(S+y)/2),t(l,x,S,u,y))}return p.round=function(l){return arguments.length?(a=!!l,p):a},p.size=function(l){return arguments.length?(n=+l[0],r=+l[1],p):[n,r]},p.tile=function(l){return arguments.length?(t=Ee(l),p):t},p.padding=function(l){return arguments.length?p.paddingInner(l).paddingOuter(l):p.paddingInner()},p.paddingInner=function(l){return arguments.length?(s=typeof l=="function"?l:V(+l),p):s},p.paddingOuter=function(l){return arguments.length?p.paddingTop(l).paddingRight(l).paddingBottom(l).paddingLeft(l):p.paddingTop()},p.paddingTop=function(l){return arguments.length?(d=typeof l=="function"?l:V(+l),p):d},p.paddingRight=function(l){return arguments.length?(h=typeof l=="function"?l:V(+l),p):h},p.paddingBottom=function(l){return arguments.length?(f=typeof l=="function"?l:V(+l),p):f},p.paddingLeft=function(l){return arguments.length?(i=typeof l=="function"?l:V(+l),p):i},p}var _,ae=(_=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=de,this.getAccTitle=he,this.setDiagramTitle=pe,this.getDiagramTitle=ue,this.getAccDescription=fe,this.setAccDescription=me}getNodes(){return this.nodes}getConfig(){const t=ye,a=te();return ee({...t.treemap,...a.treemap??{}})}addNode(t,a){this.nodes.push(t),this.levels.set(t,a),a===0&&(this.outerNodes.push(t),this.root??(this.root=t))}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,a){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},r=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(o=>{ge(o)&&(n!=null&&n.textStyles?n.textStyles.push(o):n.textStyles=[o]),n!=null&&n.styles?n.styles.push(o):n.styles=[o]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){var a;return((a=this.classes.get(t))==null?void 0:a.styles)??[]}clear(){xe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},b(_,"TreeMapDB"),_);function ne(t){if(!t.length)return[];const a=[],n=[];return t.forEach(r=>{const o={name:r.name,children:r.type==="Leaf"?void 0:[]};for(o.classSelector=r?.classSelector,r!=null&&r.cssCompiledStyles&&(o.cssCompiledStyles=[r.cssCompiledStyles]),r.type==="Leaf"&&r.value!==void 0&&(o.value=r.value);n.length>0&&n[n.length-1].level>=r.level;)n.pop();if(n.length===0)a.push(o);else{const s=n[n.length-1].node;s.children?s.children.push(o):s.children=[o]}r.type!=="Leaf"&&n.push({node:o,level:r.level})}),a}b(ne,"buildHierarchy");var _e=b((t,a)=>{ve(t,a);const n=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,f=Je(d),i=d.classSelector?a.getStylesForClass(d.classSelector):[],p=i.length>0?i.join(";"):void 0,C={level:h,name:f,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};n.push(C)}const r=ne(n),o=b((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(r,0)},"populate"),Je=b(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:b(async t=>{var a;try{const n=await Ce("treemap",t);J.debug("Treemap AST:",n);const r=(a=re.parser)==null?void 0:a.yy;if(!(r instanceof ae))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");_e(n,r)}catch(n){throw J.error("Error parsing treemap:",n),n}},"parse")},Ue=10,D=10,E=25,Ye=b((t,a,n,r)=>{const o=r.db,s=o.getConfig(),d=s.padding??Ue,h=o.getDiagramTitle(),f=o.getRoot(),{themeVariables:i}=te();if(!f)return;const p=h?30:0,C=ie(a),l=s.nodeWidth?s.nodeWidth*D:960,v=s.nodeHeight?s.nodeHeight*D:500,x=l,S=v+p;C.attr("viewBox",`0 0 ${x} ${S}`),ce(C,S,x,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=b(c=>"$"+H(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),g=c?c[0]:"";u=b($=>"$"+H(","+g)($),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);u=b(g=>"$"+H(c||"")(g),"valueFormat")}else u=H(e)}catch(e){J.error("Error creating format function:",e),u=H(",")}const y=Z().range(["transparent",i.cScale0,i.cScale1,i.cScale2,i.cScale3,i.cScale4,i.cScale5,i.cScale6,i.cScale7,i.cScale8,i.cScale9,i.cScale10,i.cScale11]),A=Z().range(["transparent",i.cScalePeer0,i.cScalePeer1,i.cScalePeer2,i.cScalePeer3,i.cScalePeer4,i.cScalePeer5,i.cScalePeer6,i.cScalePeer7,i.cScalePeer8,i.cScalePeer9,i.cScalePeer10,i.cScalePeer11]),k=Z().range([i.cScaleLabel0,i.cScaleLabel1,i.cScaleLabel2,i.cScaleLabel3,i.cScaleLabel4,i.cScaleLabel5,i.cScaleLabel6,i.cScaleLabel7,i.cScaleLabel8,i.cScaleLabel9,i.cScaleLabel10,i.cScaleLabel11]);h&&C.append("text").attr("x",x/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const B=C.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=U(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),L=Ze().size([l,v]).paddingTop(e=>e.children&&e.children.length>0?E+D:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?D:0).paddingRight(e=>e.children&&e.children.length>0?D:0).paddingBottom(e=>e.children&&e.children.length>0?D:0).round(!0)(W),le=L.descendants().filter(e=>e.children&&e.children.length>0),R=B.selectAll(".treemapSection").data(le).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",E).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),R.append("clipPath").attr("id",(e,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",E),R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>A(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=P({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",E/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=Q(this),g=e.data.name;c.text(g);const $=e.x1-e.x0,T=6;let z;s.showValues!==!1&&e.value?z=$-10-30-10-T:z=$-T-6;const M=Math.max(15,z),w=c.node();if(w.getComputedTextLength()>M){let m=g;for(;m.length>0;){if(m=g.substring(0,m.length-1),m.length===0){c.text("..."),w.getComputedTextLength()>M&&c.text("");break}if(c.text(m+"..."),w.getComputedTextLength()<=M)break}}}),s.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",E/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")});const se=L.leaves(),G=B.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);G.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),G.append("clipPath").attr("id",(e,c)=>`clip-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),G.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.data.name).each(function(e){const c=Q(this),g=e.x1-e.x0,$=e.y1-e.y0,T=c.node(),z=4,M=g-2*z,w=$-2*z;if(M<10||w<10){c.style("display","none");return}let m=parseInt(c.style("font-size"),10);const F=8,N=28,K=.6,j=6,q=2;for(;T.getComputedTextLength()>M&&m>F;)m--,c.style("font-size",`${m}px`);let O=Math.max(j,Math.min(N,Math.round(m*K))),Y=m+q+O;for(;Y>w&&m>F&&(m--,O=Math.max(j,Math.min(N,Math.round(m*K))),!(O<j&&m===F));)c.style("font-size",`${m}px`),Y=m+q+O;c.style("font-size",`${m}px`),(T.getComputedTextLength()>M||m<F||w<m)&&c.style("display","none")}),s.showValues!==!1&&G.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(e.data.name)+";",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.value?u(e.value):"").each(function(e){const c=Q(this),g=this.parentNode;if(!g){c.style("display","none");return}const $=Q(g).select(".treemapLabel");if($.empty()||$.style("display")==="none"){c.style("display","none");return}const T=parseFloat($.style("font-size")),z=28,M=.6,w=6,m=2,F=Math.max(w,Math.min(z,Math.round(T*M)));c.style("font-size",`${F}px`);const N=(e.y1-e.y0)/2+T/2+m;c.attr("y",N);const K=e.x1-e.x0,j=e.y1-e.y0-4,q=K-8;c.node().getComputedTextLength()>q||N+F>j||F<w?c.style("display","none"):c.style("display",null)});const oe=s.diagramPadding??8;Se(C,oe,"flowchart",s?.useMaxWidth||!1)},"draw"),et=b(function(t,a){return a.db.getClasses()},"getClasses"),tt={draw:Ye,getClasses:et},at={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},nt=b(({treemap:t}={})=>{const a=ee(at,t);return`
2
- .treemapNode.section {
3
- stroke: ${a.sectionStrokeColor};
4
- stroke-width: ${a.sectionStrokeWidth};
5
- fill: ${a.sectionFillColor};
6
- }
7
- .treemapNode.leaf {
8
- stroke: ${a.leafStrokeColor};
9
- stroke-width: ${a.leafStrokeWidth};
10
- fill: ${a.leafFillColor};
11
- }
12
- .treemapLabel {
13
- fill: ${a.labelColor};
14
- font-size: ${a.labelFontSize};
15
- }
16
- .treemapValue {
17
- fill: ${a.valueColor};
18
- font-size: ${a.valueFontSize};
19
- }
20
- .treemapTitle {
21
- fill: ${a.titleColor};
22
- font-size: ${a.titleFontSize};
23
- }
24
- `},"getStyles"),rt=nt,ft={parser:re,get db(){return new ae},renderer:tt,styles:rt};export{ft as diagram};
@@ -1,43 +0,0 @@
1
- import{H as l,a7 as O,a8 as I,ap as E,ao as F,a9 as P,aa as R,aP as z,au as B,aB as y,aC as w,aD as D,a as j,b6 as G}from"./index-BXRJOAs4.js";import{m as H}from"./chunk-4BX2VUAB-BQgzc1Sm-3MUJBN6J.js";import{B as V}from"./treemap-KMMF4GRG-l6HrdCLC-BpLaQV_H.js";import"./min-Ar5ebLd--DYc60i1a.js";import"./_baseUniq-KSDS6tgF-vSUSx1j2.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},b={axes:[],curves:[],options:h},x=structuredClone(b),W=D.radar,Z=l(()=>y({...W,...w().radar}),"getConfig"),C=l(()=>x.axes,"getAxes"),J=l(()=>x.curves,"getCurves"),K=l(()=>x.options,"getOptions"),Q=l(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),X=l(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=C();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(i=>{var n;return((n=i.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),_=l(a=>{var t,e,r,i,n;const o=a.reduce((s,c)=>(s[c.name]=c,s),{});x.options={showLegend:((t=o.showLegend)==null?void 0:t.value)??h.showLegend,ticks:((e=o.ticks)==null?void 0:e.value)??h.ticks,max:((r=o.max)==null?void 0:r.value)??h.max,min:((i=o.min)==null?void 0:i.value)??h.min,graticule:((n=o.graticule)==null?void 0:n.value)??h.graticule}},"setOptions"),q=l(()=>{B(),x=structuredClone(b)},"clear"),f={getAxes:C,getCurves:J,getOptions:K,setAxes:Q,setCurves:X,setOptions:_,getConfig:Z,clear:q,setAccTitle:R,getAccTitle:P,setDiagramTitle:F,getDiagramTitle:E,getAccDescription:I,setAccDescription:O},N=l(a=>{H(a,f);const{axes:t,curves:e,options:r}=a;f.setAxes(t),f.setCurves(e),f.setOptions(r)},"populate"),U={parse:l(async a=>{const t=await V("radar",a);j.debug(t),N(t)},"parse")},tt=l((a,t,e,r)=>{const i=r.db,n=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),d=i.getDiagramTitle(),g=z(t),u=et(g,c),p=s.max??Math.max(...o.map(v=>Math.max(...v.entries))),m=s.min,$=Math.min(c.width,c.height)/2;at(u,n,$,s.ticks,s.graticule),rt(u,n,$,c),M(u,n,o,m,p,s.graticule,c),T(u,o,s.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),et=l((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return a.attr("viewbox",`0 0 ${e} ${r}`).attr("width",e).attr("height",r),a.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),at=l((a,t,e,r,i)=>{if(i==="circle")for(let n=0;n<r;n++){const o=e*(n+1)/r;a.append("circle").attr("r",o).attr("class","radarGraticule")}else if(i==="polygon"){const n=t.length;for(let o=0;o<r;o++){const s=e*(o+1)/r,c=t.map((d,g)=>{const u=2*g*Math.PI/n-Math.PI/2,p=s*Math.cos(u),m=s*Math.sin(u);return`${p},${m}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),rt=l((a,t,e,r)=>{const i=t.length;for(let n=0;n<i;n++){const o=t[n].label,s=2*n*Math.PI/i-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*Math.cos(s)).attr("y2",e*r.axisScaleFactor*Math.sin(s)).attr("class","radarAxisLine"),a.append("text").text(o).attr("x",e*r.axisLabelFactor*Math.cos(s)).attr("y",e*r.axisLabelFactor*Math.sin(s)).attr("class","radarAxisLabel")}},"drawAxes");function M(a,t,e,r,i,n,o){const s=t.length,c=Math.min(o.width,o.height)/2;e.forEach((d,g)=>{if(d.entries.length!==s)return;const u=d.entries.map((p,m)=>{const $=2*Math.PI*m/s-Math.PI/2,v=L(p,r,i,c),A=v*Math.cos($),k=v*Math.sin($);return{x:A,y:k}});n==="circle"?a.append("path").attr("d",S(u,o.curveTension)).attr("class",`radarCurve-${g}`):n==="polygon"&&a.append("polygon").attr("points",u.map(p=>`${p.x},${p.y}`).join(" ")).attr("class",`radarCurve-${g}`)})}l(M,"drawCurves");function L(a,t,e,r){const i=Math.min(Math.max(a,t),e);return r*(i-t)/(e-t)}l(L,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let i=0;i<e;i++){const n=a[(i-1+e)%e],o=a[i],s=a[(i+1)%e],c=a[(i+2)%e],d={x:o.x+(s.x-n.x)*t,y:o.y+(s.y-n.y)*t},g={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${d.x},${d.y} ${g.x},${g.y} ${s.x},${s.y}`}return`${r} Z`}l(S,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const i=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,o=20;t.forEach((s,c)=>{const d=a.append("g").attr("transform",`translate(${i}, ${n+c*o})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(s.label)})}l(T,"drawLegend");var it={draw:tt},st=l((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const i=a[`cScale${r}`];e+=`
2
- .radarCurve-${r} {
3
- color: ${i};
4
- fill: ${i};
5
- fill-opacity: ${t.curveOpacity};
6
- stroke: ${i};
7
- stroke-width: ${t.curveStrokeWidth};
8
- }
9
- .radarLegendBox-${r} {
10
- fill: ${i};
11
- fill-opacity: ${t.curveOpacity};
12
- stroke: ${i};
13
- }
14
- `}return e},"genIndexStyles"),nt=l(a=>{const t=G(),e=w(),r=y(t,e.themeVariables),i=y(r.radar,a);return{themeVariables:r,radarOptions:i}},"buildRadarStyleOptions"),ot=l(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=nt(a);return`
15
- .radarTitle {
16
- font-size: ${t.fontSize};
17
- color: ${t.titleColor};
18
- dominant-baseline: hanging;
19
- text-anchor: middle;
20
- }
21
- .radarAxisLine {
22
- stroke: ${e.axisColor};
23
- stroke-width: ${e.axisStrokeWidth};
24
- }
25
- .radarAxisLabel {
26
- dominant-baseline: middle;
27
- text-anchor: middle;
28
- font-size: ${e.axisLabelFontSize}px;
29
- color: ${e.axisColor};
30
- }
31
- .radarGraticule {
32
- fill: ${e.graticuleColor};
33
- fill-opacity: ${e.graticuleOpacity};
34
- stroke: ${e.graticuleColor};
35
- stroke-width: ${e.graticuleStrokeWidth};
36
- }
37
- .radarLegendText {
38
- text-anchor: start;
39
- font-size: ${e.legendFontSize}px;
40
- dominant-baseline: hanging;
41
- }
42
- ${st(t,e)}
43
- `},"styles"),pt={parser:U,db:f,renderer:it,styles:ot};export{pt as diagram};
@@ -1,24 +0,0 @@
1
- import{H as f,aB as w,aP as C,ab as S,a as m,aa as v,a9 as P,ao as z,ap as F,a8 as W,a7 as D,aC as E,aD as T,au as H}from"./index-BXRJOAs4.js";import{m as j}from"./chunk-4BX2VUAB-BQgzc1Sm-3MUJBN6J.js";import{B as Y}from"./treemap-KMMF4GRG-l6HrdCLC-BpLaQV_H.js";import"./min-Ar5ebLd--DYc60i1a.js";import"./_baseUniq-KSDS6tgF-vSUSx1j2.js";var A=T.packet,u,x=(u=class{constructor(){this.packet=[],this.setAccTitle=v,this.getAccTitle=P,this.setDiagramTitle=z,this.getDiagramTitle=F,this.getAccDescription=W,this.setAccDescription=D}getConfig(){const t=w({...A,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){H(),this.packet=[]}},f(u,"PacketDB"),u),L=1e4,R=f((t,e)=>{j(t,e);let o=-1,r=[],l=1;const{bitsPerRow:n}=e.getConfig();for(let{start:a,end:s,bits:c,label:d}of t.blocks){if(a!==void 0&&s!==void 0&&s<a)throw new Error(`Packet block ${a} - ${s} is invalid. End must be greater than start.`);if(a??(a=o+1),a!==o+1)throw new Error(`Packet block ${a} - ${s??a} is not contiguous. It should start from ${o+1}.`);if(c===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(s??(s=a+(c??1)-1),c??(c=s-a+1),o=s,m.debug(`Packet block ${a} - ${o} with label ${d}`);r.length<=n+1&&e.getPacket().length<L;){const[p,i]=M({start:a,end:s,bits:c,label:d},l,n);if(r.push(p),p.end+1===l*n&&(e.pushWord(r),r=[],l++),!i)break;({start:a,end:s,bits:c,label:d}=i)}}e.pushWord(r)},"populate"),M=f((t,e,o)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*o)return[t,void 0];const r=e*o-1,l=e*o;return[{start:t.start,end:r,label:t.label,bits:r-t.start},{start:l,end:t.end,label:t.label,bits:t.end-l}]},"getNextFittingBlock"),y={parser:{yy:void 0},parse:f(async t=>{var e;const o=await Y("packet",t),r=(e=y.parser)==null?void 0:e.yy;if(!(r instanceof x))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(o),R(o,r)},"parse")},I=f((t,e,o,r)=>{const l=r.db,n=l.getConfig(),{rowHeight:a,paddingY:s,bitWidth:c,bitsPerRow:d}=n,p=l.getPacket(),i=l.getDiagramTitle(),h=a+s,b=h*(p.length+1)-(i?0:a),k=c*d+2,g=C(e);g.attr("viewbox",`0 0 ${k} ${b}`),S(g,b,k,n.useMaxWidth);for(const[$,B]of p.entries())K(g,B,$,n);g.append("text").text(i).attr("x",k/2).attr("y",b-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),K=f((t,e,o,{rowHeight:r,paddingX:l,paddingY:n,bitWidth:a,bitsPerRow:s,showBits:c})=>{const d=t.append("g"),p=o*(r+n)+n;for(const i of e){const h=i.start%s*a+1,b=(i.end-i.start+1)*a-l;if(d.append("rect").attr("x",h).attr("y",p).attr("width",b).attr("height",r).attr("class","packetBlock"),d.append("text").attr("x",h+b/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(i.label),!c)continue;const k=i.end===i.start,g=p-2;d.append("text").attr("x",h+(k?b/2:0)).attr("y",g).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(i.start),k||d.append("text").attr("x",h+b).attr("y",g).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(i.end)}},"drawWord"),N={draw:I},X={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},q=f(({packet:t}={})=>{const e=w(X,t);return`
2
- .packetByte {
3
- font-size: ${e.byteFontSize};
4
- }
5
- .packetByte.start {
6
- fill: ${e.startByteColor};
7
- }
8
- .packetByte.end {
9
- fill: ${e.endByteColor};
10
- }
11
- .packetLabel {
12
- fill: ${e.labelColor};
13
- font-size: ${e.labelFontSize};
14
- }
15
- .packetTitle {
16
- fill: ${e.titleColor};
17
- font-size: ${e.titleFontSize};
18
- }
19
- .packetBlock {
20
- stroke: ${e.blockStrokeColor};
21
- stroke-width: ${e.blockStrokeWidth};
22
- fill: ${e.blockFillColor};
23
- }
24
- `},"styles"),Z={parser:y,get db(){return new x},renderer:N,styles:q};export{Z as diagram};