@agent-link/server 0.1.539 → 0.1.540

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 (82) hide show
  1. package/package.json +4 -3
  2. package/web/dist/assets/{abnfDiagram-VRR7QNED-CYWjSLFB.js → abnfDiagram-VRR7QNED-D1hyJ-hn.js} +1 -1
  3. package/web/dist/assets/{arc-C5QqMw0D.js → arc-BuJJgjYt.js} +1 -1
  4. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-CiJkLkRK.js → architectureDiagram-ZJ3FMSHR-A9THC2Cc.js} +1 -1
  5. package/web/dist/assets/{blockDiagram-677ZJIJ3--rNn03K2.js → blockDiagram-677ZJIJ3-De9_CtWv.js} +1 -1
  6. package/web/dist/assets/{c4Diagram-LMCZKHZV-DFv38F5W.js → c4Diagram-LMCZKHZV-DeZVA52a.js} +1 -1
  7. package/web/dist/assets/channel-D0HU8H5o.js +1 -0
  8. package/web/dist/assets/{chunk-2Q5K7J3B-LcxWxL9X.js → chunk-2Q5K7J3B-DlDecKcs.js} +1 -1
  9. package/web/dist/assets/{chunk-32BRIVSS-L5rSd5kx.js → chunk-32BRIVSS-BhpTBz4U.js} +1 -1
  10. package/web/dist/assets/{chunk-5VM5RSS4-CqNmatdI.js → chunk-5VM5RSS4-DE8R6mLs.js} +1 -1
  11. package/web/dist/assets/{chunk-EX3LRPZG-2Wshn2od.js → chunk-EX3LRPZG-t_9lUdF-.js} +1 -1
  12. package/web/dist/assets/{chunk-JWPE2WC7-OIu2tm43.js → chunk-JWPE2WC7-D8olqveE.js} +1 -1
  13. package/web/dist/assets/{chunk-MOJQB5TN-GF0HoMD5.js → chunk-MOJQB5TN-qQmIJLhN.js} +1 -1
  14. package/web/dist/assets/{chunk-RYQCIY6F-esL_U6-9.js → chunk-RYQCIY6F-o8VHYTB2.js} +1 -1
  15. package/web/dist/assets/{chunk-V7JOEXUC-WNOLiPpt.js → chunk-V7JOEXUC-DGpoi6XB.js} +1 -1
  16. package/web/dist/assets/{chunk-VR4S4FIN-B-fO7gd6.js → chunk-VR4S4FIN-BjtiAe03.js} +1 -1
  17. package/web/dist/assets/{chunk-XXDRQBXY-D6g9o0gx.js → chunk-XXDRQBXY-Bf9B2FsN.js} +1 -1
  18. package/web/dist/assets/classDiagram-OUVF2IWQ-DQaRrb-b.js +1 -0
  19. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DQaRrb-b.js +1 -0
  20. package/web/dist/assets/{cose-bilkent-JH36ORCC-CiWR02dm.js → cose-bilkent-JH36ORCC-CUu8D0Zk.js} +1 -1
  21. package/web/dist/assets/{cssMode-CdZ6WkPb.js → cssMode-BBGTtP8x.js} +1 -1
  22. package/web/dist/assets/{cynefin-VYW2F7L2-Cm5C7NQw.js → cynefin-VYW2F7L2-DVyQShfu.js} +1 -1
  23. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-D4HWvIqR.js → cynefinDiagram-TSTJHNR4-5-G2jXgr.js} +1 -1
  24. package/web/dist/assets/{dagre-VKFMJZFB-Dydcg1Dj.js → dagre-VKFMJZFB-BVIWNamr.js} +1 -1
  25. package/web/dist/assets/{diagram-FQU43EPY-T1Gos5W9.js → diagram-FQU43EPY-DB_8HU4p.js} +1 -1
  26. package/web/dist/assets/{diagram-G47NLZAW-BiERNHwh.js → diagram-G47NLZAW-BuC9KdPo.js} +1 -1
  27. package/web/dist/assets/{diagram-NH7WQ7WH-Bp4PAleB.js → diagram-NH7WQ7WH-DEjdAGik.js} +1 -1
  28. package/web/dist/assets/{diagram-OA4YK3LP-gaknvItq.js → diagram-OA4YK3LP-CpUMGDrP.js} +1 -1
  29. package/web/dist/assets/{diagram-WEI45ONY-DrPuSW85.js → diagram-WEI45ONY-CD-UVma6.js} +1 -1
  30. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-CAcdMMe7.js → ebnfDiagram-CCIWWBDH-Crk2X-Xr.js} +1 -1
  31. package/web/dist/assets/{editor.main-DGCQQuiO.js → editor.main-DX1kz8I2.js} +3 -3
  32. package/web/dist/assets/{erDiagram-Q63AITRT-DzyOSwU9.js → erDiagram-Q63AITRT-POwYozga.js} +1 -1
  33. package/web/dist/assets/{flowDiagram-23GEKE2U-DOe-9kuu.js → flowDiagram-23GEKE2U-5jmZ5k5e.js} +1 -1
  34. package/web/dist/assets/{freemarker2-1qw2nqEO.js → freemarker2-mDrCFxI5.js} +1 -1
  35. package/web/dist/assets/{ganttDiagram-NO4QXBWP-B2rh6MaY.js → ganttDiagram-NO4QXBWP-B9Mdj-u5.js} +1 -1
  36. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-DvnGb_NE.js → gitGraphDiagram-IHSO6WYX-CNPSE7ls.js} +1 -1
  37. package/web/dist/assets/{handlebars-BtUv9TxE.js → handlebars--G4a_6Oo.js} +1 -1
  38. package/web/dist/assets/{html-wKYvqrG5.js → html-tA32frga.js} +1 -1
  39. package/web/dist/assets/{htmlMode-BSafVEUS.js → htmlMode-CggNnIWF.js} +1 -1
  40. package/web/dist/assets/{index-DknoSkal.js → index-AdB8XHXv.js} +6 -6
  41. package/web/dist/assets/index-D5K63qug.css +32 -0
  42. package/web/dist/assets/{infoDiagram-FWYZ7A6U-DZimoK7P.js → infoDiagram-FWYZ7A6U-CyB7Vvcb.js} +1 -1
  43. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-DsvDmKxP.js → ishikawaDiagram-FXEZZL3T-DLMZ7H1X.js} +1 -1
  44. package/web/dist/assets/{javascript-h1g-Ucy8.js → javascript-DMkX6-SC.js} +1 -1
  45. package/web/dist/assets/{journeyDiagram-5HDEW3XC-CY8i7id_.js → journeyDiagram-5HDEW3XC-_nk1wTqH.js} +1 -1
  46. package/web/dist/assets/{jsonMode-DiNVkY3E.js → jsonMode-BatVhCGs.js} +1 -1
  47. package/web/dist/assets/{kanban-definition-HUTT4EX6-qsS7eTpB.js → kanban-definition-HUTT4EX6-Cz1JY0qx.js} +1 -1
  48. package/web/dist/assets/{linear-pxgzmzBW.js → linear-DkQS0EVl.js} +1 -1
  49. package/web/dist/assets/{liquid-BScuE6Li.js → liquid-JdcJe3Mn.js} +1 -1
  50. package/web/dist/assets/{lspLanguageFeatures-Bvg2J_jV.js → lspLanguageFeatures-BDC0ynk1.js} +1 -1
  51. package/web/dist/assets/{mdx-DEgin56d.js → mdx-C0s6E9Ya.js} +1 -1
  52. package/web/dist/assets/{mermaid.core-DkcKZax1.js → mermaid.core-DQSlETG7.js} +2 -2
  53. package/web/dist/assets/{mindmap-definition-LN4V7U3C-CdSHmqbA.js → mindmap-definition-LN4V7U3C-oNTOwQOU.js} +1 -1
  54. package/web/dist/assets/{pegDiagram-2B236MQR-B5lYNF_c.js → pegDiagram-2B236MQR-8BmSEVOy.js} +1 -1
  55. package/web/dist/assets/{pieDiagram-ENE6RG2P-C5XC449d.js → pieDiagram-ENE6RG2P-DRIltoVc.js} +1 -1
  56. package/web/dist/assets/{python-LiSQlk9W.js → python-DQKjtSgN.js} +1 -1
  57. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-B_lVz6fv.js → quadrantDiagram-ABIIQ3AL-BJfMAp1Q.js} +1 -1
  58. package/web/dist/assets/{railroadDiagram-RFXS5EU6-Cqyazggh.js → railroadDiagram-RFXS5EU6-Dj9-wyZY.js} +1 -1
  59. package/web/dist/assets/{razor-C-OT9rh_.js → razor-CL-fmDzS.js} +1 -1
  60. package/web/dist/assets/{requirementDiagram-TGXJPOKE-D1fFw8Za.js → requirementDiagram-TGXJPOKE-fPYOczdV.js} +1 -1
  61. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-BmEnh6Zy.js → sankeyDiagram-HTMAVEWB-DyjpctG7.js} +1 -1
  62. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-D6IE-IG5.js → sequenceDiagram-DBY2YBRQ-RaZs5E3b.js} +1 -1
  63. package/web/dist/assets/{sizeCapture-X5ZJPWSS-BYkPr4jo.js → sizeCapture-X5ZJPWSS-BfOA5cbO.js} +1 -1
  64. package/web/dist/assets/{stateDiagram-2N3HPSRC-BUCTdtKV.js → stateDiagram-2N3HPSRC-CdxgHSfH.js} +1 -1
  65. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-vTVKrqt9.js +1 -0
  66. package/web/dist/assets/{swimlanes-5IMT3BWC-DcMZ-6_P.js → swimlanes-5IMT3BWC-B19jLFc4.js} +2 -2
  67. package/web/dist/assets/swimlanesDiagram-G3AALYLV-CbIyNKp1.js +1 -0
  68. package/web/dist/assets/{timeline-definition-FHXFAJF6-CevcptDf.js → timeline-definition-FHXFAJF6-CYSSTJjP.js} +1 -1
  69. package/web/dist/assets/{tsMode-CQ3194z3.js → tsMode-I7W52vRp.js} +1 -1
  70. package/web/dist/assets/{typescript-D0PYBX18.js → typescript-BkUlxSfm.js} +1 -1
  71. package/web/dist/assets/{vennDiagram-L72KCM5P-C4E35ru2.js → vennDiagram-L72KCM5P-CJ5m4qeA.js} +1 -1
  72. package/web/dist/assets/{wardleyDiagram-EHGQE667-jZDfwkzC.js → wardleyDiagram-EHGQE667-CpaSYOZD.js} +1 -1
  73. package/web/dist/assets/{xml-BbyTLoF3.js → xml-B6uP1aJC.js} +1 -1
  74. package/web/dist/assets/{xychartDiagram-FW5EYKEG-CLEMD07_.js → xychartDiagram-FW5EYKEG-EqZ9r0f-.js} +1 -1
  75. package/web/dist/assets/{yaml-BQcG0ScU.js → yaml-BzfObSCH.js} +1 -1
  76. package/web/dist/index.html +2 -2
  77. package/web/dist/assets/channel-BUPHzg7D.js +0 -1
  78. package/web/dist/assets/classDiagram-OUVF2IWQ-CEHpjaOw.js +0 -1
  79. package/web/dist/assets/classDiagram-v2-EOCWNBFH-CEHpjaOw.js +0 -1
  80. package/web/dist/assets/index-DXanOGbR.css +0 -32
  81. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DvxjB9W-.js +0 -1
  82. package/web/dist/assets/swimlanesDiagram-G3AALYLV-u9Y7eEve.js +0 -1
@@ -1 +1 @@
1
- var t;import{g as e}from"./chunk-XXDRQBXY-D6g9o0gx.js";import{s}from"./chunk-VR4S4FIN-B-fO7gd6.js";import{_ as i,l as n,c as r,x as o,y as a,a as l,b as c,g as h,s as d,o as u,p,a8 as y,k as g,q as f,d as m}from"./mermaid.core-DkcKZax1.js";import{f as S}from"./chunk-32BRIVSS-L5rSd5kx.js";import{p as k}from"./index-DknoSkal.js";var b=function(){var t=i(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],n=[1,4],r=[2,4],o=[1,9],a=[1,11],l=[1,16],c=[1,17],h=[1,18],d=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],f=[1,23],m=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],E=[1,31],v=[1,32],x=[1,35],$=[1,36],C=[1,37],D=[1,38],I=[1,34],A=[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],L=[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],w=[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],N={trace:i(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,"--\x3e":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:"--\x3e",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:i(function(t,e,s,i,n,r,o){var a=r.length-1;switch(n){case 3:return i.setRootDoc(r[a]),r[a];case 4:this.$=[];break;case 5:"nl"!=r[a]&&(r[a-1].push(r[a]),this.$=r[a-1]);break;case 6:case 7:case 12:this.$=r[a];break;case 8:this.$="nl";break;case 13:const t=r[a-1];t.description=i.trimColon(r[a]),this.$=t;break;case 14:this.$={stmt:"relation",state1:r[a-2],state2:r[a]};break;case 15:const e=i.trimColon(r[a]);this.$={stmt:"relation",state1:r[a-3],state2:r[a-1],description:e};break;case 19:this.$={stmt:"state",id:r[a-3],type:"default",description:"",doc:r[a-1]};break;case 20:var l=r[a],c=r[a-2].trim();if(r[a].match(":")){var h=r[a].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:r[a-3],type:"default",description:r[a-5],doc:r[a-1]};break;case 22:this.$={stmt:"state",id:r[a],type:"fork"};break;case 23:this.$={stmt:"state",id:r[a],type:"join"};break;case 24:this.$={stmt:"state",id:r[a],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[a-1].trim(),note:{position:r[a-2].trim(),text:r[a].trim()}};break;case 29:this.$=r[a].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[a].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[a-3],url:r[a-2],tooltip:r[a-1]};break;case 33:this.$={stmt:"click",id:r[a-3],url:r[a-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[a-1].trim(),classes:r[a].trim()};break;case 36:this.$={stmt:"style",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 37:this.$={stmt:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[a].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[a-2].trim(),classes:[r[a].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:s,6:n},{1:[3]},{3:5,4:e,5:s,6:n},{3:6,4:e,5:s,6:n},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],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:v,51:x,52:$,53:C,54:D,57:I},t(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:v,51:x,52:$,53:C,54:D,57:I},t(A,[2,7]),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(A,[2,11]),t(A,[2,12],{14:[1,40],15:[1,41]}),t(A,[2,16]),{18:[1,42]},t(A,[2,18],{20:[1,43]}),{23:[1,44]},t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(A,[2,28]),{34:[1,49]},{36:[1,50]},t(A,[2,31]),{13:51,24:u,57:I},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(L,[2,44],{58:[1,56]}),t(L,[2,45],{58:[1,57]}),t(A,[2,38]),t(A,[2,39]),t(A,[2,40]),t(A,[2,41]),t(A,[2,6]),t(A,[2,13]),{13:58,24:u,57:I},t(A,[2,17]),t(w,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(A,[2,29]),t(A,[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(A,[2,14],{14:[1,71]}),{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,72],22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:v,51:x,52:$,53:C,54:D,57:I},t(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(A,[2,34]),t(A,[2,35]),t(A,[2,36]),t(A,[2,37]),t(L,[2,46]),t(L,[2,47]),t(A,[2,15]),t(A,[2,19]),t(w,r,{7:78}),t(A,[2,26]),t(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,81],22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:v,51:x,52:$,53:C,54:D,57:I},t(A,[2,32]),t(A,[2,33]),t(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:i(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:i(function(t){var e=this,s=[0],n=[],r=[null],o=[],a=this.table,l="",c=0,h=0,d=o.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var g=u.yylloc;o.push(g);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=n.pop()||u.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i(function(t){s.length=s.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),i(m,"lex");for(var S,k,b,T,_,E,v,x,$={};;){if(k=s[s.length-1],this.defaultActions[k]?b=this.defaultActions[k]:(null==S&&(S=m()),b=a[k]&&a[k][S]),void 0===b||!b.length||!b[0]){var C="";for(_ in x=[],a[k])this.terminals_[_]&&_>2&&x.push("'"+this.terminals_[_]+"'");C=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(C,{text:u.match,token:this.terminals_[S]||S,line:u.yylineno,loc:g,expected:x})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+S);switch(b[0]){case 1:s.push(S),r.push(u.yytext),o.push(u.yylloc),s.push(b[1]),S=null,h=u.yyleng,l=u.yytext,c=u.yylineno,g=u.yylloc;break;case 2:if(E=this.productions_[b[1]][1],$.$=r[r.length-E],$._$={first_line:o[o.length-(E||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(E||1)].first_column,last_column:o[o.length-1].last_column},f&&($._$.range=[o[o.length-(E||1)].range[0],o[o.length-1].range[1]]),void 0!==(T=this.performAction.apply($,[l,h,c,p.yy,b[1],r,o].concat(d))))return T;E&&(s=s.slice(0,-1*E*2),r=r.slice(0,-1*E),o=o.slice(0,-1*E)),s.push(this.productions_[b[1]][0]),r.push($.$),o.push($._$),v=a[s[s.length-2]][s[s.length-1]],s.push(v);break;case 3:return!0}}return!0},"parse")},O=function(){return{EOF:1,parseError:i(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:i(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:i(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.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),t},"input"),unput:i(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),s.length-1&&(this.yylineno-=s.length-1);var n=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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:i(function(){return this._more=!0,this},"more"),reject:i(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:i(function(t){this.unput(this.match.slice(t))},"less"),pastInput:i(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:i(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:i(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:i(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:i(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:i(function(){var t=this.next();return t||this.lex()},"lex"),begin:i(function(t){this.conditionStack.push(t)},"begin"),popState:i(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:i(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:i(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:i(function(t){this.begin(t)},"pushState"),stateStackSize:i(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:i(function(t,e,s,n){function r(){const s=e.yytext.indexOf("%%");if(0===s)return!1;if(s>0){const i=e.yytext.slice(0,s),n=e.yytext.slice(s);n&&t.lexer.unput(n),e.yytext=i}return!0}switch(i(r,"processId"),s){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!r())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!r())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!r())return;return 24;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79: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,/^(?:[\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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}}();function R(){this.yy={}}return N.lexer=O,i(R,"Parser"),R.prototype=N,N.Parser=R,new R}();b.parser=b;var T=b,_="state",E="root",v="relation",x="default",$="divider",C="fill:none",D="fill: #333",I="markdown",A="normal",L="rect",w="rectWithTitle",N="divider",O="roundedWithTitle",R="statediagram",B=`${R}-state`,F="transition",P=`${F} note-edge`,Y=`${R}-note`,G=`${R}-cluster`,j=`${R}-cluster-alt`,z="parent",W="note",M="----",U=`${M}${W}`,X=`${M}${z}`,H=i((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir"),V={getClasses:i(function(t,e){return e.db.getClasses()},"getClasses"),draw:i(async function(t,i,l,c){n.info("REF0:"),n.info("Drawing state diagram (v2)",i);const{securityLevel:h,state:d,layout:u}=r();c.db.extract(c.db.getRootDocV2());const p=c.db.getData(),y=e(i,h);p.type=c.type,p.layoutAlgorithm=u,p.nodeSpacing=(null==d?void 0:d.nodeSpacing)||50,p.rankSpacing=(null==d?void 0:d.rankSpacing)||50;"neo"===r().look?p.markers=["barbNeo"]:p.markers=["barb"],p.diagramId=i,await o(p,y);try{("function"==typeof c.db.getLinks?c.db.getLinks():new Map).forEach((t,e)=>{var s;const i="string"==typeof e?e:"string"==typeof(null==e?void 0:e.id)?e.id:"",r=p.nodes.find(t=>t.id===i);if(!i)return void n.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));const o=null==(s=y.node())?void 0:s.querySelectorAll("g.node, g.rough-node");let a;if(null==o||o.forEach(t=>{var e;const s=null==(e=t.textContent)?void 0:e.trim();t.id!==(null==r?void 0:r.domId)&&s!==i||(a=t)}),!a)return void n.warn("⚠️ Could not find node matching text:",i);const l=a.parentNode;if(!l)return void n.warn("⚠️ Node has no parent, cannot wrap:",i);const c=document.createElementNS("http://www.w3.org/2000/svg","a"),h=t.url.replace(/^"+|"+$/g,"");if(c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h),c.setAttribute("target","_blank"),t.tooltip){const e=t.tooltip.replace(/^"+|"+$/g,"");c.setAttribute("title",e),a.setAttribute("title",e)}l.replaceChild(c,a),c.appendChild(a),n.info("🔗 Wrapped node in <a> tag for:",i,t.url)})}catch(g){n.error("❌ Error injecting clickable links:",g)}a.insertTitle(y,"statediagramTitleText",(null==d?void 0:d.titleTopMargin)??25,c.db.getDiagramTitle()),s(y,8,R,(null==d?void 0:d.useMaxWidth)??!0)},"draw"),getDir:H},J=new Map,K=0;function q(t="",e=0,s="",i=M){return`state-${t}${null!==s&&s.length>0?`${i}${s}`:""}-${e}`}i(q,"stateDomId");var Q=i((t,e,s,i,o,a,l,c)=>{n.trace("items",e),e.forEach(e=>{switch(e.stmt){case _:case x:it(t,e,s,i,o,a,l,c);break;case v:{it(t,e.state1,s,i,o,a,l,c),it(t,e.state2,s,i,o,a,l,c);const n="neo"===l,h={id:"edge"+K,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:n?"arrow_barb_neo":"arrow_barb",style:C,labelStyle:"",label:g.sanitizeText(e.description??"",r()),arrowheadStyle:D,labelpos:"c",labelType:I,thickness:A,classes:F,look:l};o.push(h),K++}}})},"setupDoc"),Z=i((t,e="TB")=>{let s=e;if(t.doc)for(const i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir");function tt(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{const i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));const i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function et(t){var e;return(null==(e=null==t?void 0:t.classes)?void 0:e.join(" "))??""}function st(t){return(null==t?void 0:t.styles)??[]}i(tt,"insertOrUpdateNode"),i(et,"getClassesFromDbInfo"),i(st,"getStylesFromDbInfo");var it=i((t,e,s,i,o,a,l,c)=>{var h,d,u;const p=e.id,y=s.get(p),f=et(y),m=st(y),S=r();if(n.info("dataFetcher parsedItem",e,y,m),"root"!==p){let s=L;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==x&&(s=e.type),J.get(p)||J.set(p,{id:p,shape:s,description:g.sanitizeText(p,S),cssClasses:`${f} ${B}`,cssStyles:m});const r=J.get(p);e.description&&(Array.isArray(r.description)?(r.shape=w,r.description.push(e.description)):(null==(h=r.description)?void 0:h.length)&&r.description.length>0?(r.shape=w,r.description===p?r.description=[e.description]:r.description=[r.description,e.description]):(r.shape=L,r.description=e.description),r.description=g.sanitizeTextOrArray(r.description,S)),1===(null==(d=r.description)?void 0:d.length)&&r.shape===w&&("group"===r.type?r.shape=O:r.shape=L),!r.type&&e.doc&&(n.info("Setting cluster for XCX",p,Z(e)),r.type="group",r.isGroup=!0,r.dir=Z(e),r.explicitDir=e.doc.some(t=>"dir"===t.stmt),r.shape=e.type===$?N:O,r.cssClasses=`${r.cssClasses} ${G} ${a?j:""}`);const y={labelStyle:"",shape:r.shape,label:r.description,cssClasses:r.cssClasses,cssCompiledStyles:[],cssStyles:r.cssStyles,id:p,dir:r.dir,domId:q(p,K),type:r.type,isGroup:"group"===r.type,padding:8,rx:10,ry:10,look:l,labelType:"markdown"};if(y.shape===N&&(y.label=""),t&&"root"!==t.id&&(n.trace("Setting node ",p," to be child of its parent ",t.id),y.parentId=t.id),y.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:Y,cssStyles:[],cssCompiledStyles:[],id:p+U+"-"+K,domId:q(p,K,W),type:r.type,isGroup:"group"===r.type,padding:null==(u=S.flowchart)?void 0:u.padding,look:l,position:e.note.position},s=p+X,n={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:r.cssClasses,cssStyles:[],id:p+X,domId:q(p,K,z),type:"group",isGroup:!0,padding:16,look:l,position:e.note.position};K++,n.id=s,t.parentId=s,tt(i,n,c),tt(i,t,c),tt(i,y,c);let a=p,h=t.id;"left of"===e.note.position&&(a=t.id,h=p),o.push({id:a+"-"+h,start:a,end:h,arrowhead:"none",arrowTypeEnd:"",style:C,labelStyle:"",classes:P,arrowheadStyle:D,labelpos:"c",labelType:I,thickness:A,look:l})}else tt(i,y,c)}e.doc&&(n.trace("Adding nodes children "),Q(e,e.doc,s,i,o,!a,l,c))},"dataFetcher"),nt=i(()=>{J.clear(),K=0},"reset"),rt="[*]",ot="start",at="[*]",lt="end",ct="color",ht="fill",dt="bgFill",ut=",",pt=i(()=>new Map,"newClassesList"),yt=i(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),gt=i(t=>JSON.parse(JSON.stringify(t)),"clone"),ft=(i(t=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=pt(),this.documents={root:yt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=l,this.setAccTitle=c,this.getAccDescription=h,this.setAccDescription=d,this.setDiagramTitle=u,this.getDiagramTitle=p,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),this.bindFunctions=this.bindFunctions.bind(this)}extract(t){this.clear(!0);for(const i of Array.isArray(t)?t:t.doc)switch(i.stmt){case _:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case v:this.addRelation(i.state1,i.state2,i.description);break;case"classDef":this.addStyleClass(i.id.trim(),i.classes);break;case"style":this.handleStyleDef(i);break;case"applyClass":this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip)}const e=this.getStates(),s=r();nt(),it(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),s=t.styleClass.split(",");for(const i of e){let t=this.getState(i);if(!t){const e=i.trim();this.addState(e),t=this.getState(e)}t&&(t.styles=s.map(t=>{var e;return null==(e=t.replace(/;/g,""))?void 0:e.trim()}))}}setRootDoc(t){n.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===v)return this.docTranslator(t,e.state1,!0),void this.docTranslator(t,e.state2,!1);if(e.stmt===_&&(e.id===rt?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==E&&e.stmt!==_||!e.doc)return;const i=[];let n=[];for(const r of e.doc)if(r.type===$){const t=gt(r);t.doc=gt(n),i.push(t),n=[]}else n.push(r);if(i.length>0&&n.length>0){const t={stmt:_,id:y(),type:"divider",doc:gt(n)};i.push(gt(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:E,stmt:E},{id:E,stmt:E,doc:this.rootDoc},!0),{id:E,doc:this.rootDoc}}addState(t,e=x,s=void 0,i=void 0,o=void 0,a=void 0,l=void 0,c=void 0){const h=null==t?void 0:t.trim();if(this.currentDocument.states.has(h)){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.doc||(t.doc=s),t.type||(t.type=e)}else n.info("Adding state ",h,i),this.currentDocument.states.set(h,{stmt:_,id:h,descriptions:[],type:e,doc:s,note:o,classes:[],styles:[],textStyles:[]});if(i){n.info("Setting state description",h,i);(Array.isArray(i)?i:[i]).forEach(t=>this.addDescription(h,t.trim()))}if(o){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.note=o,t.note.text=g.sanitizeText(t.note.text,r())}if(a){n.info("Setting state classes",h,a);(Array.isArray(a)?a:[a]).forEach(t=>this.setCssClass(h,t.trim()))}if(l){n.info("Setting state styles",h,l);(Array.isArray(l)?l:[l]).forEach(t=>this.setStyle(h,t.trim()))}if(c){n.info("Setting state styles",h,l);(Array.isArray(c)?c:[c]).forEach(t=>this.setTextStyle(h,t.trim()))}}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:yt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=pt(),t||(this.links=new Map,f())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){n.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),n.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===rt?(this.startEndCount++,`${ot}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=x){return t===rt?ot:e}endIdIfNeeded(t=""){return t===at?(this.startEndCount++,`${lt}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=x){return t===at?lt:e}addRelationObjs(t,e,s=""){const i=this.startIdIfNeeded(t.id.trim()),n=this.startTypeIfNeeded(t.id.trim(),t.type),o=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,n,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(o,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:g.sanitizeText(s,r())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){const i=this.startIdIfNeeded(t.trim()),n=this.startTypeIfNeeded(t),o=this.endIdIfNeeded(e.trim()),a=this.endTypeIfNeeded(e);this.addState(i,n),this.addState(o,a),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:s?g.sanitizeText(s,r()):void 0})}}addDescription(t,e){var s;const i=this.currentDocument.states.get(t),n=e.startsWith(":")?e.replace(":","").trim():e;null==(s=null==i?void 0:i.descriptions)||s.push(g.sanitizeText(n,r()))}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 s=this.classes.get(t);e&&s&&e.split(ut).forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(ct).exec(t)){const t=e.replace(ht,dt).replace(ct,ht);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){const e=S();m(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{var s;const i=m(t.currentTarget),n=i.attr("title");if(null===n)return;const r=null==(s=t.currentTarget)?void 0:s.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.bottom+"px"),e.html(k.sanitize(n)),i.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0);m(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{var s;let i=this.getState(t);if(!i){const e=t.trim();this.addState(e),i=this.getState(e)}null==(s=null==i?void 0:i.classes)||s.push(e)})}setStyle(t,e){var s,i;null==(i=null==(s=this.getState(t))?void 0:s.styles)||i.push(e)}setTextStyle(t,e){var s,i;null==(i=null==(s=this.getState(t))?void 0:s.textStyles)||i.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){var t;return(null==(t=this.getDirectionStatement())?void 0:t.value)??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=r();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:H(this.getRootDocV2())}}getConfig(){return r().state}},"StateDB"),t.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},t),mt=i(t=>`\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles");export{ft as S,T as a,V as b,mt as s};
1
+ var t;import{g as e}from"./chunk-XXDRQBXY-Bf9B2FsN.js";import{s}from"./chunk-VR4S4FIN-BjtiAe03.js";import{_ as i,l as n,c as r,x as o,y as a,a as l,b as c,g as h,s as d,o as u,p,a8 as y,k as g,q as f,d as m}from"./mermaid.core-DQSlETG7.js";import{f as S}from"./chunk-32BRIVSS-BhpTBz4U.js";import{p as k}from"./index-AdB8XHXv.js";var b=function(){var t=i(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],n=[1,4],r=[2,4],o=[1,9],a=[1,11],l=[1,16],c=[1,17],h=[1,18],d=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],f=[1,23],m=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],E=[1,31],v=[1,32],x=[1,35],$=[1,36],C=[1,37],D=[1,38],I=[1,34],A=[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],L=[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],w=[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],N={trace:i(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,"--\x3e":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:"--\x3e",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:i(function(t,e,s,i,n,r,o){var a=r.length-1;switch(n){case 3:return i.setRootDoc(r[a]),r[a];case 4:this.$=[];break;case 5:"nl"!=r[a]&&(r[a-1].push(r[a]),this.$=r[a-1]);break;case 6:case 7:case 12:this.$=r[a];break;case 8:this.$="nl";break;case 13:const t=r[a-1];t.description=i.trimColon(r[a]),this.$=t;break;case 14:this.$={stmt:"relation",state1:r[a-2],state2:r[a]};break;case 15:const e=i.trimColon(r[a]);this.$={stmt:"relation",state1:r[a-3],state2:r[a-1],description:e};break;case 19:this.$={stmt:"state",id:r[a-3],type:"default",description:"",doc:r[a-1]};break;case 20:var l=r[a],c=r[a-2].trim();if(r[a].match(":")){var h=r[a].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:r[a-3],type:"default",description:r[a-5],doc:r[a-1]};break;case 22:this.$={stmt:"state",id:r[a],type:"fork"};break;case 23:this.$={stmt:"state",id:r[a],type:"join"};break;case 24:this.$={stmt:"state",id:r[a],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[a-1].trim(),note:{position:r[a-2].trim(),text:r[a].trim()}};break;case 29:this.$=r[a].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[a].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[a-3],url:r[a-2],tooltip:r[a-1]};break;case 33:this.$={stmt:"click",id:r[a-3],url:r[a-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[a-1].trim(),classes:r[a].trim()};break;case 36:this.$={stmt:"style",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 37:this.$={stmt:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[a].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[a-2].trim(),classes:[r[a].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:s,6:n},{1:[3]},{3:5,4:e,5:s,6:n},{3:6,4:e,5:s,6:n},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],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:v,51:x,52:$,53:C,54:D,57:I},t(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:v,51:x,52:$,53:C,54:D,57:I},t(A,[2,7]),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(A,[2,11]),t(A,[2,12],{14:[1,40],15:[1,41]}),t(A,[2,16]),{18:[1,42]},t(A,[2,18],{20:[1,43]}),{23:[1,44]},t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(A,[2,28]),{34:[1,49]},{36:[1,50]},t(A,[2,31]),{13:51,24:u,57:I},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(L,[2,44],{58:[1,56]}),t(L,[2,45],{58:[1,57]}),t(A,[2,38]),t(A,[2,39]),t(A,[2,40]),t(A,[2,41]),t(A,[2,6]),t(A,[2,13]),{13:58,24:u,57:I},t(A,[2,17]),t(w,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(A,[2,29]),t(A,[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(A,[2,14],{14:[1,71]}),{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,72],22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:v,51:x,52:$,53:C,54:D,57:I},t(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(A,[2,34]),t(A,[2,35]),t(A,[2,36]),t(A,[2,37]),t(L,[2,46]),t(L,[2,47]),t(A,[2,15]),t(A,[2,19]),t(w,r,{7:78}),t(A,[2,26]),t(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,81],22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:v,51:x,52:$,53:C,54:D,57:I},t(A,[2,32]),t(A,[2,33]),t(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:i(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:i(function(t){var e=this,s=[0],n=[],r=[null],o=[],a=this.table,l="",c=0,h=0,d=o.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var g=u.yylloc;o.push(g);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=n.pop()||u.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i(function(t){s.length=s.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),i(m,"lex");for(var S,k,b,T,_,E,v,x,$={};;){if(k=s[s.length-1],this.defaultActions[k]?b=this.defaultActions[k]:(null==S&&(S=m()),b=a[k]&&a[k][S]),void 0===b||!b.length||!b[0]){var C="";for(_ in x=[],a[k])this.terminals_[_]&&_>2&&x.push("'"+this.terminals_[_]+"'");C=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(C,{text:u.match,token:this.terminals_[S]||S,line:u.yylineno,loc:g,expected:x})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+S);switch(b[0]){case 1:s.push(S),r.push(u.yytext),o.push(u.yylloc),s.push(b[1]),S=null,h=u.yyleng,l=u.yytext,c=u.yylineno,g=u.yylloc;break;case 2:if(E=this.productions_[b[1]][1],$.$=r[r.length-E],$._$={first_line:o[o.length-(E||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(E||1)].first_column,last_column:o[o.length-1].last_column},f&&($._$.range=[o[o.length-(E||1)].range[0],o[o.length-1].range[1]]),void 0!==(T=this.performAction.apply($,[l,h,c,p.yy,b[1],r,o].concat(d))))return T;E&&(s=s.slice(0,-1*E*2),r=r.slice(0,-1*E),o=o.slice(0,-1*E)),s.push(this.productions_[b[1]][0]),r.push($.$),o.push($._$),v=a[s[s.length-2]][s[s.length-1]],s.push(v);break;case 3:return!0}}return!0},"parse")},O=function(){return{EOF:1,parseError:i(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:i(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:i(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.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),t},"input"),unput:i(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),s.length-1&&(this.yylineno-=s.length-1);var n=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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:i(function(){return this._more=!0,this},"more"),reject:i(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:i(function(t){this.unput(this.match.slice(t))},"less"),pastInput:i(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:i(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:i(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:i(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:i(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:i(function(){var t=this.next();return t||this.lex()},"lex"),begin:i(function(t){this.conditionStack.push(t)},"begin"),popState:i(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:i(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:i(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:i(function(t){this.begin(t)},"pushState"),stateStackSize:i(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:i(function(t,e,s,n){function r(){const s=e.yytext.indexOf("%%");if(0===s)return!1;if(s>0){const i=e.yytext.slice(0,s),n=e.yytext.slice(s);n&&t.lexer.unput(n),e.yytext=i}return!0}switch(i(r,"processId"),s){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!r())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!r())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!r())return;return 24;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79: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,/^(?:[\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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}}();function R(){this.yy={}}return N.lexer=O,i(R,"Parser"),R.prototype=N,N.Parser=R,new R}();b.parser=b;var T=b,_="state",E="root",v="relation",x="default",$="divider",C="fill:none",D="fill: #333",I="markdown",A="normal",L="rect",w="rectWithTitle",N="divider",O="roundedWithTitle",R="statediagram",B=`${R}-state`,F="transition",P=`${F} note-edge`,Y=`${R}-note`,G=`${R}-cluster`,j=`${R}-cluster-alt`,z="parent",W="note",M="----",U=`${M}${W}`,X=`${M}${z}`,H=i((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir"),V={getClasses:i(function(t,e){return e.db.getClasses()},"getClasses"),draw:i(async function(t,i,l,c){n.info("REF0:"),n.info("Drawing state diagram (v2)",i);const{securityLevel:h,state:d,layout:u}=r();c.db.extract(c.db.getRootDocV2());const p=c.db.getData(),y=e(i,h);p.type=c.type,p.layoutAlgorithm=u,p.nodeSpacing=(null==d?void 0:d.nodeSpacing)||50,p.rankSpacing=(null==d?void 0:d.rankSpacing)||50;"neo"===r().look?p.markers=["barbNeo"]:p.markers=["barb"],p.diagramId=i,await o(p,y);try{("function"==typeof c.db.getLinks?c.db.getLinks():new Map).forEach((t,e)=>{var s;const i="string"==typeof e?e:"string"==typeof(null==e?void 0:e.id)?e.id:"",r=p.nodes.find(t=>t.id===i);if(!i)return void n.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));const o=null==(s=y.node())?void 0:s.querySelectorAll("g.node, g.rough-node");let a;if(null==o||o.forEach(t=>{var e;const s=null==(e=t.textContent)?void 0:e.trim();t.id!==(null==r?void 0:r.domId)&&s!==i||(a=t)}),!a)return void n.warn("⚠️ Could not find node matching text:",i);const l=a.parentNode;if(!l)return void n.warn("⚠️ Node has no parent, cannot wrap:",i);const c=document.createElementNS("http://www.w3.org/2000/svg","a"),h=t.url.replace(/^"+|"+$/g,"");if(c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h),c.setAttribute("target","_blank"),t.tooltip){const e=t.tooltip.replace(/^"+|"+$/g,"");c.setAttribute("title",e),a.setAttribute("title",e)}l.replaceChild(c,a),c.appendChild(a),n.info("🔗 Wrapped node in <a> tag for:",i,t.url)})}catch(g){n.error("❌ Error injecting clickable links:",g)}a.insertTitle(y,"statediagramTitleText",(null==d?void 0:d.titleTopMargin)??25,c.db.getDiagramTitle()),s(y,8,R,(null==d?void 0:d.useMaxWidth)??!0)},"draw"),getDir:H},J=new Map,K=0;function q(t="",e=0,s="",i=M){return`state-${t}${null!==s&&s.length>0?`${i}${s}`:""}-${e}`}i(q,"stateDomId");var Q=i((t,e,s,i,o,a,l,c)=>{n.trace("items",e),e.forEach(e=>{switch(e.stmt){case _:case x:it(t,e,s,i,o,a,l,c);break;case v:{it(t,e.state1,s,i,o,a,l,c),it(t,e.state2,s,i,o,a,l,c);const n="neo"===l,h={id:"edge"+K,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:n?"arrow_barb_neo":"arrow_barb",style:C,labelStyle:"",label:g.sanitizeText(e.description??"",r()),arrowheadStyle:D,labelpos:"c",labelType:I,thickness:A,classes:F,look:l};o.push(h),K++}}})},"setupDoc"),Z=i((t,e="TB")=>{let s=e;if(t.doc)for(const i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir");function tt(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{const i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));const i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function et(t){var e;return(null==(e=null==t?void 0:t.classes)?void 0:e.join(" "))??""}function st(t){return(null==t?void 0:t.styles)??[]}i(tt,"insertOrUpdateNode"),i(et,"getClassesFromDbInfo"),i(st,"getStylesFromDbInfo");var it=i((t,e,s,i,o,a,l,c)=>{var h,d,u;const p=e.id,y=s.get(p),f=et(y),m=st(y),S=r();if(n.info("dataFetcher parsedItem",e,y,m),"root"!==p){let s=L;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==x&&(s=e.type),J.get(p)||J.set(p,{id:p,shape:s,description:g.sanitizeText(p,S),cssClasses:`${f} ${B}`,cssStyles:m});const r=J.get(p);e.description&&(Array.isArray(r.description)?(r.shape=w,r.description.push(e.description)):(null==(h=r.description)?void 0:h.length)&&r.description.length>0?(r.shape=w,r.description===p?r.description=[e.description]:r.description=[r.description,e.description]):(r.shape=L,r.description=e.description),r.description=g.sanitizeTextOrArray(r.description,S)),1===(null==(d=r.description)?void 0:d.length)&&r.shape===w&&("group"===r.type?r.shape=O:r.shape=L),!r.type&&e.doc&&(n.info("Setting cluster for XCX",p,Z(e)),r.type="group",r.isGroup=!0,r.dir=Z(e),r.explicitDir=e.doc.some(t=>"dir"===t.stmt),r.shape=e.type===$?N:O,r.cssClasses=`${r.cssClasses} ${G} ${a?j:""}`);const y={labelStyle:"",shape:r.shape,label:r.description,cssClasses:r.cssClasses,cssCompiledStyles:[],cssStyles:r.cssStyles,id:p,dir:r.dir,domId:q(p,K),type:r.type,isGroup:"group"===r.type,padding:8,rx:10,ry:10,look:l,labelType:"markdown"};if(y.shape===N&&(y.label=""),t&&"root"!==t.id&&(n.trace("Setting node ",p," to be child of its parent ",t.id),y.parentId=t.id),y.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:Y,cssStyles:[],cssCompiledStyles:[],id:p+U+"-"+K,domId:q(p,K,W),type:r.type,isGroup:"group"===r.type,padding:null==(u=S.flowchart)?void 0:u.padding,look:l,position:e.note.position},s=p+X,n={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:r.cssClasses,cssStyles:[],id:p+X,domId:q(p,K,z),type:"group",isGroup:!0,padding:16,look:l,position:e.note.position};K++,n.id=s,t.parentId=s,tt(i,n,c),tt(i,t,c),tt(i,y,c);let a=p,h=t.id;"left of"===e.note.position&&(a=t.id,h=p),o.push({id:a+"-"+h,start:a,end:h,arrowhead:"none",arrowTypeEnd:"",style:C,labelStyle:"",classes:P,arrowheadStyle:D,labelpos:"c",labelType:I,thickness:A,look:l})}else tt(i,y,c)}e.doc&&(n.trace("Adding nodes children "),Q(e,e.doc,s,i,o,!a,l,c))},"dataFetcher"),nt=i(()=>{J.clear(),K=0},"reset"),rt="[*]",ot="start",at="[*]",lt="end",ct="color",ht="fill",dt="bgFill",ut=",",pt=i(()=>new Map,"newClassesList"),yt=i(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),gt=i(t=>JSON.parse(JSON.stringify(t)),"clone"),ft=(i(t=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=pt(),this.documents={root:yt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=l,this.setAccTitle=c,this.getAccDescription=h,this.setAccDescription=d,this.setDiagramTitle=u,this.getDiagramTitle=p,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),this.bindFunctions=this.bindFunctions.bind(this)}extract(t){this.clear(!0);for(const i of Array.isArray(t)?t:t.doc)switch(i.stmt){case _:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case v:this.addRelation(i.state1,i.state2,i.description);break;case"classDef":this.addStyleClass(i.id.trim(),i.classes);break;case"style":this.handleStyleDef(i);break;case"applyClass":this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip)}const e=this.getStates(),s=r();nt(),it(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),s=t.styleClass.split(",");for(const i of e){let t=this.getState(i);if(!t){const e=i.trim();this.addState(e),t=this.getState(e)}t&&(t.styles=s.map(t=>{var e;return null==(e=t.replace(/;/g,""))?void 0:e.trim()}))}}setRootDoc(t){n.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===v)return this.docTranslator(t,e.state1,!0),void this.docTranslator(t,e.state2,!1);if(e.stmt===_&&(e.id===rt?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==E&&e.stmt!==_||!e.doc)return;const i=[];let n=[];for(const r of e.doc)if(r.type===$){const t=gt(r);t.doc=gt(n),i.push(t),n=[]}else n.push(r);if(i.length>0&&n.length>0){const t={stmt:_,id:y(),type:"divider",doc:gt(n)};i.push(gt(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:E,stmt:E},{id:E,stmt:E,doc:this.rootDoc},!0),{id:E,doc:this.rootDoc}}addState(t,e=x,s=void 0,i=void 0,o=void 0,a=void 0,l=void 0,c=void 0){const h=null==t?void 0:t.trim();if(this.currentDocument.states.has(h)){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.doc||(t.doc=s),t.type||(t.type=e)}else n.info("Adding state ",h,i),this.currentDocument.states.set(h,{stmt:_,id:h,descriptions:[],type:e,doc:s,note:o,classes:[],styles:[],textStyles:[]});if(i){n.info("Setting state description",h,i);(Array.isArray(i)?i:[i]).forEach(t=>this.addDescription(h,t.trim()))}if(o){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.note=o,t.note.text=g.sanitizeText(t.note.text,r())}if(a){n.info("Setting state classes",h,a);(Array.isArray(a)?a:[a]).forEach(t=>this.setCssClass(h,t.trim()))}if(l){n.info("Setting state styles",h,l);(Array.isArray(l)?l:[l]).forEach(t=>this.setStyle(h,t.trim()))}if(c){n.info("Setting state styles",h,l);(Array.isArray(c)?c:[c]).forEach(t=>this.setTextStyle(h,t.trim()))}}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:yt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=pt(),t||(this.links=new Map,f())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){n.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),n.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===rt?(this.startEndCount++,`${ot}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=x){return t===rt?ot:e}endIdIfNeeded(t=""){return t===at?(this.startEndCount++,`${lt}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=x){return t===at?lt:e}addRelationObjs(t,e,s=""){const i=this.startIdIfNeeded(t.id.trim()),n=this.startTypeIfNeeded(t.id.trim(),t.type),o=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,n,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(o,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:g.sanitizeText(s,r())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){const i=this.startIdIfNeeded(t.trim()),n=this.startTypeIfNeeded(t),o=this.endIdIfNeeded(e.trim()),a=this.endTypeIfNeeded(e);this.addState(i,n),this.addState(o,a),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:s?g.sanitizeText(s,r()):void 0})}}addDescription(t,e){var s;const i=this.currentDocument.states.get(t),n=e.startsWith(":")?e.replace(":","").trim():e;null==(s=null==i?void 0:i.descriptions)||s.push(g.sanitizeText(n,r()))}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 s=this.classes.get(t);e&&s&&e.split(ut).forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(ct).exec(t)){const t=e.replace(ht,dt).replace(ct,ht);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){const e=S();m(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{var s;const i=m(t.currentTarget),n=i.attr("title");if(null===n)return;const r=null==(s=t.currentTarget)?void 0:s.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.bottom+"px"),e.html(k.sanitize(n)),i.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0);m(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{var s;let i=this.getState(t);if(!i){const e=t.trim();this.addState(e),i=this.getState(e)}null==(s=null==i?void 0:i.classes)||s.push(e)})}setStyle(t,e){var s,i;null==(i=null==(s=this.getState(t))?void 0:s.styles)||i.push(e)}setTextStyle(t,e){var s,i;null==(i=null==(s=this.getState(t))?void 0:s.textStyles)||i.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){var t;return(null==(t=this.getDirectionStatement())?void 0:t.value)??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=r();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:H(this.getRootDocV2())}}getConfig(){return r().state}},"StateDB"),t.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},t),mt=i(t=>`\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles");export{ft as S,T as a,V as b,mt as s};
@@ -1 +1 @@
1
- import{_ as c}from"./mermaid.core-DkcKZax1.js";function l(c,l){var e,t,a;c.accDescr&&(null==(e=l.setAccDescription)||e.call(l,c.accDescr)),c.accTitle&&(null==(t=l.setAccTitle)||t.call(l,c.accTitle)),c.title&&(null==(a=l.setDiagramTitle)||a.call(l,c.title))}c(l,"populateCommonDb");export{l as p};
1
+ import{_ as c}from"./mermaid.core-DQSlETG7.js";function l(c,l){var e,t,a;c.accDescr&&(null==(e=l.setAccDescription)||e.call(l,c.accDescr)),c.accTitle&&(null==(t=l.setAccTitle)||t.call(l,c.accTitle)),c.title&&(null==(a=l.setDiagramTitle)||a.call(l,c.title))}c(l,"populateCommonDb");export{l as p};
@@ -1 +1 @@
1
- var e,t;import{_ as n,l as r,F as i,z as a,q as o,W as l,e as s,i as d,c as m}from"./mermaid.core-DkcKZax1.js";var c="",h="",p="",u=[],g=new Map,T=n(e=>d(e,m()),"sanitizeText"),f=n(e=>{switch(e.type){case"terminal":return{...e,value:T(e.value)};case"nonterminal":return{...e,name:T(e.name)};case"sequence":return{...e,elements:e.elements.map(f)};case"choice":return{...e,alternatives:e.alternatives.map(f)};case"optional":return{...e,element:f(e.element)};case"repetition":return{...e,element:f(e.element),separator:e.separator?f(e.separator):void 0};case"special":return{...e,text:T(e.text)}}},"sanitizeAstNode"),x=n(()=>{c="",h="",p="",u.length=0,g.clear(),o(),r.debug("[Railroad] Database cleared")},"clear"),w=n(e=>{c=T(e),r.debug("[Railroad] Title set:",e)},"setTitle"),k=n(()=>c,"getTitle"),C={clear:x,setTitle:w,getTitle:k,addRule:n(e=>{const t={...e,name:T(e.name),definition:f(e.definition),comment:e.comment?T(e.comment):void 0};r.debug("[Railroad] Adding rule:",t.name),g.has(t.name)&&r.warn(`[Railroad] Rule '${t.name}' is already defined. Overwriting.`),u.push(t),g.set(t.name,t)},"addRule"),getRules:n(()=>u,"getRules"),getRule:n(e=>g.get(e),"getRule"),setAccTitle:n(e=>{h=T(e).replace(/^\s+/g,""),r.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),getAccTitle:n(()=>h,"getAccTitle"),setAccDescription:n(e=>{p=T(e).replace(/\n\s+/g,"\n"),r.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),getAccDescription:n(()=>p,"getAccDescription"),setDiagramTitle:w,getDiagramTitle:k},F={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},S=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,$=/^[\w "',.-]+$/,y=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),b=n(e=>!!e&&Object.keys(e).every(e=>"railroad"===e||y.has(e)),"isRailroadStyleOptions"),R=n(e=>e?"railroad"in e&&e.railroad?e.railroad:b(e)?e:{}:{},"extractRailroadOverrides"),v=n(e=>{if(!e||b(e))return{};const{railroad:t,svgId:n,theme:r,look:i,...a}=e;return a},"extractThemeOverrides"),z=n((e,t)=>{if("string"!=typeof e)return t;const n=e.trim();return S.test(n)?n:t},"sanitizeColorValue"),N=n((e,t)=>{if("string"!=typeof e)return t;const n=e.trim();return $.test(n)?n:t},"sanitizeFontFamilyValue"),M=n((e,t)=>{const n="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN;return Number.isFinite(n)&&n>=0?n:t},"sanitizeNumberValue"),A=n(e=>{const t="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN;return Number.isFinite(t)&&t>0?t:void 0},"parseThemeFontSize"),B=n(e=>{const t=N(e.fontFamily,F.fontFamily),n=A(e.fontSize)??F.fontSize;return{...F,fontFamily:t,fontSize:n,terminalFill:z(e.secondBkg??e.secondaryColor,F.terminalFill),terminalStroke:z(e.secondaryBorderColor??e.lineColor,F.terminalStroke),terminalTextColor:z(e.secondaryTextColor??e.textColor,F.terminalTextColor),nonTerminalFill:z(e.mainBkg??e.background,F.nonTerminalFill),nonTerminalStroke:z(e.primaryBorderColor??e.lineColor,F.nonTerminalStroke),nonTerminalTextColor:z(e.primaryTextColor??e.textColor,F.nonTerminalTextColor),lineColor:z(e.lineColor,F.lineColor),markerFill:z(e.lineColor,F.markerFill),commentFill:z(e.labelBackground??e.tertiaryColor,F.commentFill),commentStroke:z(e.tertiaryBorderColor??e.lineColor,F.commentStroke),commentTextColor:z(e.tertiaryTextColor??e.textColor,F.commentTextColor),specialFill:z(e.tertiaryColor??e.secondaryColor,F.specialFill),specialStroke:z(e.tertiaryBorderColor??e.secondaryBorderColor,F.specialStroke),ruleNameColor:z(e.titleColor??e.textColor,F.ruleNameColor)}},"buildThemeDefaults"),E=n(e=>{const t=a(),n={...l(),...t.themeVariables??{},...v(e)},r=B(n),i={...t.railroad??{},...R(e)};return{compactMode:i.compactMode??r.compactMode,padding:M(i.padding,r.padding),verticalSeparation:M(i.verticalSeparation,r.verticalSeparation),horizontalSeparation:M(i.horizontalSeparation,r.horizontalSeparation),arcRadius:M(i.arcRadius,r.arcRadius),fontSize:M(i.fontSize,r.fontSize),fontFamily:N(i.fontFamily,r.fontFamily),terminalFill:z(i.terminalFill,r.terminalFill),terminalStroke:z(i.terminalStroke,r.terminalStroke),terminalTextColor:z(i.terminalTextColor,r.terminalTextColor),nonTerminalFill:z(i.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:z(i.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:z(i.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:z(i.lineColor,r.lineColor),strokeWidth:M(i.strokeWidth,r.strokeWidth),markerFill:z(i.markerFill,r.markerFill),commentFill:z(i.commentFill,r.commentFill),commentStroke:z(i.commentStroke,r.commentStroke),commentTextColor:z(i.commentTextColor,r.commentTextColor),specialFill:z(i.specialFill,r.specialFill),specialStroke:z(i.specialStroke,r.specialStroke),ruleNameColor:z(i.ruleNameColor,r.ruleNameColor),showMarkers:i.showMarkers??r.showMarkers,markerRadius:M(i.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),D=n(e=>{const{fontFamily:t,fontSize:n,terminalFill:r,terminalStroke:i,terminalTextColor:a,nonTerminalFill:o,nonTerminalStroke:l,nonTerminalTextColor:s,lineColor:d,strokeWidth:m,markerFill:c,commentFill:h,commentStroke:p,commentTextColor:u,specialFill:g,specialStroke:T,ruleNameColor:f}=E(e);return`\n .railroad-diagram {\n font-family: ${t};\n font-size: ${n}px;\n }\n\n .railroad-terminal rect {\n fill: ${r};\n stroke: ${i};\n stroke-width: ${m}px;\n }\n\n .railroad-terminal text {\n fill: ${a};\n font-family: ${t};\n font-size: ${n}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-nonterminal rect {\n fill: ${o};\n stroke: ${l};\n stroke-width: ${m}px;\n }\n\n .railroad-nonterminal text {\n fill: ${s};\n font-family: ${t};\n font-size: ${n}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-line {\n stroke: ${d};\n stroke-width: ${m}px;\n fill: none;\n }\n\n .railroad-start circle,\n .railroad-end circle {\n fill: ${c};\n }\n\n .railroad-comment ellipse {\n fill: ${h};\n stroke: ${p};\n stroke-width: ${m}px;\n }\n\n .railroad-comment text {\n fill: ${u};\n font-style: italic;\n font-family: ${t};\n font-size: ${n}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-special rect {\n fill: ${g};\n stroke: ${T};\n stroke-width: ${m}px;\n stroke-dasharray: 5,3;\n }\n\n .railroad-special text {\n fill: ${s};\n font-family: ${t};\n font-size: ${n}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-rule-name {\n font-weight: bold;\n fill: ${f};\n font-family: ${t};\n font-size: ${n}px;\n }\n\n .railroad-group {\n /* Grouping container, no specific styles */\n }\n`},"getStyles"),O=(n(e=class{constructor(){this.d=""}moveTo(e,t){return this.d+=`M ${e} ${t} `,this}lineTo(e,t){return this.d+=`L ${e} ${t} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,t,n,r,i,a,o){return this.d+=`A ${e} ${t} ${n} ${r?1:0} ${i?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},"PathBuilder"),e),W=(n(t=class{constructor(e,t=E()){this.textCache=new Map,this.svg=e,this.config=t}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const t=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=t.node().getBBox(),r={width:n.width,height:n.height};return t.remove(),this.textCache.set(e,r),r}renderTerminal(e,t){const n=this.measureText(t),r=n.width+2*this.config.padding,i=n.height+2*this.config.padding,a=e.append("g").attr("class","railroad-terminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i).attr("rx",10).attr("ry",10),a.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderNonTerminal(e,t){const n=this.measureText(t),r=n.width+2*this.config.padding,i=n.height+2*this.config.padding,a=e.append("g").attr("class","railroad-nonterminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),a.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderSequence(e,t){const n=t.map(t=>this.renderExpression(e,t));let r=0,i=0,a=0;for(const s of n)r+=s.dimensions.width,i=Math.max(i,s.dimensions.up),a=Math.max(a,s.dimensions.down);r+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;s<n.length;s++){const e=n[s],t=i-e.dimensions.up;if(o.node().appendChild(e.element).setAttribute("transform",`translate(${l}, ${t})`),s<n.length-1){const t=l+e.dimensions.width,n=t+this.config.horizontalSeparation,r=i;o.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(t,r).lineTo(n,r).build())}l+=e.dimensions.width+this.config.horizontalSeparation}return{element:o.node(),dimensions:{width:r,height:i+a,up:i,down:a}}}renderChoice(e,t){const n=t.map(t=>this.renderExpression(e,t));let r=0,i=0;for(const m of n)r=Math.max(r,m.dimensions.width),i+=m.dimensions.height;i+=(n.length-1)*this.config.verticalSeparation;const a=this.config.arcRadius,o=r+4*a,l=e.append("g").attr("class","railroad-choice");let s=0;const d=i/2;for(const m of n){const e=s,t=e+m.dimensions.up,n=2*a+(r-m.dimensions.width)/2;l.node().appendChild(m.element).setAttribute("transform",`translate(${n}, ${e})`);const i=new O,c=t>d;t===d?i.moveTo(0,d).lineTo(n,t):i.moveTo(0,d).arcTo(a,a,0,!1,c,a,d+(c?a:-a)).lineTo(a,t-(c?a:-a)).arcTo(a,a,0,!1,!c,2*a,t).lineTo(n,t),l.append("path").attr("class","railroad-line").attr("d",i.build());const h=new O,p=n+m.dimensions.width,u=o-2*a;t===d?h.moveTo(p,t).lineTo(o,d):h.moveTo(p,t).lineTo(u,t).arcTo(a,a,0,!1,!c,o-a,t+(c?-a:a)).lineTo(o-a,d+(c?a:-a)).arcTo(a,a,0,!1,c,o,d),l.append("path").attr("class","railroad-line").attr("d",h.build()),s+=m.dimensions.height+this.config.verticalSeparation}return{element:l.node(),dimensions:{width:o,height:i,up:d,down:i-d}}}renderOptional(e,t){const n=this.renderExpression(e,t),r=this.config.arcRadius,i=2*r,a=n.dimensions.width+4*r,o=n.dimensions.height+i,l=e.append("g").attr("class","railroad-optional"),s=2*r,d=i;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${d})`);const m=d+n.dimensions.up,c=(new O).moveTo(0,m).lineTo(2*r,m);l.append("path").attr("class","railroad-line").attr("d",c.build());const h=(new O).moveTo(s+n.dimensions.width,m).lineTo(a,m);l.append("path").attr("class","railroad-line").attr("d",h.build());const p=(new O).moveTo(0,m).arcTo(r,r,0,!1,!1,r,m-r).lineTo(r,r).arcTo(r,r,0,!1,!0,2*r,0).lineTo(a-2*r,0).arcTo(r,r,0,!1,!0,a-r,r).lineTo(a-r,m-r).arcTo(r,r,0,!1,!1,a,m);return l.append("path").attr("class","railroad-line").attr("d",p.build()),{element:l.node(),dimensions:{width:a,height:o,up:m,down:o-m}}}renderRepetition(e,t,n){const r=this.renderExpression(e,t),i=this.config.arcRadius,a=2*i,o=r.dimensions.width+4*i,l=0===n,s=r.dimensions.height+a+(l?a:0),d=e.append("g").attr("class","railroad-repetition"),m=2*i,c=l?a:0;d.node().appendChild(r.element).setAttribute("transform",`translate(${m}, ${c})`);const h=c+r.dimensions.up;d.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(0,h).lineTo(2*i,h).build()),d.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(m+r.dimensions.width,h).lineTo(o,h).build());const p=c+r.dimensions.height+i,u=(new O).moveTo(m+r.dimensions.width,h).arcTo(i,i,0,!1,!0,m+r.dimensions.width+i,h+i).lineTo(m+r.dimensions.width+i,p).arcTo(i,i,0,!1,!0,m+r.dimensions.width,p+i).lineTo(2*i,p+i).arcTo(i,i,0,!1,!0,i,p).lineTo(i,h+i).arcTo(i,i,0,!1,!0,2*i,h);if(d.append("path").attr("class","railroad-line").attr("d",u.build()),l){const e=(new O).moveTo(0,h).arcTo(i,i,0,!1,!1,i,h-i).lineTo(i,i).arcTo(i,i,0,!1,!0,2*i,0).lineTo(o-2*i,0).arcTo(i,i,0,!1,!0,o-i,i).lineTo(o-i,h-i).arcTo(i,i,0,!1,!1,o,h);d.append("path").attr("class","railroad-line").attr("d",e.build())}return{element:d.node(),dimensions:{width:o,height:s,up:h,down:s-h}}}renderSpecial(e,t){const n=this.measureText("? "+t+" ?"),r=n.width+2*this.config.padding,i=n.height+2*this.config.padding,a=e.append("g").attr("class","railroad-special");return a.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),a.append("text").attr("x",r/2).attr("y",i/2).text("? "+t+" ?"),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderExpression(e,t){switch(t.type){case"terminal":return this.renderTerminal(e,t.value);case"nonterminal":return this.renderNonTerminal(e,t.name);case"sequence":return this.renderSequence(e,t.elements);case"choice":return this.renderChoice(e,t.alternatives);case"optional":return this.renderOptional(e,t.element);case"repetition":return this.renderRepetition(e,t.element,t.min);case"special":return this.renderSpecial(e,t.text);default:throw new Error(`Unknown node type: ${t.type}`)}}renderRule(e,t){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${t})`),r=e.name+" =",i=this.measureText(r).width+20,a=i+20,o=n.append("g"),l=this.renderExpression(o,e.definition),s=Math.max(20,l.dimensions.up),d=s-l.dimensions.up;o.attr("transform",`translate(${a}, ${d})`);n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",s).text(r);n.append("g").attr("class","railroad-start").append("circle").attr("cx",i).attr("cy",s).attr("r",this.config.markerRadius);return n.append("g").attr("class","railroad-end").append("circle").attr("cx",a+l.dimensions.width+10).attr("cy",s).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(i+this.config.markerRadius,s).lineTo(a,s).build()),n.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(a+l.dimensions.width,s).lineTo(a+l.dimensions.width+10-this.config.markerRadius,s).build()),{height:Math.max(40,d+l.dimensions.height+2*this.config.padding),width:a+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let t=this.config.padding,n=0;for(const r of e){const e=this.renderRule(r,t);t+=e.height+this.config.verticalSeparation,n=Math.max(n,e.width)}return{width:n+2*this.config.padding,height:t+this.config.padding}}},"RailroadRenderer"),t),q=n((e,t,n)=>{s(e,t.height,t.width,n),e.attr("viewBox",`0 0 ${t.width} ${t.height}`)},"configureRailroadSvgSize"),V={draw:n((e,t,n)=>{r.debug("[Railroad] Rendering diagram\n"+e);try{const e=i(t);e.attr("class","railroad-diagram");const n=a().railroad,o=(null==n?void 0:n.useMaxWidth)??!0,l=C.getRules();if(r.debug(`[Railroad] Rendering ${l.length} rules`),0===l.length)return r.warn("[Railroad] No rules to render"),void q(e,{height:100,width:200},o);const s=new W(e,E()).renderDiagram(l);q(e,s,o),r.debug("[Railroad] Render complete")}catch(o){throw r.error("[Railroad] Render error:",o),o}},"draw")};export{C as d,D as g,V as r};
1
+ var e,t;import{_ as n,l as r,F as i,z as a,q as o,W as l,e as s,i as d,c as m}from"./mermaid.core-DQSlETG7.js";var c="",h="",p="",u=[],g=new Map,T=n(e=>d(e,m()),"sanitizeText"),f=n(e=>{switch(e.type){case"terminal":return{...e,value:T(e.value)};case"nonterminal":return{...e,name:T(e.name)};case"sequence":return{...e,elements:e.elements.map(f)};case"choice":return{...e,alternatives:e.alternatives.map(f)};case"optional":return{...e,element:f(e.element)};case"repetition":return{...e,element:f(e.element),separator:e.separator?f(e.separator):void 0};case"special":return{...e,text:T(e.text)}}},"sanitizeAstNode"),x=n(()=>{c="",h="",p="",u.length=0,g.clear(),o(),r.debug("[Railroad] Database cleared")},"clear"),w=n(e=>{c=T(e),r.debug("[Railroad] Title set:",e)},"setTitle"),k=n(()=>c,"getTitle"),C={clear:x,setTitle:w,getTitle:k,addRule:n(e=>{const t={...e,name:T(e.name),definition:f(e.definition),comment:e.comment?T(e.comment):void 0};r.debug("[Railroad] Adding rule:",t.name),g.has(t.name)&&r.warn(`[Railroad] Rule '${t.name}' is already defined. Overwriting.`),u.push(t),g.set(t.name,t)},"addRule"),getRules:n(()=>u,"getRules"),getRule:n(e=>g.get(e),"getRule"),setAccTitle:n(e=>{h=T(e).replace(/^\s+/g,""),r.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),getAccTitle:n(()=>h,"getAccTitle"),setAccDescription:n(e=>{p=T(e).replace(/\n\s+/g,"\n"),r.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),getAccDescription:n(()=>p,"getAccDescription"),setDiagramTitle:w,getDiagramTitle:k},F={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},S=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,$=/^[\w "',.-]+$/,y=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),b=n(e=>!!e&&Object.keys(e).every(e=>"railroad"===e||y.has(e)),"isRailroadStyleOptions"),R=n(e=>e?"railroad"in e&&e.railroad?e.railroad:b(e)?e:{}:{},"extractRailroadOverrides"),v=n(e=>{if(!e||b(e))return{};const{railroad:t,svgId:n,theme:r,look:i,...a}=e;return a},"extractThemeOverrides"),z=n((e,t)=>{if("string"!=typeof e)return t;const n=e.trim();return S.test(n)?n:t},"sanitizeColorValue"),N=n((e,t)=>{if("string"!=typeof e)return t;const n=e.trim();return $.test(n)?n:t},"sanitizeFontFamilyValue"),M=n((e,t)=>{const n="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN;return Number.isFinite(n)&&n>=0?n:t},"sanitizeNumberValue"),A=n(e=>{const t="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN;return Number.isFinite(t)&&t>0?t:void 0},"parseThemeFontSize"),B=n(e=>{const t=N(e.fontFamily,F.fontFamily),n=A(e.fontSize)??F.fontSize;return{...F,fontFamily:t,fontSize:n,terminalFill:z(e.secondBkg??e.secondaryColor,F.terminalFill),terminalStroke:z(e.secondaryBorderColor??e.lineColor,F.terminalStroke),terminalTextColor:z(e.secondaryTextColor??e.textColor,F.terminalTextColor),nonTerminalFill:z(e.mainBkg??e.background,F.nonTerminalFill),nonTerminalStroke:z(e.primaryBorderColor??e.lineColor,F.nonTerminalStroke),nonTerminalTextColor:z(e.primaryTextColor??e.textColor,F.nonTerminalTextColor),lineColor:z(e.lineColor,F.lineColor),markerFill:z(e.lineColor,F.markerFill),commentFill:z(e.labelBackground??e.tertiaryColor,F.commentFill),commentStroke:z(e.tertiaryBorderColor??e.lineColor,F.commentStroke),commentTextColor:z(e.tertiaryTextColor??e.textColor,F.commentTextColor),specialFill:z(e.tertiaryColor??e.secondaryColor,F.specialFill),specialStroke:z(e.tertiaryBorderColor??e.secondaryBorderColor,F.specialStroke),ruleNameColor:z(e.titleColor??e.textColor,F.ruleNameColor)}},"buildThemeDefaults"),E=n(e=>{const t=a(),n={...l(),...t.themeVariables??{},...v(e)},r=B(n),i={...t.railroad??{},...R(e)};return{compactMode:i.compactMode??r.compactMode,padding:M(i.padding,r.padding),verticalSeparation:M(i.verticalSeparation,r.verticalSeparation),horizontalSeparation:M(i.horizontalSeparation,r.horizontalSeparation),arcRadius:M(i.arcRadius,r.arcRadius),fontSize:M(i.fontSize,r.fontSize),fontFamily:N(i.fontFamily,r.fontFamily),terminalFill:z(i.terminalFill,r.terminalFill),terminalStroke:z(i.terminalStroke,r.terminalStroke),terminalTextColor:z(i.terminalTextColor,r.terminalTextColor),nonTerminalFill:z(i.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:z(i.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:z(i.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:z(i.lineColor,r.lineColor),strokeWidth:M(i.strokeWidth,r.strokeWidth),markerFill:z(i.markerFill,r.markerFill),commentFill:z(i.commentFill,r.commentFill),commentStroke:z(i.commentStroke,r.commentStroke),commentTextColor:z(i.commentTextColor,r.commentTextColor),specialFill:z(i.specialFill,r.specialFill),specialStroke:z(i.specialStroke,r.specialStroke),ruleNameColor:z(i.ruleNameColor,r.ruleNameColor),showMarkers:i.showMarkers??r.showMarkers,markerRadius:M(i.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),D=n(e=>{const{fontFamily:t,fontSize:n,terminalFill:r,terminalStroke:i,terminalTextColor:a,nonTerminalFill:o,nonTerminalStroke:l,nonTerminalTextColor:s,lineColor:d,strokeWidth:m,markerFill:c,commentFill:h,commentStroke:p,commentTextColor:u,specialFill:g,specialStroke:T,ruleNameColor:f}=E(e);return`\n .railroad-diagram {\n font-family: ${t};\n font-size: ${n}px;\n }\n\n .railroad-terminal rect {\n fill: ${r};\n stroke: ${i};\n stroke-width: ${m}px;\n }\n\n .railroad-terminal text {\n fill: ${a};\n font-family: ${t};\n font-size: ${n}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-nonterminal rect {\n fill: ${o};\n stroke: ${l};\n stroke-width: ${m}px;\n }\n\n .railroad-nonterminal text {\n fill: ${s};\n font-family: ${t};\n font-size: ${n}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-line {\n stroke: ${d};\n stroke-width: ${m}px;\n fill: none;\n }\n\n .railroad-start circle,\n .railroad-end circle {\n fill: ${c};\n }\n\n .railroad-comment ellipse {\n fill: ${h};\n stroke: ${p};\n stroke-width: ${m}px;\n }\n\n .railroad-comment text {\n fill: ${u};\n font-style: italic;\n font-family: ${t};\n font-size: ${n}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-special rect {\n fill: ${g};\n stroke: ${T};\n stroke-width: ${m}px;\n stroke-dasharray: 5,3;\n }\n\n .railroad-special text {\n fill: ${s};\n font-family: ${t};\n font-size: ${n}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-rule-name {\n font-weight: bold;\n fill: ${f};\n font-family: ${t};\n font-size: ${n}px;\n }\n\n .railroad-group {\n /* Grouping container, no specific styles */\n }\n`},"getStyles"),O=(n(e=class{constructor(){this.d=""}moveTo(e,t){return this.d+=`M ${e} ${t} `,this}lineTo(e,t){return this.d+=`L ${e} ${t} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,t,n,r,i,a,o){return this.d+=`A ${e} ${t} ${n} ${r?1:0} ${i?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},"PathBuilder"),e),W=(n(t=class{constructor(e,t=E()){this.textCache=new Map,this.svg=e,this.config=t}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const t=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=t.node().getBBox(),r={width:n.width,height:n.height};return t.remove(),this.textCache.set(e,r),r}renderTerminal(e,t){const n=this.measureText(t),r=n.width+2*this.config.padding,i=n.height+2*this.config.padding,a=e.append("g").attr("class","railroad-terminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i).attr("rx",10).attr("ry",10),a.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderNonTerminal(e,t){const n=this.measureText(t),r=n.width+2*this.config.padding,i=n.height+2*this.config.padding,a=e.append("g").attr("class","railroad-nonterminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),a.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderSequence(e,t){const n=t.map(t=>this.renderExpression(e,t));let r=0,i=0,a=0;for(const s of n)r+=s.dimensions.width,i=Math.max(i,s.dimensions.up),a=Math.max(a,s.dimensions.down);r+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;s<n.length;s++){const e=n[s],t=i-e.dimensions.up;if(o.node().appendChild(e.element).setAttribute("transform",`translate(${l}, ${t})`),s<n.length-1){const t=l+e.dimensions.width,n=t+this.config.horizontalSeparation,r=i;o.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(t,r).lineTo(n,r).build())}l+=e.dimensions.width+this.config.horizontalSeparation}return{element:o.node(),dimensions:{width:r,height:i+a,up:i,down:a}}}renderChoice(e,t){const n=t.map(t=>this.renderExpression(e,t));let r=0,i=0;for(const m of n)r=Math.max(r,m.dimensions.width),i+=m.dimensions.height;i+=(n.length-1)*this.config.verticalSeparation;const a=this.config.arcRadius,o=r+4*a,l=e.append("g").attr("class","railroad-choice");let s=0;const d=i/2;for(const m of n){const e=s,t=e+m.dimensions.up,n=2*a+(r-m.dimensions.width)/2;l.node().appendChild(m.element).setAttribute("transform",`translate(${n}, ${e})`);const i=new O,c=t>d;t===d?i.moveTo(0,d).lineTo(n,t):i.moveTo(0,d).arcTo(a,a,0,!1,c,a,d+(c?a:-a)).lineTo(a,t-(c?a:-a)).arcTo(a,a,0,!1,!c,2*a,t).lineTo(n,t),l.append("path").attr("class","railroad-line").attr("d",i.build());const h=new O,p=n+m.dimensions.width,u=o-2*a;t===d?h.moveTo(p,t).lineTo(o,d):h.moveTo(p,t).lineTo(u,t).arcTo(a,a,0,!1,!c,o-a,t+(c?-a:a)).lineTo(o-a,d+(c?a:-a)).arcTo(a,a,0,!1,c,o,d),l.append("path").attr("class","railroad-line").attr("d",h.build()),s+=m.dimensions.height+this.config.verticalSeparation}return{element:l.node(),dimensions:{width:o,height:i,up:d,down:i-d}}}renderOptional(e,t){const n=this.renderExpression(e,t),r=this.config.arcRadius,i=2*r,a=n.dimensions.width+4*r,o=n.dimensions.height+i,l=e.append("g").attr("class","railroad-optional"),s=2*r,d=i;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${d})`);const m=d+n.dimensions.up,c=(new O).moveTo(0,m).lineTo(2*r,m);l.append("path").attr("class","railroad-line").attr("d",c.build());const h=(new O).moveTo(s+n.dimensions.width,m).lineTo(a,m);l.append("path").attr("class","railroad-line").attr("d",h.build());const p=(new O).moveTo(0,m).arcTo(r,r,0,!1,!1,r,m-r).lineTo(r,r).arcTo(r,r,0,!1,!0,2*r,0).lineTo(a-2*r,0).arcTo(r,r,0,!1,!0,a-r,r).lineTo(a-r,m-r).arcTo(r,r,0,!1,!1,a,m);return l.append("path").attr("class","railroad-line").attr("d",p.build()),{element:l.node(),dimensions:{width:a,height:o,up:m,down:o-m}}}renderRepetition(e,t,n){const r=this.renderExpression(e,t),i=this.config.arcRadius,a=2*i,o=r.dimensions.width+4*i,l=0===n,s=r.dimensions.height+a+(l?a:0),d=e.append("g").attr("class","railroad-repetition"),m=2*i,c=l?a:0;d.node().appendChild(r.element).setAttribute("transform",`translate(${m}, ${c})`);const h=c+r.dimensions.up;d.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(0,h).lineTo(2*i,h).build()),d.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(m+r.dimensions.width,h).lineTo(o,h).build());const p=c+r.dimensions.height+i,u=(new O).moveTo(m+r.dimensions.width,h).arcTo(i,i,0,!1,!0,m+r.dimensions.width+i,h+i).lineTo(m+r.dimensions.width+i,p).arcTo(i,i,0,!1,!0,m+r.dimensions.width,p+i).lineTo(2*i,p+i).arcTo(i,i,0,!1,!0,i,p).lineTo(i,h+i).arcTo(i,i,0,!1,!0,2*i,h);if(d.append("path").attr("class","railroad-line").attr("d",u.build()),l){const e=(new O).moveTo(0,h).arcTo(i,i,0,!1,!1,i,h-i).lineTo(i,i).arcTo(i,i,0,!1,!0,2*i,0).lineTo(o-2*i,0).arcTo(i,i,0,!1,!0,o-i,i).lineTo(o-i,h-i).arcTo(i,i,0,!1,!1,o,h);d.append("path").attr("class","railroad-line").attr("d",e.build())}return{element:d.node(),dimensions:{width:o,height:s,up:h,down:s-h}}}renderSpecial(e,t){const n=this.measureText("? "+t+" ?"),r=n.width+2*this.config.padding,i=n.height+2*this.config.padding,a=e.append("g").attr("class","railroad-special");return a.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),a.append("text").attr("x",r/2).attr("y",i/2).text("? "+t+" ?"),{element:a.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderExpression(e,t){switch(t.type){case"terminal":return this.renderTerminal(e,t.value);case"nonterminal":return this.renderNonTerminal(e,t.name);case"sequence":return this.renderSequence(e,t.elements);case"choice":return this.renderChoice(e,t.alternatives);case"optional":return this.renderOptional(e,t.element);case"repetition":return this.renderRepetition(e,t.element,t.min);case"special":return this.renderSpecial(e,t.text);default:throw new Error(`Unknown node type: ${t.type}`)}}renderRule(e,t){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${t})`),r=e.name+" =",i=this.measureText(r).width+20,a=i+20,o=n.append("g"),l=this.renderExpression(o,e.definition),s=Math.max(20,l.dimensions.up),d=s-l.dimensions.up;o.attr("transform",`translate(${a}, ${d})`);n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",s).text(r);n.append("g").attr("class","railroad-start").append("circle").attr("cx",i).attr("cy",s).attr("r",this.config.markerRadius);return n.append("g").attr("class","railroad-end").append("circle").attr("cx",a+l.dimensions.width+10).attr("cy",s).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(i+this.config.markerRadius,s).lineTo(a,s).build()),n.append("path").attr("class","railroad-line").attr("d",(new O).moveTo(a+l.dimensions.width,s).lineTo(a+l.dimensions.width+10-this.config.markerRadius,s).build()),{height:Math.max(40,d+l.dimensions.height+2*this.config.padding),width:a+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let t=this.config.padding,n=0;for(const r of e){const e=this.renderRule(r,t);t+=e.height+this.config.verticalSeparation,n=Math.max(n,e.width)}return{width:n+2*this.config.padding,height:t+this.config.padding}}},"RailroadRenderer"),t),q=n((e,t,n)=>{s(e,t.height,t.width,n),e.attr("viewBox",`0 0 ${t.width} ${t.height}`)},"configureRailroadSvgSize"),V={draw:n((e,t,n)=>{r.debug("[Railroad] Rendering diagram\n"+e);try{const e=i(t);e.attr("class","railroad-diagram");const n=a().railroad,o=(null==n?void 0:n.useMaxWidth)??!0,l=C.getRules();if(r.debug(`[Railroad] Rendering ${l.length} rules`),0===l.length)return r.warn("[Railroad] No rules to render"),void q(e,{height:100,width:200},o);const s=new W(e,E()).renderDiagram(l);q(e,s,o),r.debug("[Railroad] Render complete")}catch(o){throw r.error("[Railroad] Render error:",o),o}},"draw")};export{C as d,D as g,V as r};
@@ -1 +1 @@
1
- import{_ as e,l as n}from"./mermaid.core-DkcKZax1.js";import{i as t,G as r}from"./graph-DaY0Al7L.js";import{b as o,m as a}from"./map-CKQHuyK8.js";function i(e){var n,r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:s(e),edges:d(e)};return t(e.graph())||(r.value=(n=e.graph(),o(n,4))),r}function s(e){return a(e.nodes(),function(n){var r=e.node(n),o=e.parent(n),a={v:n};return t(r)||(a.value=r),t(o)||(a.parent=o),a})}function d(e){return a(e.edges(),function(n){var r=e.edge(n),o={v:n.v,w:n.w};return t(n.name)||(o.name=n.name),t(r)||(o.value=r),o})}var c=new Map,l=new Map,g=new Map,u=e(()=>{l.clear(),g.clear(),c.clear()},"clear"),f=e((e,t)=>{const r=l.get(t)||[];return n.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),h=e((e,t)=>{const r=l.get(t)||[];return n.info("Descendants of ",t," is ",r),n.info("Edge is ",e),e.v!==t&&e.w!==t&&(r?r.includes(e.v)||f(e.v,t)||f(e.w,t)||r.includes(e.w):(n.debug("Tilt, ",t,",not in descendants"),!1))},"edgeInCluster"),p=e((e,t,r,o)=>{n.warn("Copying children of ",e,"root",o,"data",t.node(e),o);const a=t.children(e)||[];e!==o&&a.push(e),n.warn("Copying (nodes) clusterId",e,"nodes",a),a.forEach(a=>{if(t.children(a).length>0)p(a,t,r,o);else{const i=t.node(a);n.info("cp ",a," to ",o," with parent ",e),r.setNode(a,i),o!==t.parent(a)&&(n.warn("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==o&&a!==e?(n.debug("Setting parent",a,e),r.setParent(a,e)):(n.info("In copy ",e,"root",o,"data",t.node(e),o),n.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==o,"node!==clusterId",a!==e));const s=t.edges(a);n.debug("Copying Edges",s),s.forEach(a=>{n.info("Edge",a);const i=t.edge(a.v,a.w,a.name);n.info("Edge data",i,o);try{if(h(a,o)){const e=l.get(o)||[],s=e.includes(a.v)||f(a.v,o)||a.v===o,d=e.includes(a.w)||f(a.w,o)||a.w===o;if(s&&d)n.info("Copying as ",a.v,a.w,i,a.name),r.setEdge(a.v,a.w,i,a.name),n.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const e=s?o:a.v,r=d?o:a.w;n.info("Rebinding cross-boundary edge as ",e,r,i,a.name),t.setEdge(e,r,i,a.name)}}else n.info("Skipping copy of edge ",a.v,"--\x3e",a.w," rootId: ",o," clusterId:",e)}catch(s){n.error(s)}})}n.debug("Removing node",a),t.removeNode(a)})},"copy"),w=e((e,n)=>{const t=n.children(e);let r=[...t];for(const o of t)g.set(o,e),r=[...r,...w(o,n)];return r},"extractDescendants"),v=e((e,n,t)=>{const r=e.edges().filter(e=>e.v===n||e.w===n),o=e.edges().filter(e=>e.v===t||e.w===t),a=r.map(e=>({v:e.v===n?t:e.v,w:e.w===n?n:e.w})),i=o.map(e=>({v:e.v,w:e.w}));return a.filter(e=>i.some(n=>e.v===n.v&&e.w===n.w))},"findCommonEdges"),m=e((e,t,r)=>{const o=t.children(e);if(n.trace("Searching children of id ",e,o),o.length<1)return e;let a;for(const n of o){const e=m(n,t,r),o=v(t,r,e);if(e){if(!(o.length>0))return e;a=e}}return a},"findNonClusterChild"),b=e(e=>c.has(e)&&c.get(e).externalConnections&&c.has(e)?c.get(e).id:e,"getAnchorId"),x=e((e,t)=>{var r;if(!e||t>10)n.debug("Opting out, no graph ");else{n.debug("Opting in, graph "),e.nodes().forEach(function(t){e.children(t).length>0&&(n.warn("Cluster identified",t," Replacement id in edges: ",m(t,e,t)),l.set(t,w(t,e)),c.set(t,{id:m(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),o=e.edges();r.length>0?(n.debug("Cluster identified",t,l),o.forEach(e=>{f(e.v,t)^f(e.w,t)&&(n.warn("Edge: ",e," leaves cluster ",t),n.warn("Descendants of XXX ",t,": ",l.get(t)),c.get(t).externalConnections=!0)})):n.debug("Not a cluster ",t,l)});for(let n of c.keys()){const t=c.get(n).id,o=e.parent(t);o!==n&&c.has(o)&&!c.get(o).externalConnections&&(c.get(n).id=o);const a=e.edges().some(e=>e.v===n);if(t&&(null==(r=c.get(n))?void 0:r.externalConnections)&&a&&N(e,t,n)){const r=y(e,n,e.parent(t));r&&(c.get(n).id=r)}}e.edges().forEach(function(t){const r=e.edge(t);n.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),n.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let o=t.v,a=t.w;if(n.warn("Fix XXX",c,"ids:",t.v,t.w,"Translating: ",c.get(t.v)," --- ",c.get(t.w)),c.get(t.v)||c.get(t.w)){if(n.warn("Fixing and trying - removing XXX",t.v,t.w,t.name),o=b(t.v),a=b(t.w),e.removeEdge(t.v,t.w,t.name),o!==t.v){const n=e.parent(o);c.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){const n=e.parent(a);c.get(n).externalConnections=!0,r.toCluster=t.w}n.warn("Fix Replacing with XXX",o,a,t.name),e.setEdge(o,a,r,t.name)}}),n.warn("Adjusted Graph",i(e)),C(e,0),n.trace(c)}},"adjustClustersAndEdges"),C=e((e,t)=>{var o,a,s,d;if(n.warn("extractor - ",t,i(e),e.children("D")),t>10)return void n.error("Bailing out");let l=e.nodes(),g=!1;for(const n of l){const t=e.children(n);g=g||t.length>0}if(g){n.debug("Nodes = ",l,t);for(const g of l)if(n.debug("Extracting node",g,c,c.has(g)&&!c.get(g).externalConnections,!e.parent(g),e.node(g),e.children("D")," Depth ",t),c.has(g))if((null==(a=null==(o=c.get(g))?void 0:o.clusterData)?void 0:a.explicitDir)&&e.children(g)&&e.children(g).length>0){n.warn("Cluster with explicit dir, creating subgraph for children",g,t);const o=c.get(g).clusterData.dir,a=new r({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});p(g,e,a,g);const s=e.node(g)||{};e.setNode(g,{...s,clusterNode:!0,id:g,clusterData:c.get(g).clusterData,label:c.get(g).label,graph:a}),n.warn("Subgraph for cluster with explicit dir created:",g,i(a))}else if(!c.get(g).externalConnections&&e.children(g)&&e.children(g).length>0){n.warn("Cluster without external connections, without a parent and with children",g,t);let o="TB"===e.graph().rankdir?"LR":"TB";(null==(d=null==(s=c.get(g))?void 0:s.clusterData)?void 0:d.dir)&&(o=c.get(g).clusterData.dir,n.warn("Fixing dir",c.get(g).clusterData.dir,o));const a=new r({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});p(g,e,a,g);const l=e.node(g)||{};e.setNode(g,{...l,clusterNode:!0,id:g,clusterData:c.get(g).clusterData,label:c.get(g).label,graph:a}),n.debug("Old graph after copy",i(e))}else n.warn("Cluster ** ",g," **not meeting the criteria !externalConnections:",!c.get(g).externalConnections," no parent: ",!e.parent(g)," children ",e.children(g)&&e.children(g).length>0,e.children("D"),t),n.debug(c);else n.debug("Not a cluster",g,t);l=e.nodes(),n.warn("New list of nodes",l);for(const r of l){const o=e.node(r);n.warn(" Now next level",r,o),(null==o?void 0:o.clusterNode)&&C(o.graph,t+1)}}else n.debug("Done, no node has children",e.nodes())},"extractor"),D=e((e,n)=>{if(0===n.length)return[];let t=Object.assign([],n);return n.forEach(n=>{const r=e.children(n),o=D(e,r);t=[...t,...o]}),t},"sorter"),E=e(e=>D(e,e.children()),"sortNodesByHierarchy"),N=e((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const n=c.get(r);if(n&&!n.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),y=e((e,n,t)=>{const r=e.children(n)??[];for(const o of r){if(o===t||f(o,t))continue;const r=m(o,e,n);if(r&&!N(e,r,n))return r}return null},"findSafeAnchorNode");export{x as a,c as b,u as c,m as f,E as s,i as w};
1
+ import{_ as e,l as n}from"./mermaid.core-DQSlETG7.js";import{i as t,G as r}from"./graph-DaY0Al7L.js";import{b as o,m as a}from"./map-CKQHuyK8.js";function i(e){var n,r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:s(e),edges:d(e)};return t(e.graph())||(r.value=(n=e.graph(),o(n,4))),r}function s(e){return a(e.nodes(),function(n){var r=e.node(n),o=e.parent(n),a={v:n};return t(r)||(a.value=r),t(o)||(a.parent=o),a})}function d(e){return a(e.edges(),function(n){var r=e.edge(n),o={v:n.v,w:n.w};return t(n.name)||(o.name=n.name),t(r)||(o.value=r),o})}var c=new Map,l=new Map,g=new Map,u=e(()=>{l.clear(),g.clear(),c.clear()},"clear"),f=e((e,t)=>{const r=l.get(t)||[];return n.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),h=e((e,t)=>{const r=l.get(t)||[];return n.info("Descendants of ",t," is ",r),n.info("Edge is ",e),e.v!==t&&e.w!==t&&(r?r.includes(e.v)||f(e.v,t)||f(e.w,t)||r.includes(e.w):(n.debug("Tilt, ",t,",not in descendants"),!1))},"edgeInCluster"),p=e((e,t,r,o)=>{n.warn("Copying children of ",e,"root",o,"data",t.node(e),o);const a=t.children(e)||[];e!==o&&a.push(e),n.warn("Copying (nodes) clusterId",e,"nodes",a),a.forEach(a=>{if(t.children(a).length>0)p(a,t,r,o);else{const i=t.node(a);n.info("cp ",a," to ",o," with parent ",e),r.setNode(a,i),o!==t.parent(a)&&(n.warn("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==o&&a!==e?(n.debug("Setting parent",a,e),r.setParent(a,e)):(n.info("In copy ",e,"root",o,"data",t.node(e),o),n.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==o,"node!==clusterId",a!==e));const s=t.edges(a);n.debug("Copying Edges",s),s.forEach(a=>{n.info("Edge",a);const i=t.edge(a.v,a.w,a.name);n.info("Edge data",i,o);try{if(h(a,o)){const e=l.get(o)||[],s=e.includes(a.v)||f(a.v,o)||a.v===o,d=e.includes(a.w)||f(a.w,o)||a.w===o;if(s&&d)n.info("Copying as ",a.v,a.w,i,a.name),r.setEdge(a.v,a.w,i,a.name),n.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const e=s?o:a.v,r=d?o:a.w;n.info("Rebinding cross-boundary edge as ",e,r,i,a.name),t.setEdge(e,r,i,a.name)}}else n.info("Skipping copy of edge ",a.v,"--\x3e",a.w," rootId: ",o," clusterId:",e)}catch(s){n.error(s)}})}n.debug("Removing node",a),t.removeNode(a)})},"copy"),w=e((e,n)=>{const t=n.children(e);let r=[...t];for(const o of t)g.set(o,e),r=[...r,...w(o,n)];return r},"extractDescendants"),v=e((e,n,t)=>{const r=e.edges().filter(e=>e.v===n||e.w===n),o=e.edges().filter(e=>e.v===t||e.w===t),a=r.map(e=>({v:e.v===n?t:e.v,w:e.w===n?n:e.w})),i=o.map(e=>({v:e.v,w:e.w}));return a.filter(e=>i.some(n=>e.v===n.v&&e.w===n.w))},"findCommonEdges"),m=e((e,t,r)=>{const o=t.children(e);if(n.trace("Searching children of id ",e,o),o.length<1)return e;let a;for(const n of o){const e=m(n,t,r),o=v(t,r,e);if(e){if(!(o.length>0))return e;a=e}}return a},"findNonClusterChild"),b=e(e=>c.has(e)&&c.get(e).externalConnections&&c.has(e)?c.get(e).id:e,"getAnchorId"),x=e((e,t)=>{var r;if(!e||t>10)n.debug("Opting out, no graph ");else{n.debug("Opting in, graph "),e.nodes().forEach(function(t){e.children(t).length>0&&(n.warn("Cluster identified",t," Replacement id in edges: ",m(t,e,t)),l.set(t,w(t,e)),c.set(t,{id:m(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),o=e.edges();r.length>0?(n.debug("Cluster identified",t,l),o.forEach(e=>{f(e.v,t)^f(e.w,t)&&(n.warn("Edge: ",e," leaves cluster ",t),n.warn("Descendants of XXX ",t,": ",l.get(t)),c.get(t).externalConnections=!0)})):n.debug("Not a cluster ",t,l)});for(let n of c.keys()){const t=c.get(n).id,o=e.parent(t);o!==n&&c.has(o)&&!c.get(o).externalConnections&&(c.get(n).id=o);const a=e.edges().some(e=>e.v===n);if(t&&(null==(r=c.get(n))?void 0:r.externalConnections)&&a&&N(e,t,n)){const r=y(e,n,e.parent(t));r&&(c.get(n).id=r)}}e.edges().forEach(function(t){const r=e.edge(t);n.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),n.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let o=t.v,a=t.w;if(n.warn("Fix XXX",c,"ids:",t.v,t.w,"Translating: ",c.get(t.v)," --- ",c.get(t.w)),c.get(t.v)||c.get(t.w)){if(n.warn("Fixing and trying - removing XXX",t.v,t.w,t.name),o=b(t.v),a=b(t.w),e.removeEdge(t.v,t.w,t.name),o!==t.v){const n=e.parent(o);c.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){const n=e.parent(a);c.get(n).externalConnections=!0,r.toCluster=t.w}n.warn("Fix Replacing with XXX",o,a,t.name),e.setEdge(o,a,r,t.name)}}),n.warn("Adjusted Graph",i(e)),C(e,0),n.trace(c)}},"adjustClustersAndEdges"),C=e((e,t)=>{var o,a,s,d;if(n.warn("extractor - ",t,i(e),e.children("D")),t>10)return void n.error("Bailing out");let l=e.nodes(),g=!1;for(const n of l){const t=e.children(n);g=g||t.length>0}if(g){n.debug("Nodes = ",l,t);for(const g of l)if(n.debug("Extracting node",g,c,c.has(g)&&!c.get(g).externalConnections,!e.parent(g),e.node(g),e.children("D")," Depth ",t),c.has(g))if((null==(a=null==(o=c.get(g))?void 0:o.clusterData)?void 0:a.explicitDir)&&e.children(g)&&e.children(g).length>0){n.warn("Cluster with explicit dir, creating subgraph for children",g,t);const o=c.get(g).clusterData.dir,a=new r({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});p(g,e,a,g);const s=e.node(g)||{};e.setNode(g,{...s,clusterNode:!0,id:g,clusterData:c.get(g).clusterData,label:c.get(g).label,graph:a}),n.warn("Subgraph for cluster with explicit dir created:",g,i(a))}else if(!c.get(g).externalConnections&&e.children(g)&&e.children(g).length>0){n.warn("Cluster without external connections, without a parent and with children",g,t);let o="TB"===e.graph().rankdir?"LR":"TB";(null==(d=null==(s=c.get(g))?void 0:s.clusterData)?void 0:d.dir)&&(o=c.get(g).clusterData.dir,n.warn("Fixing dir",c.get(g).clusterData.dir,o));const a=new r({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});p(g,e,a,g);const l=e.node(g)||{};e.setNode(g,{...l,clusterNode:!0,id:g,clusterData:c.get(g).clusterData,label:c.get(g).label,graph:a}),n.debug("Old graph after copy",i(e))}else n.warn("Cluster ** ",g," **not meeting the criteria !externalConnections:",!c.get(g).externalConnections," no parent: ",!e.parent(g)," children ",e.children(g)&&e.children(g).length>0,e.children("D"),t),n.debug(c);else n.debug("Not a cluster",g,t);l=e.nodes(),n.warn("New list of nodes",l);for(const r of l){const o=e.node(r);n.warn(" Now next level",r,o),(null==o?void 0:o.clusterNode)&&C(o.graph,t+1)}}else n.debug("Done, no node has children",e.nodes())},"extractor"),D=e((e,n)=>{if(0===n.length)return[];let t=Object.assign([],n);return n.forEach(n=>{const r=e.children(n),o=D(e,r);t=[...t,...o]}),t},"sorter"),E=e(e=>D(e,e.children()),"sortNodesByHierarchy"),N=e((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const n=c.get(r);if(n&&!n.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),y=e((e,n,t)=>{const r=e.children(n)??[];for(const o of r){if(o===t||f(o,t))continue;const r=m(o,e,n);if(r&&!N(e,r,n))return r}return null},"findSafeAnchorNode");export{x as a,c as b,u as c,m as f,E as s,i as w};
@@ -1 +1 @@
1
- var t,e;import{g as s}from"./chunk-5VM5RSS4-CqNmatdI.js";import{g as i}from"./chunk-XXDRQBXY-D6g9o0gx.js";import{s as n}from"./chunk-VR4S4FIN-B-fO7gd6.js";import{_ as a,l as r,c as u,v as l,x as o,y as c,d as h,b as p,a as d,s as A,g as y,o as m,p as g,k as C,q as b,r as k,i as E,a5 as f}from"./mermaid.core-DkcKZax1.js";import{f as T}from"./chunk-32BRIVSS-L5rSd5kx.js";import{p as F}from"./index-DknoSkal.js";var D=function(){var t=a(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,18],s=[1,19],i=[1,20],n=[1,41],r=[1,26],u=[1,42],l=[1,24],o=[1,25],c=[1,32],h=[1,33],p=[1,34],d=[1,45],A=[1,35],y=[1,36],m=[1,37],g=[1,38],C=[1,27],b=[1,28],k=[1,29],E=[1,30],f=[1,31],T=[1,44],F=[1,46],D=[1,43],B=[1,47],_=[1,9],S=[1,8,9],N=[1,58],$=[1,59],L=[1,60],x=[1,61],I=[1,62],v=[1,63],O=[1,64],w=[1,8,9,41],R=[1,77],P=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],M=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],G=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],z=[13,60,68,69,70,71,72,86,100,102,103],Y=[1,103],j=[1,121],K=[1,117],W=[1,113],Q=[1,119],X=[1,114],q=[1,115],H=[1,116],V=[1,118],J=[1,120],Z=[22,50,60,61,82,86,87,88,89,90],tt=[1,128],et=[12,39],st=[1,8,9,39,41,44,46],it=[1,8,9,22],nt=[1,153],at=[1,8,9,61],rt=[1,8,9,22,50,60,61,82,86,87,88,89,90],ut={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:a(function(t,e,s,i,n,a,r){var u=a.length-1;switch(n){case 8:this.$=a[u-1];break;case 9:case 10:case 13:case 15:case 46:this.$=a[u];break;case 11:case 14:this.$=a[u-2]+"."+a[u];break;case 12:case 16:case 110:this.$=a[u-1]+a[u];break;case 17:case 18:this.$=a[u-1]+"~"+a[u]+"~";break;case 19:i.addRelation(a[u]);break;case 20:a[u-1].title=i.cleanupLabel(a[u]),i.addRelation(a[u-1]);break;case 31:this.$=a[u].trim(),i.setAccTitle(this.$);break;case 32:case 33:this.$=a[u].trim(),i.setAccDescription(this.$);break;case 34:i.addClassesToNamespace(a[u-3],a[u-1][0],a[u-1][1]),i.popNamespace();break;case 35:i.addClassesToNamespace(a[u-4],a[u-1][0],a[u-1][1]),i.popNamespace();break;case 36:this.$=i.addNamespace(a[u]);break;case 37:this.$=i.addNamespace(a[u-1],a[u]);break;case 38:this.$=[[a[u]],[]];break;case 39:this.$=[[a[u-1]],[]];break;case 40:a[u][0].unshift(a[u-2]),this.$=a[u];break;case 41:this.$=[[],[a[u]]];break;case 42:this.$=[[],[a[u-1]]];break;case 43:a[u][1].unshift(a[u-2]),this.$=a[u];break;case 44:case 45:this.$=[[],[]];break;case 48:i.setCssClass(a[u-2],a[u]);break;case 49:i.addMembers(a[u-3],a[u-1]);break;case 51:i.setCssClass(a[u-5],a[u-3]),i.addMembers(a[u-5],a[u-1]);break;case 52:i.addAnnotation(a[u-3],a[u-1]);break;case 53:i.addAnnotation(a[u-6],a[u-4]),i.addMembers(a[u-6],a[u-1]);break;case 54:i.addAnnotation(a[u-5],a[u-3]);break;case 55:this.$=a[u],i.addClass(a[u]);break;case 56:this.$=a[u-1],i.addClass(a[u-1]),i.setClassLabel(a[u-1],a[u]);break;case 60:i.addAnnotation(a[u],a[u-2]);break;case 61:case 74:case 107:this.$=[a[u]];break;case 62:a[u].push(a[u-1]),this.$=a[u];break;case 63:case 65:case 66:break;case 64:i.addMember(a[u-1],i.cleanupLabel(a[u]));break;case 67:this.$={id1:a[u-2],id2:a[u],relation:a[u-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:a[u-3],id2:a[u],relation:a[u-1],relationTitle1:a[u-2],relationTitle2:"none"};break;case 69:this.$={id1:a[u-3],id2:a[u],relation:a[u-2],relationTitle1:"none",relationTitle2:a[u-1]};break;case 70:this.$={id1:a[u-4],id2:a[u],relation:a[u-2],relationTitle1:a[u-3],relationTitle2:a[u-1]};break;case 71:this.$=i.addNote(a[u],a[u-1]);break;case 72:this.$=i.addNote(a[u]);break;case 73:this.$=a[u-2],i.defineClass(a[u-1],a[u]);break;case 75:this.$=a[u-2].concat([a[u]]);break;case 76:i.setDirection("TB");break;case 77:i.setDirection("BT");break;case 78:i.setDirection("RL");break;case 79:i.setDirection("LR");break;case 80:this.$={type1:a[u-2],type2:a[u],lineType:a[u-1]};break;case 81:this.$={type1:"none",type2:a[u],lineType:a[u-1]};break;case 82:this.$={type1:a[u-1],type2:"none",lineType:a[u]};break;case 83:this.$={type1:"none",type2:"none",lineType:a[u]};break;case 84:this.$=i.relationType.AGGREGATION;break;case 85:this.$=i.relationType.EXTENSION;break;case 86:this.$=i.relationType.COMPOSITION;break;case 87:this.$=i.relationType.DEPENDENCY;break;case 88:this.$=i.relationType.LOLLIPOP;break;case 89:this.$=i.lineType.LINE;break;case 90:this.$=i.lineType.DOTTED_LINE;break;case 91:case 97:this.$=a[u-2],i.setClickEvent(a[u-1],a[u]);break;case 92:case 98:this.$=a[u-3],i.setClickEvent(a[u-2],a[u-1]),i.setTooltip(a[u-2],a[u]);break;case 93:this.$=a[u-2],i.setLink(a[u-1],a[u]);break;case 94:this.$=a[u-3],i.setLink(a[u-2],a[u-1],a[u]);break;case 95:this.$=a[u-3],i.setLink(a[u-2],a[u-1]),i.setTooltip(a[u-2],a[u]);break;case 96:this.$=a[u-4],i.setLink(a[u-3],a[u-2],a[u]),i.setTooltip(a[u-3],a[u-1]);break;case 99:this.$=a[u-3],i.setClickEvent(a[u-2],a[u-1],a[u]);break;case 100:this.$=a[u-4],i.setClickEvent(a[u-3],a[u-2],a[u-1]),i.setTooltip(a[u-3],a[u]);break;case 101:this.$=a[u-3],i.setLink(a[u-2],a[u]);break;case 102:this.$=a[u-4],i.setLink(a[u-3],a[u-1],a[u]);break;case 103:this.$=a[u-4],i.setLink(a[u-3],a[u-1]),i.setTooltip(a[u-3],a[u]);break;case 104:this.$=a[u-5],i.setLink(a[u-4],a[u-2],a[u]),i.setTooltip(a[u-4],a[u-1]);break;case 105:this.$=a[u-2],i.setCssStyle(a[u-1],a[u]);break;case 106:i.setCssClass(a[u-1],a[u]);break;case 108:a[u-2].push(a[u]),this.$=a[u-2]}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:s,37:i,38:22,42:n,43:23,46:r,48:u,51:l,52:o,54:c,56:h,57:p,60:d,62:A,63:y,64:m,65:g,75:C,76:b,78:k,82:E,83:f,86:T,100:F,102:D,103:B},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(_,[2,5],{8:[1,48]}),{8:[1,49]},t(S,[2,19],{22:[1,50]}),t(S,[2,21]),t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),t(S,[2,26]),t(S,[2,27]),t(S,[2,28]),t(S,[2,29]),t(S,[2,30]),{34:[1,51]},{36:[1,52]},t(S,[2,33]),t(S,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:N,69:$,70:L,71:x,72:I,73:v,74:O}),{39:[1,65]},t(w,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(S,[2,65]),t(S,[2,66]),{16:69,60:d,86:T,100:F,102:D},{16:39,17:40,19:70,60:d,86:T,100:F,102:D,103:B},{16:39,17:40,19:71,60:d,86:T,100:F,102:D,103:B},{16:39,17:40,19:72,60:d,86:T,100:F,102:D,103:B},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:d,86:T,100:F,102:D,103:B},{13:R,55:76},{58:78,60:[1,79]},t(S,[2,76]),t(S,[2,77]),t(S,[2,78]),t(S,[2,79]),t(P,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:d,86:T,100:F,102:D,103:B}),t(P,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:d,86:T,100:F,102:D,103:B},{16:39,17:40,19:87,60:d,86:T,100:F,102:D,103:B},t(M,[2,133]),t(M,[2,134]),t(M,[2,135]),t(M,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(_,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:s,37:i,42:n,46:r,48:u,51:l,52:o,54:c,56:h,57:p,60:d,62:A,63:y,64:m,65:g,75:C,76:b,78:k,82:E,83:f,86:T,100:F,102:D,103:B}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:s,37:i,38:22,42:n,43:23,46:r,48:u,51:l,52:o,54:c,56:h,57:p,60:d,62:A,63:y,64:m,65:g,75:C,76:b,78:k,82:E,83:f,86:T,100:F,102:D,103:B},t(S,[2,20]),t(S,[2,31]),t(S,[2,32]),{13:[1,91],16:39,17:40,19:90,60:d,86:T,100:F,102:D,103:B},{53:92,66:56,67:57,68:N,69:$,70:L,71:x,72:I,73:v,74:O},t(S,[2,64]),{67:93,73:v,74:O},t(G,[2,83],{66:94,68:N,69:$,70:L,71:x,72:I}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(z,[2,89]),t(z,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:n,43:23,48:u,54:c,56:h},{16:100,60:d,86:T,100:F,102:D},{41:[1,102],45:101,51:Y},{16:104,60:d,86:T,100:F,102:D},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:j,50:K,59:110,60:W,82:Q,84:111,85:112,86:X,87:q,88:H,89:V,90:J},{60:[1,122]},{13:R,55:123},t(w,[2,72]),t(w,[2,138]),{22:j,50:K,59:124,60:W,61:[1,125],82:Q,84:111,85:112,86:X,87:q,88:H,89:V,90:J},t(Z,[2,74]),{16:39,17:40,19:126,60:d,86:T,100:F,102:D,103:B},t(P,[2,16]),t(P,[2,17]),t(P,[2,18]),{11:127,12:tt,39:[2,36]},t(et,[2,9],{16:85,17:86,15:130,18:[1,129],60:d,86:T,100:F,102:D,103:B}),t(et,[2,10]),t(st,[2,55],{11:131,12:tt}),t(_,[2,7]),{9:[1,132]},t(it,[2,67]),{16:39,17:40,19:133,60:d,86:T,100:F,102:D,103:B},{13:[1,135],16:39,17:40,19:134,60:d,86:T,100:F,102:D,103:B},t(G,[2,82],{66:136,68:N,69:$,70:L,71:x,72:I}),t(G,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:n,43:23,48:u,54:c,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(w,[2,48],{39:[1,142]}),{41:[1,143]},t(w,[2,50]),{41:[2,61],45:144,51:Y},{47:[1,145]},{16:39,17:40,19:146,60:d,86:T,100:F,102:D,103:B},t(S,[2,91],{13:[1,147]}),t(S,[2,93],{13:[1,149],77:[1,148]}),t(S,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(S,[2,105],{61:nt}),t(at,[2,107],{85:154,22:j,50:K,60:W,82:Q,86:X,87:q,88:H,89:V,90:J}),t(rt,[2,109]),t(rt,[2,111]),t(rt,[2,112]),t(rt,[2,113]),t(rt,[2,114]),t(rt,[2,115]),t(rt,[2,116]),t(rt,[2,117]),t(rt,[2,118]),t(rt,[2,119]),t(S,[2,106]),t(w,[2,71]),t(S,[2,73],{61:nt}),{60:[1,155]},t(P,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:d,86:T,100:F,102:D,103:B},t(et,[2,12]),t(st,[2,56]),{1:[2,4]},t(it,[2,69]),t(it,[2,68]),{16:39,17:40,19:158,60:d,86:T,100:F,102:D,103:B},t(G,[2,80]),t(w,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:n,43:23,48:u,54:c,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:u,54:c,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:u,54:c,56:h},{45:163,51:Y},t(w,[2,49]),{41:[2,62]},t(w,[2,52],{39:[1,164]}),t(S,[2,60]),t(S,[2,92]),t(S,[2,94]),t(S,[2,95],{77:[1,165]}),t(S,[2,98]),t(S,[2,99],{13:[1,166]}),t(S,[2,101],{13:[1,168],77:[1,167]}),{22:j,50:K,60:W,82:Q,84:169,85:112,86:X,87:q,88:H,89:V,90:J},t(rt,[2,110]),t(Z,[2,75]),{14:[1,170]},t(et,[2,11]),t(it,[2,70]),t(w,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:Y},t(S,[2,96]),t(S,[2,100]),t(S,[2,102]),t(S,[2,103],{77:[1,174]}),t(at,[2,108],{85:154,22:j,50:K,60:W,82:Q,86:X,87:q,88:H,89:V,90:J}),t(st,[2,8]),t(w,[2,51]),{41:[1,175]},t(w,[2,54]),t(S,[2,104]),t(w,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:a(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:a(function(t){var e=this,s=[0],i=[],n=[null],r=[],u=this.table,l="",o=0,c=0,h=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var A in this.yy)Object.prototype.hasOwnProperty.call(this.yy,A)&&(d.yy[A]=this.yy[A]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;r.push(y);var m=p.options&&p.options.ranges;function g(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(t){s.length=s.length-2*t,n.length=n.length-t,r.length=r.length-t},"popStack"),a(g,"lex");for(var C,b,k,E,f,T,F,D,B={};;){if(b=s[s.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==C&&(C=g()),k=u[b]&&u[b][C]),void 0===k||!k.length||!k[0]){var _="";for(f in D=[],u[b])this.terminals_[f]&&f>2&&D.push("'"+this.terminals_[f]+"'");_=p.showPosition?"Parse error on line "+(o+1)+":\n"+p.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[C]||C)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==C?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(_,{text:p.match,token:this.terminals_[C]||C,line:p.yylineno,loc:y,expected:D})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+C);switch(k[0]){case 1:s.push(C),n.push(p.yytext),r.push(p.yylloc),s.push(k[1]),C=null,c=p.yyleng,l=p.yytext,o=p.yylineno,y=p.yylloc;break;case 2:if(T=this.productions_[k[1]][1],B.$=n[n.length-T],B._$={first_line:r[r.length-(T||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(T||1)].first_column,last_column:r[r.length-1].last_column},m&&(B._$.range=[r[r.length-(T||1)].range[0],r[r.length-1].range[1]]),void 0!==(E=this.performAction.apply(B,[l,c,o,d.yy,k[1],n,r].concat(h))))return E;T&&(s=s.slice(0,-1*T*2),n=n.slice(0,-1*T),r=r.slice(0,-1*T)),s.push(this.productions_[k[1]][0]),n.push(B.$),r.push(B._$),F=u[s[s.length-2]][s[s.length-1]],s.push(F);break;case 3:return!0}}return!0},"parse")},lt=function(){return{EOF:1,parseError:a(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:a(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:a(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.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),t},"input"),unput:a(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),s.length-1&&(this.yylineno-=s.length-1);var n=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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:a(function(t){this.unput(this.match.slice(t))},"less"),pastInput:a(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:a(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var a in n)this[a]=n[a];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),a=0;a<n.length;a++)if((s=this._input.match(this.rules[n[a]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var t=this.next();return t||this.lex()},"lex"),begin:a(function(t){this.conditionStack.push(t)},"begin"),popState:a(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(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:a(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:a(function(t){this.begin(t)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:a(function(t,e,s,i){switch(s){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:case 5:case 14:case 31:case 37:case 41:case 48:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 19:case 22:case 24:case 59:case 62:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 36:return 8;case 15:case 16:return 7;case 17:case 38:case 46:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 23:return 80;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:case 40:return this.popState(),8;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:case 44:return this.popState(),41;case 35:case 45:return"EOF_IN_STRUCT";case 39:return this.begin("class"),48;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 47:return"OPEN_IN_STRUCT";case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:case 66:case 67:case 68:return 77;case 69:case 70:return 69;case 71:case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:case 86:return 89;case 87:return 90;case 88:case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}}}();function ot(){this.yy={}}return ut.lexer=lt,a(ot,"Parser"),ot.prototype=ut,ut.Parser=ot,new ot}();D.parser=D;var B=D,_=["#","+","~","-",""],S=(a(t=class{constructor(t,e){this.memberType=e,this.visibility="",this.classifier="",this.text="";const s=E(t,u());this.parseMember(s)}getDisplayDetails(){let t=this.visibility+f(this.id);"method"===this.memberType&&(t+=`(${f(this.parameters.trim())})`,this.returnType&&(t+=" : "+f(this.returnType))),t=t.trim();return{displayText:t,cssStyle:this.parseClassifier()}}parseMember(t){let e="";if("method"===this.memberType){const s=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(s){const t=s[1]?s[1].trim():"";if(_.includes(t)&&(this.visibility=t),this.id=s[2],this.parameters=s[3]?s[3].trim():"",e=s[4]?s[4].trim():"",this.returnType=s[5]?s[5].trim():"",""===e){const t=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(t)&&(e=t,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const s=t.length,i=t.substring(0,1),n=t.substring(s-1);_.includes(i)&&(this.visibility=i),/[$*]/.exec(n)&&(e=n),this.id=t.substring(""===this.visibility?0:1,""===e?s:s-1)}this.classifier=e,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const s=`${this.visibility?"\\"+this.visibility:""}${f(this.id)}${"method"===this.memberType?`(${f(this.parameters)})${this.returnType?" : "+f(this.returnType):""}`:""}`;this.text=s.replaceAll("<","&lt;").replaceAll(">","&gt;"),this.text.startsWith("\\&lt;")&&(this.text=this.text.replace("\\&lt;","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},"ClassMember"),t),N="classId-",$=0,L=a(t=>C.sanitizeText(t,u()),"sanitizeText"),x=(a(e=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=a(t=>{const e=T();h(t).select("svg").selectAll("g").filter(function(){return null!==h(this).attr("title")}).on("mouseover",t=>{const s=h(t.currentTarget),i=s.attr("title");if(!i)return;const n=t.currentTarget.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(F.sanitize(i)).style("left",`${window.scrollX+n.left+n.width/2}px`).style("top",`${window.scrollY+n.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0),h(t.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=p,this.getAccTitle=d,this.setAccDescription=A,this.getAccDescription=y,this.setDiagramTitle=m,this.getDiagramTitle=g,this.getConfig=a(()=>u().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(t){const e=C.sanitizeText(t,u());let s="",i=e;if(e.indexOf("~")>0){const t=e.split("~");i=L(t[0]),s=L(t[1])}return{className:i,type:s}}setClassLabel(t,e){const s=C.sanitizeText(t,u());e&&(e=L(e));const{className:i}=this.splitClassNameAndType(s);this.classes.get(i).label=e,this.classes.get(i).text=`${e}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(t){const e=C.sanitizeText(t,u()),{className:s,type:i}=this.splitClassNameAndType(e);if(this.classes.has(s))return;const n=C.sanitizeText(s,u());this.classes.set(n,{id:n,type:i,label:n,text:`${n}${i?`&lt;${i}&gt;`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:N+n+"-"+$}),$++}addInterface(t,e){const s={id:`interface${this.interfaces.length}`,label:t,classId:e};this.interfaces.push(s)}setDiagramId(t){this.diagramId=t}lookUpDomId(t){const e=C.sanitizeText(t,u());if(this.classes.has(e)){const t=this.classes.get(e).domId;return this.diagramId?`${this.diagramId}-${t}`:t}throw new Error("Class not found: "+e)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",b()}getClass(t){return this.classes.get(t)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(t){const e="number"==typeof t?`note${t}`:t;return this.notes.get(e)}getNotes(){return this.notes}addRelation(t){r.debug("Adding relation: "+JSON.stringify(t));const e=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];t.relation.type1!==this.relationType.LOLLIPOP||e.includes(t.relation.type2)?t.relation.type2!==this.relationType.LOLLIPOP||e.includes(t.relation.type1)?(this.addClass(t.id1),this.addClass(t.id2)):(this.addClass(t.id1),this.addInterface(t.id2,t.id1),t.id2="interface"+(this.interfaces.length-1)):(this.addClass(t.id2),this.addInterface(t.id1,t.id2),t.id1="interface"+(this.interfaces.length-1)),t.id1=this.splitClassNameAndType(t.id1).className,t.id2=this.splitClassNameAndType(t.id2).className,t.relationTitle1=C.sanitizeText(t.relationTitle1.trim(),u()),t.relationTitle2=C.sanitizeText(t.relationTitle2.trim(),u()),this.relations.push(t)}addAnnotation(t,e){const s=this.splitClassNameAndType(t).className;this.classes.get(s).annotations.push(e)}addMember(t,e){this.addClass(t);const s=this.splitClassNameAndType(t).className,i=this.classes.get(s);if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?i.annotations.push(L(t.substring(2,t.length-2))):t.indexOf(")")>0?i.methods.push(new S(t,"method")):t&&i.members.push(new S(t,"attribute"))}}addMembers(t,e){Array.isArray(e)&&(e.reverse(),e.forEach(e=>this.addMember(t,e)))}addNote(t,e){const s=this.notes.size,i={id:`note${s}`,class:e,text:t,index:s};return this.notes.set(i.id,i),i.id}cleanupLabel(t){return t.startsWith(":")&&(t=t.substring(1)),L(t.trim())}setCssClass(t,e){t.split(",").forEach(t=>{let s=t;/\d/.exec(t[0])&&(s=N+s),s=this.splitClassNameAndType(s).className;const i=this.classes.get(s);i&&(i.cssClasses+=" "+e)})}defineClass(t,e){for(const s of t){let t=this.styleClasses.get(s);void 0===t&&(t={id:s,styles:[],textStyles:[]},this.styleClasses.set(s,t)),e&&e.forEach(e=>{if(/color/.exec(e)){const s=e.replace("fill","bgFill");t.textStyles.push(s)}t.styles.push(e)}),this.classes.forEach(t=>{t.cssClasses.includes(s)&&t.styles.push(...e.flatMap(t=>t.split(",")))})}}setTooltip(t,e){t.split(",").forEach(t=>{if(void 0!==e){const s=this.splitClassNameAndType(t).className,i=this.classes.get(s);i&&(i.tooltip=L(e))}})}getTooltip(t,e){return e&&this.namespaces.has(e)?this.namespaces.get(e).classes.get(t).tooltip:this.classes.get(t).tooltip}setLink(t,e,s){const i=u();t.split(",").forEach(t=>{let n=t;/\d/.exec(t[0])&&(n=N+n),n=this.splitClassNameAndType(n).className;const a=this.classes.get(n);a&&(a.link=c.formatUrl(e,i),"sandbox"===i.securityLevel?a.linkTarget="_top":a.linkTarget="string"==typeof s?L(s):"_blank")}),this.setCssClass(t,"clickable")}setClickEvent(t,e,s){t.split(",").forEach(t=>{this.setClickFunc(t,e,s);const i=this.splitClassNameAndType(t).className,n=this.classes.get(i);n&&(n.haveCallback=!0)}),this.setCssClass(t,"clickable")}setClickFunc(t,e,s){const i=C.sanitizeText(t,u());if("loose"!==u().securityLevel)return;if(void 0===e)return;const n=this.splitClassNameAndType(i).className;if(this.classes.has(n)){let t=[];if("string"==typeof s){t=s.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<t.length;e++){let s=t[e].trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.substr(1,s.length-2)),t[e]=s}}0===t.length&&t.push(n),this.functions.push(()=>{const s=this.lookUpDomId(n),i=document.querySelector(`[id="${s}"]`);null!==i&&i.addEventListener("click",()=>{c.runFunc(e,...t)},!1)})}}bindFunctions(t){this.functions.forEach(e=>{e(t)})}escapeHtml(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}getDirection(){return this.direction}setDirection(t){this.direction=t}static resolveQualifiedId(t,e){const s=e.at(-1);return s?`${s}.${t}`:t}static getAncestorIds(t){const e=t.split("."),s=new Array(e.length);s[0]=e[0];for(let i=1;i<e.length;i++)s[i]=`${s[i-1]}.${e[i]}`;return s}createNamespaceNode(t,e,s,i=!1){return{id:t,label:e,classes:new Map,notes:new Map,children:new Map,domId:N+t+"-"+this.namespaceCounter++,parent:s,explicit:i}}linkParentChild(t,e){const s=this.namespaces.get(t),i=this.namespaces.get(e);s&&i&&(s.children.has(e)||s.children.set(e,i),i.parent??(i.parent=t))}addNamespace(t,s){const i=e.resolveQualifiedId(t,this.namespaceStack);if(this.namespaceStack.push(i),this.namespaces.has(i)){const t=this.namespaces.get(i);return t.explicit=!0,s&&(t.label=s),i}const n=i.split("."),a=e.getAncestorIds(i);for(let e=0;e<a.length;e++){const t=a[e],i=e>0?a[e-1]:void 0,r=e===a.length-1,u=r&&s?s:n[e];this.namespaces.has(t)?r&&(this.namespaces.get(t).explicit=!0):this.namespaces.set(t,this.createNamespaceNode(t,u,i,r)),i&&this.linkParentChild(i,t)}return i}popNamespace(){this.namespaceStack.pop()}getNamespace(t){return this.namespaces.get(t)}getNamespaces(){return this.namespaces}addClassesToNamespace(t,e,s){if(this.namespaces.has(t)){for(const s of e){const{className:e}=this.splitClassNameAndType(s),i=this.getClass(e);i.parent=t,this.namespaces.get(t).classes.set(e,i)}for(const e of s){const s=this.getNote(e);s.parent=t,this.namespaces.get(t).notes.set(e,s)}}}setCssStyle(t,e){const s=this.classes.get(t);if(e&&s)for(const i of e)i.includes(",")?s.styles.push(...i.split(",")):s.styles.push(i)}getArrowMarker(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}resolveExplicitAncestor(t){let e=t;for(;e;){const t=this.namespaces.get(e);if(!t)return;if(t.explicit)return e;e=t.parent}}getData(){var t,e;const s=[],i=[],n=u(),a=(null==(t=n.class)?void 0:t.hierarchicalNamespaces)??!0;for(const u of this.namespaces.values()){if(!a&&!u.explicit)continue;const t={id:u.id,label:a?u.label:u.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:a?u.parent:void 0};s.push(t)}for(const u of this.classes.values()){const t=a?u.parent:this.resolveExplicitAncestor(u.parent),e={...u,type:void 0,isGroup:!1,parentId:t,look:n.look};s.push(e)}for(const u of this.notes.values()){const t=a?u.parent:this.resolveExplicitAncestor(u.parent),r={id:u.id,label:u.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:t,labelType:"markdown"};s.push(r);const l=null==(e=this.classes.get(u.class))?void 0:e.id;if(l){const t={id:`edgeNote${u.index}`,start:u.id,end:l,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};i.push(t)}}for(const u of this.interfaces){const t={id:u.id,label:u.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};s.push(t)}let r=0;for(const u of this.relations){r++;const t={id:k(u.id1,u.id2,{prefix:"id",counter:r}),start:u.id1,end:u.id2,type:"normal",label:u.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(u.relation.type1),arrowTypeEnd:this.getArrowMarker(u.relation.type2),startLabelRight:"none"===u.relationTitle1?"":u.relationTitle1,endLabelLeft:"none"===u.relationTitle2?"":u.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:u.style||"",pattern:1==u.relation.lineType?"dashed":"solid",look:n.look,labelType:"markdown"};i.push(t)}return{nodes:s,edges:i,other:{},config:n,direction:this.getDirection()}}},"ClassDB"),e),I=a(t=>`g.classGroup text {\n fill: ${t.nodeBorder||t.classText};\n stroke: none;\n font-family: ${t.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n\n.nodeLabel, .edgeLabel {\n color: ${t.classText};\n}\n\n.noteLabel .nodeLabel, .noteLabel .edgeLabel {\n color: ${t.noteTextColor};\n}\n.edgeLabel .label rect {\n fill: ${t.mainBkg};\n}\n.label text {\n fill: ${t.classText};\n}\n\n.labelBkg {\n background: ${t.mainBkg};\n}\n.edgeLabel .label span {\n background: ${t.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: ${t.strokeWidth};\n }\n\n\n.divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${t.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth};\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n[id$="-compositionStart"], .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-compositionEnd"], .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-dependencyStart"], .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-dependencyEnd"], .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-extensionStart"], .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-extensionEnd"], .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-aggregationStart"], .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-aggregationEnd"], .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-lollipopStart"], .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-lollipopEnd"], .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n line-height: initial;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n.edgeLabel[data-look="neo"] {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n ${s()}\n`,"getStyles"),v=a((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir"),O={getClasses:a(function(t,e){return e.db.getClasses()},"getClasses"),draw:a(async function(t,e,s,a){r.info("REF0:"),r.info("Drawing class diagram (v3)",e);const{securityLevel:h,state:p,layout:d}=u();a.db.setDiagramId(e);const A=a.db.getData(),y=i(e,h);A.type=a.type,A.layoutAlgorithm=l(d),A.nodeSpacing=(null==p?void 0:p.nodeSpacing)||50,A.rankSpacing=(null==p?void 0:p.rankSpacing)||50,A.markers=["aggregation","extension","composition","dependency","lollipop"],A.diagramId=e,await o(A,y);c.insertTitle(y,"classDiagramTitleText",(null==p?void 0:p.titleTopMargin)??25,a.db.getDiagramTitle()),n(y,8,"classDiagram",(null==p?void 0:p.useMaxWidth)??!0)},"draw"),getDir:v};export{x as C,B as a,O as c,I as s};
1
+ var t,e;import{g as s}from"./chunk-5VM5RSS4-DE8R6mLs.js";import{g as i}from"./chunk-XXDRQBXY-Bf9B2FsN.js";import{s as n}from"./chunk-VR4S4FIN-BjtiAe03.js";import{_ as a,l as r,c as u,v as l,x as o,y as c,d as h,b as p,a as d,s as A,g as y,o as m,p as g,k as C,q as b,r as k,i as E,a5 as f}from"./mermaid.core-DQSlETG7.js";import{f as T}from"./chunk-32BRIVSS-BhpTBz4U.js";import{p as F}from"./index-AdB8XHXv.js";var D=function(){var t=a(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,18],s=[1,19],i=[1,20],n=[1,41],r=[1,26],u=[1,42],l=[1,24],o=[1,25],c=[1,32],h=[1,33],p=[1,34],d=[1,45],A=[1,35],y=[1,36],m=[1,37],g=[1,38],C=[1,27],b=[1,28],k=[1,29],E=[1,30],f=[1,31],T=[1,44],F=[1,46],D=[1,43],B=[1,47],_=[1,9],S=[1,8,9],N=[1,58],$=[1,59],L=[1,60],x=[1,61],I=[1,62],v=[1,63],O=[1,64],w=[1,8,9,41],R=[1,77],P=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],M=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],G=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],z=[13,60,68,69,70,71,72,86,100,102,103],Y=[1,103],j=[1,121],K=[1,117],W=[1,113],Q=[1,119],X=[1,114],q=[1,115],H=[1,116],V=[1,118],J=[1,120],Z=[22,50,60,61,82,86,87,88,89,90],tt=[1,128],et=[12,39],st=[1,8,9,39,41,44,46],it=[1,8,9,22],nt=[1,153],at=[1,8,9,61],rt=[1,8,9,22,50,60,61,82,86,87,88,89,90],ut={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:a(function(t,e,s,i,n,a,r){var u=a.length-1;switch(n){case 8:this.$=a[u-1];break;case 9:case 10:case 13:case 15:case 46:this.$=a[u];break;case 11:case 14:this.$=a[u-2]+"."+a[u];break;case 12:case 16:case 110:this.$=a[u-1]+a[u];break;case 17:case 18:this.$=a[u-1]+"~"+a[u]+"~";break;case 19:i.addRelation(a[u]);break;case 20:a[u-1].title=i.cleanupLabel(a[u]),i.addRelation(a[u-1]);break;case 31:this.$=a[u].trim(),i.setAccTitle(this.$);break;case 32:case 33:this.$=a[u].trim(),i.setAccDescription(this.$);break;case 34:i.addClassesToNamespace(a[u-3],a[u-1][0],a[u-1][1]),i.popNamespace();break;case 35:i.addClassesToNamespace(a[u-4],a[u-1][0],a[u-1][1]),i.popNamespace();break;case 36:this.$=i.addNamespace(a[u]);break;case 37:this.$=i.addNamespace(a[u-1],a[u]);break;case 38:this.$=[[a[u]],[]];break;case 39:this.$=[[a[u-1]],[]];break;case 40:a[u][0].unshift(a[u-2]),this.$=a[u];break;case 41:this.$=[[],[a[u]]];break;case 42:this.$=[[],[a[u-1]]];break;case 43:a[u][1].unshift(a[u-2]),this.$=a[u];break;case 44:case 45:this.$=[[],[]];break;case 48:i.setCssClass(a[u-2],a[u]);break;case 49:i.addMembers(a[u-3],a[u-1]);break;case 51:i.setCssClass(a[u-5],a[u-3]),i.addMembers(a[u-5],a[u-1]);break;case 52:i.addAnnotation(a[u-3],a[u-1]);break;case 53:i.addAnnotation(a[u-6],a[u-4]),i.addMembers(a[u-6],a[u-1]);break;case 54:i.addAnnotation(a[u-5],a[u-3]);break;case 55:this.$=a[u],i.addClass(a[u]);break;case 56:this.$=a[u-1],i.addClass(a[u-1]),i.setClassLabel(a[u-1],a[u]);break;case 60:i.addAnnotation(a[u],a[u-2]);break;case 61:case 74:case 107:this.$=[a[u]];break;case 62:a[u].push(a[u-1]),this.$=a[u];break;case 63:case 65:case 66:break;case 64:i.addMember(a[u-1],i.cleanupLabel(a[u]));break;case 67:this.$={id1:a[u-2],id2:a[u],relation:a[u-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:a[u-3],id2:a[u],relation:a[u-1],relationTitle1:a[u-2],relationTitle2:"none"};break;case 69:this.$={id1:a[u-3],id2:a[u],relation:a[u-2],relationTitle1:"none",relationTitle2:a[u-1]};break;case 70:this.$={id1:a[u-4],id2:a[u],relation:a[u-2],relationTitle1:a[u-3],relationTitle2:a[u-1]};break;case 71:this.$=i.addNote(a[u],a[u-1]);break;case 72:this.$=i.addNote(a[u]);break;case 73:this.$=a[u-2],i.defineClass(a[u-1],a[u]);break;case 75:this.$=a[u-2].concat([a[u]]);break;case 76:i.setDirection("TB");break;case 77:i.setDirection("BT");break;case 78:i.setDirection("RL");break;case 79:i.setDirection("LR");break;case 80:this.$={type1:a[u-2],type2:a[u],lineType:a[u-1]};break;case 81:this.$={type1:"none",type2:a[u],lineType:a[u-1]};break;case 82:this.$={type1:a[u-1],type2:"none",lineType:a[u]};break;case 83:this.$={type1:"none",type2:"none",lineType:a[u]};break;case 84:this.$=i.relationType.AGGREGATION;break;case 85:this.$=i.relationType.EXTENSION;break;case 86:this.$=i.relationType.COMPOSITION;break;case 87:this.$=i.relationType.DEPENDENCY;break;case 88:this.$=i.relationType.LOLLIPOP;break;case 89:this.$=i.lineType.LINE;break;case 90:this.$=i.lineType.DOTTED_LINE;break;case 91:case 97:this.$=a[u-2],i.setClickEvent(a[u-1],a[u]);break;case 92:case 98:this.$=a[u-3],i.setClickEvent(a[u-2],a[u-1]),i.setTooltip(a[u-2],a[u]);break;case 93:this.$=a[u-2],i.setLink(a[u-1],a[u]);break;case 94:this.$=a[u-3],i.setLink(a[u-2],a[u-1],a[u]);break;case 95:this.$=a[u-3],i.setLink(a[u-2],a[u-1]),i.setTooltip(a[u-2],a[u]);break;case 96:this.$=a[u-4],i.setLink(a[u-3],a[u-2],a[u]),i.setTooltip(a[u-3],a[u-1]);break;case 99:this.$=a[u-3],i.setClickEvent(a[u-2],a[u-1],a[u]);break;case 100:this.$=a[u-4],i.setClickEvent(a[u-3],a[u-2],a[u-1]),i.setTooltip(a[u-3],a[u]);break;case 101:this.$=a[u-3],i.setLink(a[u-2],a[u]);break;case 102:this.$=a[u-4],i.setLink(a[u-3],a[u-1],a[u]);break;case 103:this.$=a[u-4],i.setLink(a[u-3],a[u-1]),i.setTooltip(a[u-3],a[u]);break;case 104:this.$=a[u-5],i.setLink(a[u-4],a[u-2],a[u]),i.setTooltip(a[u-4],a[u-1]);break;case 105:this.$=a[u-2],i.setCssStyle(a[u-1],a[u]);break;case 106:i.setCssClass(a[u-1],a[u]);break;case 108:a[u-2].push(a[u]),this.$=a[u-2]}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:s,37:i,38:22,42:n,43:23,46:r,48:u,51:l,52:o,54:c,56:h,57:p,60:d,62:A,63:y,64:m,65:g,75:C,76:b,78:k,82:E,83:f,86:T,100:F,102:D,103:B},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(_,[2,5],{8:[1,48]}),{8:[1,49]},t(S,[2,19],{22:[1,50]}),t(S,[2,21]),t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),t(S,[2,26]),t(S,[2,27]),t(S,[2,28]),t(S,[2,29]),t(S,[2,30]),{34:[1,51]},{36:[1,52]},t(S,[2,33]),t(S,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:N,69:$,70:L,71:x,72:I,73:v,74:O}),{39:[1,65]},t(w,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(S,[2,65]),t(S,[2,66]),{16:69,60:d,86:T,100:F,102:D},{16:39,17:40,19:70,60:d,86:T,100:F,102:D,103:B},{16:39,17:40,19:71,60:d,86:T,100:F,102:D,103:B},{16:39,17:40,19:72,60:d,86:T,100:F,102:D,103:B},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:d,86:T,100:F,102:D,103:B},{13:R,55:76},{58:78,60:[1,79]},t(S,[2,76]),t(S,[2,77]),t(S,[2,78]),t(S,[2,79]),t(P,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:d,86:T,100:F,102:D,103:B}),t(P,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:d,86:T,100:F,102:D,103:B},{16:39,17:40,19:87,60:d,86:T,100:F,102:D,103:B},t(M,[2,133]),t(M,[2,134]),t(M,[2,135]),t(M,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(_,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:s,37:i,42:n,46:r,48:u,51:l,52:o,54:c,56:h,57:p,60:d,62:A,63:y,64:m,65:g,75:C,76:b,78:k,82:E,83:f,86:T,100:F,102:D,103:B}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:s,37:i,38:22,42:n,43:23,46:r,48:u,51:l,52:o,54:c,56:h,57:p,60:d,62:A,63:y,64:m,65:g,75:C,76:b,78:k,82:E,83:f,86:T,100:F,102:D,103:B},t(S,[2,20]),t(S,[2,31]),t(S,[2,32]),{13:[1,91],16:39,17:40,19:90,60:d,86:T,100:F,102:D,103:B},{53:92,66:56,67:57,68:N,69:$,70:L,71:x,72:I,73:v,74:O},t(S,[2,64]),{67:93,73:v,74:O},t(G,[2,83],{66:94,68:N,69:$,70:L,71:x,72:I}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(z,[2,89]),t(z,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:n,43:23,48:u,54:c,56:h},{16:100,60:d,86:T,100:F,102:D},{41:[1,102],45:101,51:Y},{16:104,60:d,86:T,100:F,102:D},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:j,50:K,59:110,60:W,82:Q,84:111,85:112,86:X,87:q,88:H,89:V,90:J},{60:[1,122]},{13:R,55:123},t(w,[2,72]),t(w,[2,138]),{22:j,50:K,59:124,60:W,61:[1,125],82:Q,84:111,85:112,86:X,87:q,88:H,89:V,90:J},t(Z,[2,74]),{16:39,17:40,19:126,60:d,86:T,100:F,102:D,103:B},t(P,[2,16]),t(P,[2,17]),t(P,[2,18]),{11:127,12:tt,39:[2,36]},t(et,[2,9],{16:85,17:86,15:130,18:[1,129],60:d,86:T,100:F,102:D,103:B}),t(et,[2,10]),t(st,[2,55],{11:131,12:tt}),t(_,[2,7]),{9:[1,132]},t(it,[2,67]),{16:39,17:40,19:133,60:d,86:T,100:F,102:D,103:B},{13:[1,135],16:39,17:40,19:134,60:d,86:T,100:F,102:D,103:B},t(G,[2,82],{66:136,68:N,69:$,70:L,71:x,72:I}),t(G,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:n,43:23,48:u,54:c,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(w,[2,48],{39:[1,142]}),{41:[1,143]},t(w,[2,50]),{41:[2,61],45:144,51:Y},{47:[1,145]},{16:39,17:40,19:146,60:d,86:T,100:F,102:D,103:B},t(S,[2,91],{13:[1,147]}),t(S,[2,93],{13:[1,149],77:[1,148]}),t(S,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(S,[2,105],{61:nt}),t(at,[2,107],{85:154,22:j,50:K,60:W,82:Q,86:X,87:q,88:H,89:V,90:J}),t(rt,[2,109]),t(rt,[2,111]),t(rt,[2,112]),t(rt,[2,113]),t(rt,[2,114]),t(rt,[2,115]),t(rt,[2,116]),t(rt,[2,117]),t(rt,[2,118]),t(rt,[2,119]),t(S,[2,106]),t(w,[2,71]),t(S,[2,73],{61:nt}),{60:[1,155]},t(P,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:d,86:T,100:F,102:D,103:B},t(et,[2,12]),t(st,[2,56]),{1:[2,4]},t(it,[2,69]),t(it,[2,68]),{16:39,17:40,19:158,60:d,86:T,100:F,102:D,103:B},t(G,[2,80]),t(w,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:n,43:23,48:u,54:c,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:u,54:c,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:u,54:c,56:h},{45:163,51:Y},t(w,[2,49]),{41:[2,62]},t(w,[2,52],{39:[1,164]}),t(S,[2,60]),t(S,[2,92]),t(S,[2,94]),t(S,[2,95],{77:[1,165]}),t(S,[2,98]),t(S,[2,99],{13:[1,166]}),t(S,[2,101],{13:[1,168],77:[1,167]}),{22:j,50:K,60:W,82:Q,84:169,85:112,86:X,87:q,88:H,89:V,90:J},t(rt,[2,110]),t(Z,[2,75]),{14:[1,170]},t(et,[2,11]),t(it,[2,70]),t(w,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:Y},t(S,[2,96]),t(S,[2,100]),t(S,[2,102]),t(S,[2,103],{77:[1,174]}),t(at,[2,108],{85:154,22:j,50:K,60:W,82:Q,86:X,87:q,88:H,89:V,90:J}),t(st,[2,8]),t(w,[2,51]),{41:[1,175]},t(w,[2,54]),t(S,[2,104]),t(w,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:a(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:a(function(t){var e=this,s=[0],i=[],n=[null],r=[],u=this.table,l="",o=0,c=0,h=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var A in this.yy)Object.prototype.hasOwnProperty.call(this.yy,A)&&(d.yy[A]=this.yy[A]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;r.push(y);var m=p.options&&p.options.ranges;function g(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(t){s.length=s.length-2*t,n.length=n.length-t,r.length=r.length-t},"popStack"),a(g,"lex");for(var C,b,k,E,f,T,F,D,B={};;){if(b=s[s.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==C&&(C=g()),k=u[b]&&u[b][C]),void 0===k||!k.length||!k[0]){var _="";for(f in D=[],u[b])this.terminals_[f]&&f>2&&D.push("'"+this.terminals_[f]+"'");_=p.showPosition?"Parse error on line "+(o+1)+":\n"+p.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[C]||C)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==C?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(_,{text:p.match,token:this.terminals_[C]||C,line:p.yylineno,loc:y,expected:D})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+C);switch(k[0]){case 1:s.push(C),n.push(p.yytext),r.push(p.yylloc),s.push(k[1]),C=null,c=p.yyleng,l=p.yytext,o=p.yylineno,y=p.yylloc;break;case 2:if(T=this.productions_[k[1]][1],B.$=n[n.length-T],B._$={first_line:r[r.length-(T||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(T||1)].first_column,last_column:r[r.length-1].last_column},m&&(B._$.range=[r[r.length-(T||1)].range[0],r[r.length-1].range[1]]),void 0!==(E=this.performAction.apply(B,[l,c,o,d.yy,k[1],n,r].concat(h))))return E;T&&(s=s.slice(0,-1*T*2),n=n.slice(0,-1*T),r=r.slice(0,-1*T)),s.push(this.productions_[k[1]][0]),n.push(B.$),r.push(B._$),F=u[s[s.length-2]][s[s.length-1]],s.push(F);break;case 3:return!0}}return!0},"parse")},lt=function(){return{EOF:1,parseError:a(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:a(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:a(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.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),t},"input"),unput:a(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),s.length-1&&(this.yylineno-=s.length-1);var n=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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:a(function(t){this.unput(this.match.slice(t))},"less"),pastInput:a(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:a(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var a in n)this[a]=n[a];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),a=0;a<n.length;a++)if((s=this._input.match(this.rules[n[a]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var t=this.next();return t||this.lex()},"lex"),begin:a(function(t){this.conditionStack.push(t)},"begin"),popState:a(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(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:a(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:a(function(t){this.begin(t)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:a(function(t,e,s,i){switch(s){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:case 5:case 14:case 31:case 37:case 41:case 48:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 19:case 22:case 24:case 59:case 62:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 36:return 8;case 15:case 16:return 7;case 17:case 38:case 46:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 23:return 80;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:case 40:return this.popState(),8;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:case 44:return this.popState(),41;case 35:case 45:return"EOF_IN_STRUCT";case 39:return this.begin("class"),48;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 47:return"OPEN_IN_STRUCT";case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:case 66:case 67:case 68:return 77;case 69:case 70:return 69;case 71:case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:case 86:return 89;case 87:return 90;case 88:case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}}}();function ot(){this.yy={}}return ut.lexer=lt,a(ot,"Parser"),ot.prototype=ut,ut.Parser=ot,new ot}();D.parser=D;var B=D,_=["#","+","~","-",""],S=(a(t=class{constructor(t,e){this.memberType=e,this.visibility="",this.classifier="",this.text="";const s=E(t,u());this.parseMember(s)}getDisplayDetails(){let t=this.visibility+f(this.id);"method"===this.memberType&&(t+=`(${f(this.parameters.trim())})`,this.returnType&&(t+=" : "+f(this.returnType))),t=t.trim();return{displayText:t,cssStyle:this.parseClassifier()}}parseMember(t){let e="";if("method"===this.memberType){const s=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(s){const t=s[1]?s[1].trim():"";if(_.includes(t)&&(this.visibility=t),this.id=s[2],this.parameters=s[3]?s[3].trim():"",e=s[4]?s[4].trim():"",this.returnType=s[5]?s[5].trim():"",""===e){const t=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(t)&&(e=t,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const s=t.length,i=t.substring(0,1),n=t.substring(s-1);_.includes(i)&&(this.visibility=i),/[$*]/.exec(n)&&(e=n),this.id=t.substring(""===this.visibility?0:1,""===e?s:s-1)}this.classifier=e,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const s=`${this.visibility?"\\"+this.visibility:""}${f(this.id)}${"method"===this.memberType?`(${f(this.parameters)})${this.returnType?" : "+f(this.returnType):""}`:""}`;this.text=s.replaceAll("<","&lt;").replaceAll(">","&gt;"),this.text.startsWith("\\&lt;")&&(this.text=this.text.replace("\\&lt;","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},"ClassMember"),t),N="classId-",$=0,L=a(t=>C.sanitizeText(t,u()),"sanitizeText"),x=(a(e=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=a(t=>{const e=T();h(t).select("svg").selectAll("g").filter(function(){return null!==h(this).attr("title")}).on("mouseover",t=>{const s=h(t.currentTarget),i=s.attr("title");if(!i)return;const n=t.currentTarget.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(F.sanitize(i)).style("left",`${window.scrollX+n.left+n.width/2}px`).style("top",`${window.scrollY+n.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0),h(t.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=p,this.getAccTitle=d,this.setAccDescription=A,this.getAccDescription=y,this.setDiagramTitle=m,this.getDiagramTitle=g,this.getConfig=a(()=>u().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(t){const e=C.sanitizeText(t,u());let s="",i=e;if(e.indexOf("~")>0){const t=e.split("~");i=L(t[0]),s=L(t[1])}return{className:i,type:s}}setClassLabel(t,e){const s=C.sanitizeText(t,u());e&&(e=L(e));const{className:i}=this.splitClassNameAndType(s);this.classes.get(i).label=e,this.classes.get(i).text=`${e}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(t){const e=C.sanitizeText(t,u()),{className:s,type:i}=this.splitClassNameAndType(e);if(this.classes.has(s))return;const n=C.sanitizeText(s,u());this.classes.set(n,{id:n,type:i,label:n,text:`${n}${i?`&lt;${i}&gt;`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:N+n+"-"+$}),$++}addInterface(t,e){const s={id:`interface${this.interfaces.length}`,label:t,classId:e};this.interfaces.push(s)}setDiagramId(t){this.diagramId=t}lookUpDomId(t){const e=C.sanitizeText(t,u());if(this.classes.has(e)){const t=this.classes.get(e).domId;return this.diagramId?`${this.diagramId}-${t}`:t}throw new Error("Class not found: "+e)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",b()}getClass(t){return this.classes.get(t)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(t){const e="number"==typeof t?`note${t}`:t;return this.notes.get(e)}getNotes(){return this.notes}addRelation(t){r.debug("Adding relation: "+JSON.stringify(t));const e=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];t.relation.type1!==this.relationType.LOLLIPOP||e.includes(t.relation.type2)?t.relation.type2!==this.relationType.LOLLIPOP||e.includes(t.relation.type1)?(this.addClass(t.id1),this.addClass(t.id2)):(this.addClass(t.id1),this.addInterface(t.id2,t.id1),t.id2="interface"+(this.interfaces.length-1)):(this.addClass(t.id2),this.addInterface(t.id1,t.id2),t.id1="interface"+(this.interfaces.length-1)),t.id1=this.splitClassNameAndType(t.id1).className,t.id2=this.splitClassNameAndType(t.id2).className,t.relationTitle1=C.sanitizeText(t.relationTitle1.trim(),u()),t.relationTitle2=C.sanitizeText(t.relationTitle2.trim(),u()),this.relations.push(t)}addAnnotation(t,e){const s=this.splitClassNameAndType(t).className;this.classes.get(s).annotations.push(e)}addMember(t,e){this.addClass(t);const s=this.splitClassNameAndType(t).className,i=this.classes.get(s);if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?i.annotations.push(L(t.substring(2,t.length-2))):t.indexOf(")")>0?i.methods.push(new S(t,"method")):t&&i.members.push(new S(t,"attribute"))}}addMembers(t,e){Array.isArray(e)&&(e.reverse(),e.forEach(e=>this.addMember(t,e)))}addNote(t,e){const s=this.notes.size,i={id:`note${s}`,class:e,text:t,index:s};return this.notes.set(i.id,i),i.id}cleanupLabel(t){return t.startsWith(":")&&(t=t.substring(1)),L(t.trim())}setCssClass(t,e){t.split(",").forEach(t=>{let s=t;/\d/.exec(t[0])&&(s=N+s),s=this.splitClassNameAndType(s).className;const i=this.classes.get(s);i&&(i.cssClasses+=" "+e)})}defineClass(t,e){for(const s of t){let t=this.styleClasses.get(s);void 0===t&&(t={id:s,styles:[],textStyles:[]},this.styleClasses.set(s,t)),e&&e.forEach(e=>{if(/color/.exec(e)){const s=e.replace("fill","bgFill");t.textStyles.push(s)}t.styles.push(e)}),this.classes.forEach(t=>{t.cssClasses.includes(s)&&t.styles.push(...e.flatMap(t=>t.split(",")))})}}setTooltip(t,e){t.split(",").forEach(t=>{if(void 0!==e){const s=this.splitClassNameAndType(t).className,i=this.classes.get(s);i&&(i.tooltip=L(e))}})}getTooltip(t,e){return e&&this.namespaces.has(e)?this.namespaces.get(e).classes.get(t).tooltip:this.classes.get(t).tooltip}setLink(t,e,s){const i=u();t.split(",").forEach(t=>{let n=t;/\d/.exec(t[0])&&(n=N+n),n=this.splitClassNameAndType(n).className;const a=this.classes.get(n);a&&(a.link=c.formatUrl(e,i),"sandbox"===i.securityLevel?a.linkTarget="_top":a.linkTarget="string"==typeof s?L(s):"_blank")}),this.setCssClass(t,"clickable")}setClickEvent(t,e,s){t.split(",").forEach(t=>{this.setClickFunc(t,e,s);const i=this.splitClassNameAndType(t).className,n=this.classes.get(i);n&&(n.haveCallback=!0)}),this.setCssClass(t,"clickable")}setClickFunc(t,e,s){const i=C.sanitizeText(t,u());if("loose"!==u().securityLevel)return;if(void 0===e)return;const n=this.splitClassNameAndType(i).className;if(this.classes.has(n)){let t=[];if("string"==typeof s){t=s.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<t.length;e++){let s=t[e].trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.substr(1,s.length-2)),t[e]=s}}0===t.length&&t.push(n),this.functions.push(()=>{const s=this.lookUpDomId(n),i=document.querySelector(`[id="${s}"]`);null!==i&&i.addEventListener("click",()=>{c.runFunc(e,...t)},!1)})}}bindFunctions(t){this.functions.forEach(e=>{e(t)})}escapeHtml(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}getDirection(){return this.direction}setDirection(t){this.direction=t}static resolveQualifiedId(t,e){const s=e.at(-1);return s?`${s}.${t}`:t}static getAncestorIds(t){const e=t.split("."),s=new Array(e.length);s[0]=e[0];for(let i=1;i<e.length;i++)s[i]=`${s[i-1]}.${e[i]}`;return s}createNamespaceNode(t,e,s,i=!1){return{id:t,label:e,classes:new Map,notes:new Map,children:new Map,domId:N+t+"-"+this.namespaceCounter++,parent:s,explicit:i}}linkParentChild(t,e){const s=this.namespaces.get(t),i=this.namespaces.get(e);s&&i&&(s.children.has(e)||s.children.set(e,i),i.parent??(i.parent=t))}addNamespace(t,s){const i=e.resolveQualifiedId(t,this.namespaceStack);if(this.namespaceStack.push(i),this.namespaces.has(i)){const t=this.namespaces.get(i);return t.explicit=!0,s&&(t.label=s),i}const n=i.split("."),a=e.getAncestorIds(i);for(let e=0;e<a.length;e++){const t=a[e],i=e>0?a[e-1]:void 0,r=e===a.length-1,u=r&&s?s:n[e];this.namespaces.has(t)?r&&(this.namespaces.get(t).explicit=!0):this.namespaces.set(t,this.createNamespaceNode(t,u,i,r)),i&&this.linkParentChild(i,t)}return i}popNamespace(){this.namespaceStack.pop()}getNamespace(t){return this.namespaces.get(t)}getNamespaces(){return this.namespaces}addClassesToNamespace(t,e,s){if(this.namespaces.has(t)){for(const s of e){const{className:e}=this.splitClassNameAndType(s),i=this.getClass(e);i.parent=t,this.namespaces.get(t).classes.set(e,i)}for(const e of s){const s=this.getNote(e);s.parent=t,this.namespaces.get(t).notes.set(e,s)}}}setCssStyle(t,e){const s=this.classes.get(t);if(e&&s)for(const i of e)i.includes(",")?s.styles.push(...i.split(",")):s.styles.push(i)}getArrowMarker(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}resolveExplicitAncestor(t){let e=t;for(;e;){const t=this.namespaces.get(e);if(!t)return;if(t.explicit)return e;e=t.parent}}getData(){var t,e;const s=[],i=[],n=u(),a=(null==(t=n.class)?void 0:t.hierarchicalNamespaces)??!0;for(const u of this.namespaces.values()){if(!a&&!u.explicit)continue;const t={id:u.id,label:a?u.label:u.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:a?u.parent:void 0};s.push(t)}for(const u of this.classes.values()){const t=a?u.parent:this.resolveExplicitAncestor(u.parent),e={...u,type:void 0,isGroup:!1,parentId:t,look:n.look};s.push(e)}for(const u of this.notes.values()){const t=a?u.parent:this.resolveExplicitAncestor(u.parent),r={id:u.id,label:u.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:t,labelType:"markdown"};s.push(r);const l=null==(e=this.classes.get(u.class))?void 0:e.id;if(l){const t={id:`edgeNote${u.index}`,start:u.id,end:l,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};i.push(t)}}for(const u of this.interfaces){const t={id:u.id,label:u.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};s.push(t)}let r=0;for(const u of this.relations){r++;const t={id:k(u.id1,u.id2,{prefix:"id",counter:r}),start:u.id1,end:u.id2,type:"normal",label:u.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(u.relation.type1),arrowTypeEnd:this.getArrowMarker(u.relation.type2),startLabelRight:"none"===u.relationTitle1?"":u.relationTitle1,endLabelLeft:"none"===u.relationTitle2?"":u.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:u.style||"",pattern:1==u.relation.lineType?"dashed":"solid",look:n.look,labelType:"markdown"};i.push(t)}return{nodes:s,edges:i,other:{},config:n,direction:this.getDirection()}}},"ClassDB"),e),I=a(t=>`g.classGroup text {\n fill: ${t.nodeBorder||t.classText};\n stroke: none;\n font-family: ${t.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n\n.nodeLabel, .edgeLabel {\n color: ${t.classText};\n}\n\n.noteLabel .nodeLabel, .noteLabel .edgeLabel {\n color: ${t.noteTextColor};\n}\n.edgeLabel .label rect {\n fill: ${t.mainBkg};\n}\n.label text {\n fill: ${t.classText};\n}\n\n.labelBkg {\n background: ${t.mainBkg};\n}\n.edgeLabel .label span {\n background: ${t.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: ${t.strokeWidth};\n }\n\n\n.divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${t.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth};\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n[id$="-compositionStart"], .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-compositionEnd"], .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-dependencyStart"], .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-dependencyEnd"], .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-extensionStart"], .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-extensionEnd"], .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-aggregationStart"], .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-aggregationEnd"], .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-lollipopStart"], .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n[id$="-lollipopEnd"], .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n line-height: initial;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n.edgeLabel[data-look="neo"] {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n ${s()}\n`,"getStyles"),v=a((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir"),O={getClasses:a(function(t,e){return e.db.getClasses()},"getClasses"),draw:a(async function(t,e,s,a){r.info("REF0:"),r.info("Drawing class diagram (v3)",e);const{securityLevel:h,state:p,layout:d}=u();a.db.setDiagramId(e);const A=a.db.getData(),y=i(e,h);A.type=a.type,A.layoutAlgorithm=l(d),A.nodeSpacing=(null==p?void 0:p.nodeSpacing)||50,A.rankSpacing=(null==p?void 0:p.rankSpacing)||50,A.markers=["aggregation","extension","composition","dependency","lollipop"],A.diagramId=e,await o(A,y);c.insertTitle(y,"classDiagramTitleText",(null==p?void 0:p.titleTopMargin)??25,a.db.getDiagramTitle()),n(y,8,"classDiagram",(null==p?void 0:p.useMaxWidth)??!0)},"draw"),getDir:v};export{x as C,B as a,O as c,I as s};