cmcts-c-agent-embedding 1.0.65-vib → 1.1.2-cmcuni

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/_basePickBy-1057a1b4.js +1 -0
  2. package/dist/_basePickBy-cbf78fb3.js +1 -0
  3. package/dist/_baseUniq-38ea2195.js +1 -0
  4. package/dist/_baseUniq-52a47b7b.js +1 -0
  5. package/dist/arc-6b847bc0.js +1 -0
  6. package/dist/arc-8928af28.js +1 -0
  7. package/dist/architecture-O4VJ6CD3-42323263.js +1 -0
  8. package/dist/architecture-O4VJ6CD3-b506967f.js +1 -0
  9. package/dist/architectureDiagram-VXUJARFQ-1bd867b6.js +1 -0
  10. package/dist/architectureDiagram-VXUJARFQ-2b851c59.js +1 -0
  11. package/dist/blockDiagram-VD42YOAC-5cea96b0.js +1 -0
  12. package/dist/blockDiagram-VD42YOAC-a909b757.js +1 -0
  13. package/dist/c4Diagram-YG6GDRKO-24d24519.js +1 -0
  14. package/dist/c4Diagram-YG6GDRKO-54783ab3.js +1 -0
  15. package/dist/channel-2af69aa2.js +1 -0
  16. package/dist/channel-f240e622.js +1 -0
  17. package/dist/chunk-4BX2VUAB-7747ae72.js +1 -0
  18. package/dist/chunk-4BX2VUAB-d05d937e.js +1 -0
  19. package/dist/chunk-55IACEB6-5a7b1be3.js +1 -0
  20. package/dist/chunk-55IACEB6-78729976.js +1 -0
  21. package/dist/chunk-B4BG7PRW-a97e69ff.js +1 -0
  22. package/dist/chunk-B4BG7PRW-cbf800c4.js +1 -0
  23. package/dist/chunk-DI55MBZ5-5dc4f926.js +1 -0
  24. package/dist/chunk-DI55MBZ5-95d71f6f.js +1 -0
  25. package/dist/chunk-FMBD7UC4-2c653fda.js +1 -0
  26. package/dist/chunk-FMBD7UC4-d75ed695.js +1 -0
  27. package/dist/chunk-QN33PNHL-0bf10733.js +1 -0
  28. package/dist/chunk-QN33PNHL-b00655c9.js +1 -0
  29. package/dist/chunk-QZHKN3VN-a979a9fe.js +1 -0
  30. package/dist/chunk-QZHKN3VN-d57979be.js +1 -0
  31. package/dist/chunk-TZMSLE5B-6755c559.js +1 -0
  32. package/dist/chunk-TZMSLE5B-ed6d6d7e.js +1 -0
  33. package/dist/classDiagram-2ON5EDUG-8b5a2a93.js +1 -0
  34. package/dist/classDiagram-2ON5EDUG-fa9ecfbb.js +1 -0
  35. package/dist/classDiagram-v2-WZHVMYZB-8b5a2a93.js +1 -0
  36. package/dist/classDiagram-v2-WZHVMYZB-fa9ecfbb.js +1 -0
  37. package/dist/clone-6cd174cf.js +1 -0
  38. package/dist/clone-8494eb3f.js +1 -0
  39. package/dist/components/Bot.d.ts.map +1 -1
  40. package/dist/components/bubbles/BotBubble.d.ts +0 -1
  41. package/dist/components/bubbles/BotBubble.d.ts.map +1 -1
  42. package/dist/components/bubbles/StarterPromptBubble.d.ts.map +1 -1
  43. package/dist/components/buttons/ConsultationButton.d.ts.map +1 -1
  44. package/dist/components/icons/AddImageIcon.d.ts.map +1 -1
  45. package/dist/components/index.d.ts +2 -0
  46. package/dist/components/index.d.ts.map +1 -1
  47. package/dist/components/inputs/textInput/components/TextInput.d.ts +3 -0
  48. package/dist/components/inputs/textInput/components/TextInput.d.ts.map +1 -1
  49. package/dist/components/modals/ZaloQRModal.d.ts.map +1 -1
  50. package/dist/cose-bilkent-S5V4N54A-2f5eb275.js +1 -0
  51. package/dist/cose-bilkent-S5V4N54A-3cda82b5.js +1 -0
  52. package/dist/cytoscape.esm-9acb9bfe.js +1 -0
  53. package/dist/dagre-6UL2VRFP-9b648c54.js +1 -0
  54. package/dist/dagre-6UL2VRFP-e997588d.js +1 -0
  55. package/dist/defaultLocale-1fe70b7d.js +1 -0
  56. package/dist/diagram-PSM6KHXK-1234d08d.js +1 -0
  57. package/dist/diagram-PSM6KHXK-15013de5.js +1 -0
  58. package/dist/diagram-QEK2KX5R-489b9505.js +1 -0
  59. package/dist/diagram-QEK2KX5R-9e94df2a.js +1 -0
  60. package/dist/diagram-S2PKOQOG-6fef3823.js +1 -0
  61. package/dist/diagram-S2PKOQOG-c943ed25.js +1 -0
  62. package/dist/erDiagram-Q2GNP2WA-2b1823f2.js +1 -0
  63. package/dist/erDiagram-Q2GNP2WA-7e6c6a04.js +1 -0
  64. package/dist/features/bubble/components/BubbleButton.d.ts.map +1 -1
  65. package/dist/flowDiagram-NV44I4VS-709c6479.js +1 -0
  66. package/dist/flowDiagram-NV44I4VS-98a84da9.js +1 -0
  67. package/dist/ganttDiagram-LVOFAZNH-1d379d6a.js +1 -0
  68. package/dist/ganttDiagram-LVOFAZNH-d8342586.js +1 -0
  69. package/dist/gitGraph-ZV4HHKMB-788776f3.js +1 -0
  70. package/dist/gitGraph-ZV4HHKMB-ba420dcc.js +1 -0
  71. package/dist/gitGraphDiagram-NY62KEGX-804d1363.js +1 -0
  72. package/dist/gitGraphDiagram-NY62KEGX-919097ea.js +1 -0
  73. package/dist/graph-834f6046.js +1 -0
  74. package/dist/graph-db4953aa.js +1 -0
  75. package/dist/info-63CPKGFF-2dccc483.js +1 -0
  76. package/dist/info-63CPKGFF-ef40f1c4.js +1 -0
  77. package/dist/infoDiagram-F6ZHWCRC-579d50b4.js +1 -0
  78. package/dist/infoDiagram-F6ZHWCRC-c9877bad.js +1 -0
  79. package/dist/init-cf76ae07.js +1 -0
  80. package/dist/journeyDiagram-XKPGCS4Q-25d3c922.js +1 -0
  81. package/dist/journeyDiagram-XKPGCS4Q-2d2cda1c.js +1 -0
  82. package/dist/kanban-definition-3W4ZIXB7-c556bee0.js +1 -0
  83. package/dist/kanban-definition-3W4ZIXB7-cdb93ec0.js +1 -0
  84. package/dist/katex-0a18b0df.js +1 -0
  85. package/dist/layout-40652dba.js +1 -0
  86. package/dist/layout-54ffc604.js +1 -0
  87. package/dist/linear-2f639b72.js +1 -0
  88. package/dist/linear-ed2367ff.js +1 -0
  89. package/dist/mermaid-parser.core-0cfa7d2a.js +1 -0
  90. package/dist/mermaid-parser.core-10bed742.js +1 -0
  91. package/dist/mindmap-definition-VGOIOE7T-169f5fe5.js +1 -0
  92. package/dist/mindmap-definition-VGOIOE7T-dea1c792.js +1 -0
  93. package/dist/ordinal-221e41d7.js +1 -0
  94. package/dist/packet-HUATNLJX-6f2471ea.js +1 -0
  95. package/dist/packet-HUATNLJX-c69e28eb.js +1 -0
  96. package/dist/pie-WTHONI2E-4143e44b.js +1 -0
  97. package/dist/pie-WTHONI2E-82b1fe3f.js +1 -0
  98. package/dist/pieDiagram-ADFJNKIX-499eec78.js +1 -0
  99. package/dist/pieDiagram-ADFJNKIX-657effd5.js +1 -0
  100. package/dist/quadrantDiagram-AYHSOK5B-138a0c93.js +1 -0
  101. package/dist/quadrantDiagram-AYHSOK5B-91137c4d.js +1 -0
  102. package/dist/radar-NJJJXTRR-5e934a95.js +1 -0
  103. package/dist/radar-NJJJXTRR-94d77527.js +1 -0
  104. package/dist/requirementDiagram-UZGBJVZJ-a5d9fb39.js +1 -0
  105. package/dist/requirementDiagram-UZGBJVZJ-d7aeec99.js +1 -0
  106. package/dist/sankeyDiagram-TZEHDZUN-15053ae0.js +1 -0
  107. package/dist/sankeyDiagram-TZEHDZUN-aadd2125.js +1 -0
  108. package/dist/sequenceDiagram-WL72ISMW-12e778ef.js +1 -0
  109. package/dist/sequenceDiagram-WL72ISMW-9330a98a.js +1 -0
  110. package/dist/stateDiagram-FKZM4ZOC-01225f0f.js +1 -0
  111. package/dist/stateDiagram-FKZM4ZOC-af4836d7.js +1 -0
  112. package/dist/stateDiagram-v2-4FDKWEC3-4774cc10.js +1 -0
  113. package/dist/stateDiagram-v2-4FDKWEC3-5ef8e019.js +1 -0
  114. package/dist/timeline-definition-IT6M3QCI-9921f937.js +1 -0
  115. package/dist/timeline-definition-IT6M3QCI-a7a9bbec.js +1 -0
  116. package/dist/treemap-75Q7IDZK-100ddeb7.js +1 -0
  117. package/dist/treemap-75Q7IDZK-851117b4.js +1 -0
  118. package/dist/utils/index.d.ts +27 -5
  119. package/dist/utils/index.d.ts.map +1 -1
  120. package/dist/web-0016ac81.js +1 -0
  121. package/dist/web-4e6d8ea9.js +1 -0
  122. package/dist/web.js +1 -1
  123. package/dist/window.d.ts.map +1 -1
  124. package/dist/xychartDiagram-PRI3JC2R-003630a4.js +1 -0
  125. package/dist/xychartDiagram-PRI3JC2R-df869780.js +1 -0
  126. package/package.json +5 -3
  127. package/public/index.html +45 -32
@@ -0,0 +1 @@
1
+ import{_ as t,d as n,g as e,s as i,b as r,c as s,o,n as a,t as h,e as l,v as c,j as u,W as f}from"./web-4e6d8ea9.js";import{o as y}from"./ordinal-221e41d7.js";import"./init-cf76ae07.js";var d=function(t){for(var n=t.length/6|0,e=new Array(n),i=0;i<n;)e[i]="#"+t.slice(6*i,6*++i);return e}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function p(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(var i of t)null!=(i=n(i,++r,t))&&(e<i||void 0===e&&i>=i)&&(e=i)}return e}function g(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(var i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}function _(t,n){let e=0;if(void 0===n)for(var i of t)(i=+i)&&(e+=i);else{let i=-1;for(var r of t)(r=+n(r,++i,t))&&(e+=r)}return e}function x(t){return t.target.depth}function k(t,n){return t.sourceLinks.length?t.depth:n-1}function m(t){return function(){return t}}function v(t,n){return w(t.source,n.source)||t.index-n.index}function b(t,n){return w(t.target,n.target)||t.index-n.index}function w(t,n){return t.y0-n.y0}function S(t){return t.value}function E(t){return t.index}function L(t){return t.nodes}function A(t){return t.links}function M(t,n){if(t=t.get(n))return t;throw new Error("missing: "+n)}function I({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}var T=Math.PI,P=2*T,N=1e-6,O=P-N;function C(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function D(){return new C}function j(t){return function(){return t}}function $(t){return t[0]}function z(t){return t[1]}C.prototype=D.prototype={constructor:C,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){var s,o,a=this._x1,h=this._y1,l=(e=+e)-(t=+t),c=(i=+i)-(n=+n),u=a-t,f=h-n,y=u*u+f*f;if((r=+r)<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+(this._x1=t)+","+(this._y1=n):N<y&&(Math.abs(f*l-c*u)>N&&r?(o=l*l+c*c,i=(e-=a)*e+(a=i-h)*a,h=Math.sqrt(o),s=Math.sqrt(y),y=(o=r*Math.tan((T-Math.acos((o+y-i)/(2*h*s)))/2))/s,i=o/h,Math.abs(y-1)>N&&(this._+="L"+(t+y*u)+","+(n+y*f)),this._+="A"+r+","+r+",0,0,"+ +(u*a<f*e)+","+(this._x1=t+i*l)+","+(this._y1=n+i*c)):this._+="L"+(this._x1=t)+","+(this._y1=n))},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),h=t+o,l=n+a,c=1^s;s=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+h+","+l:(Math.abs(this._x1-h)>N||Math.abs(this._y1-l)>N)&&(this._+="L"+h+","+l),e&&(O<(s=s<0?s%P+P:s)?this._+="A"+e+","+e+",0,1,"+c+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+c+","+(this._x1=h)+","+(this._y1=l):N<s&&(this._+="A"+e+","+e+",0,"+ +(T<=s)+","+c+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var F=Array.prototype.slice;function U(t){return t.source}function W(t){return t.target}function G(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function V(){return function(t){var n=U,e=W,i=$,r=z,s=null;function o(){var o,a=F.call(arguments),h=n.apply(this,a),l=e.apply(this,a);if(s=s||(o=D()),t(s,+i.apply(this,(a[0]=h,a)),+r.apply(this,a),+i.apply(this,(a[0]=l,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:j(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:j(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}(G)}function X(t){return[t.source.x1,t.y0]}function q(t){return[t.target.x0,t.y1]}var Q=function(){var n=t((function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e}),"o"),e=[1,9],i=[1,10],r=[1,5,10,12];r={trace:t((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:t((function(t,n,e,i,r,s,o){var a=s.length-1;switch(r){case 7:var h=i.findOrCreateNode(s[a-4].trim().replaceAll('""','"')),l=i.findOrCreateNode(s[a-2].trim().replaceAll('""','"')),c=parseFloat(s[a].trim());i.addLink(h,l,c);break;case 8:case 9:case 11:this.$=s[a];break;case 10:this.$=s[a-1]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},n(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},n(r,[2,8]),n(r,[2,9]),{19:[1,16]},n(r,[2,11]),{1:[2,1]},{1:[2,5]},n(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},n(i,[2,3]),{12:[1,20]},n(r,[2,10]),{15:21,16:7,17:8,18:e,20:i},n([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:t((function(t,n){var e;if(!n.recoverable)throw(e=new Error(t)).hash=n,e;this.trace(t)}),"parseError"),parse:t((function(n){var e,i=this,r=[0],s=[],o=[null],a=[],h=this.table,l="",c=0,u=0,f=a.slice.call(arguments,1),y=Object.create(this.lexer),d={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(d.yy[e]=this.yy[e]);y.setInput(n,d.yy),d.yy.lexer=y,d.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var p=y.yylloc,g=(a.push(p),y.options&&y.options.ranges);function _(){var t=s.pop()||y.lex()||1;return"number"!=typeof t&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){r.length=r.length-2*t,o.length=o.length-t,a.length=a.length-t}),"popStack"),t(_,"lex");for(var x,k,m,v,b,w,S={};;){if(k=r[r.length-1],void 0===(m=this.defaultActions[k]||(null==x&&(x=_()),h[k]&&h[k][x]))||!m.length||!m[0]){var E,L=[];for(v in h[k])this.terminals_[v]&&2<v&&L.push("'"+this.terminals_[v]+"'");E=y.showPosition?"Parse error on line "+(c+1)+":\n"+y.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(E,{text:y.match,token:this.terminals_[x]||x,line:y.yylineno,loc:p,expected:L})}if(m[0]instanceof Array&&1<m.length)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(m[0]){case 1:r.push(x),o.push(y.yytext),a.push(y.yylloc),r.push(m[1]),x=null,u=y.yyleng,l=y.yytext,c=y.yylineno,p=y.yylloc;break;case 2:if(b=this.productions_[m[1]][1],S.$=o[o.length-b],S._$={first_line:a[a.length-(b||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(b||1)].first_column,last_column:a[a.length-1].last_column},g&&(S._$.range=[a[a.length-(b||1)].range[0],a[a.length-1].range[1]]),void 0!==(w=this.performAction.apply(S,[l,u,c,d.yy,m[1],o,a].concat(f))))return w;b&&(r=r.slice(0,-1*b*2),o=o.slice(0,-1*b),a=a.slice(0,-1*b)),r.push(this.productions_[m[1]][0]),o.push(S.$),a.push(S._$),w=h[r[r.length-2]][r[r.length-1]],r.push(w);break;case 3:return!0}}return!0}),"parse")},e={EOF:1,parseError:t((function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)}),"parseError"),setInput:t((function(t,n){return this.yy=n||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:t((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:t((function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g),i=(this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n,t=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),e.length-1&&(this.yylineno-=e.length-1),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:e?(e.length===t.length?this.yylloc.first_column:0)+t[t.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((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:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(20<t.length?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:t((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(20<t.length?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:t((function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"}),"showPosition"),test_match:t((function(t,n){var e,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)&&(i.yylloc.range=this.yylloc.range.slice(0)),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.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],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack)for(var r in i)this[r]=i[r];return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,n,e,i,r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length))if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(!this._backtrack)return!1;n=!1}else if(!this.options.flex)break;return n?!1!==(t=this.test_match(n,r[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:t((function(){return this.next()||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((function(){return(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]]:this.conditions.INITIAL).rules}),"_currentRules"),topState:t((function(t){return 0<=(t=this.conditionStack.length-1-Math.abs(t||0))?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};function s(){this.yy={}}return r.lexer=e,t(s,"Parser"),new((s.prototype=r).Parser=s)}(),R=Q.parser=Q,Y=[],B=[],K=new Map,Z=t((()=>{Y=[],B=[],K=new Map,h()}),"clear"),H=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{t(this,"SankeyLink")}},J=t(((t,n,e)=>{Y.push(new H(t,n,e))}),"addLink"),tt=class{constructor(t){this.ID=t}static{t(this,"SankeyNode")}},nt=t((t=>{t=l.sanitizeText(t,n());let e=K.get(t);return void 0===e&&(e=new tt(t),K.set(t,e),B.push(e)),e}),"findOrCreateNode"),et=t((()=>B),"getNodes"),it=t((()=>Y),"getLinks"),rt=t((()=>({nodes:B.map((t=>({id:t.ID}))),links:Y.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),st={nodesMap:K,getConfig:t((()=>n().sankey),"getConfig"),getNodes:et,getLinks:it,getGraph:rt,addLink:J,findOrCreateNode:nt,getAccTitle:e,setAccTitle:i,getAccDescription:r,setAccDescription:s,getDiagramTitle:o,setDiagramTitle:a,clear:Z},ot=class n{static{t(this,"Uid")}static{this.count=0}static next(t){return new n(t+ ++n.count)}constructor(t){this.id=t,this.href="#"+t}toString(){return"url("+this.href+")"}},at={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?g(t.sourceLinks,x)-1:0},justify:k},ht=t((function(e,i,r,s){var{securityLevel:o,sankey:a}=n(),h=c.sankey;let l;"sandbox"===o&&(l=u("#i"+i));var x=u("sandbox"===o?l.nodes()[0].contentDocument.body:"body"),o="sandbox"===o?x.select(`[id="${i}"]`):u(`[id="${i}"]`);const T=a?.width??h.width;x=a?.height??h.width,i=a?.useMaxWidth??h.useMaxWidth;var P=a?.nodeAlignment??h.nodeAlignment;const N=a?.prefix??h.prefix,O=a?.suffix??h.suffix,C=a?.showValues??h.showValues;h=s.db.getGraph(),s=at[P],function(){let t,n,e,i=0,r=0,s=1,o=1,a=24,h=8,l=E,c=k,u=L,f=A,y=6;function d(){var d,k,m={nodes:u.apply(null,arguments),links:f.apply(null,arguments)},{nodes:E,links:L}=m;for([d,k]of E.entries())k.index=d,k.sourceLinks=[],k.targetLinks=[];var A,T,P=new Map(E.map(((t,n)=>[l(t,n,E),t])));for([A,T]of L.entries()){T.index=A;let{source:t,target:n}=T;"object"!=typeof t&&(t=T.source=M(P,t)),"object"!=typeof n&&(n=T.target=M(P,n)),t.sourceLinks.push(T),n.targetLinks.push(T)}if(null!=e)for(var{sourceLinks:O,targetLinks:C}of E)O.sort(e),C.sort(e);L=m.nodes;for(const t of L)t.value=void 0===t.fixedValue?Math.max(_(t.sourceLinks,S),_(t.targetLinks,S)):t.fixedValue;{var D=(L=m.nodes).length;let t=new Set(L),n=new Set,e=0;for(;t.size;){for(const i of t)for(var{target:j}of(i.depth=e,i.sourceLinks))n.add(j);if(++e>D)throw new Error("circular link");t=n,n=new Set}}{var $=(L=m.nodes).length;let t=new Set(L),n=new Set,e=0;for(;t.size;){for(const i of t)for(var{source:z}of(i.height=e,i.targetLinks))n.add(z);if(++e>$)throw new Error("circular link");t=n,n=new Set}}var F=function({nodes:t}){var e=p(t,(t=>t.depth))+1,r=(s-i-a)/(e-1),o=new Array(e);for(const n of t){var h=Math.max(0,Math.min(e-1,Math.floor(c.call(null,n,e))));n.layer=h,n.x0=i+h*r,n.x1=n.x0+a,o[h]?o[h].push(n):o[h]=[n]}if(n)for(const t of o)t.sort(n);return o}(L=m),L=(t=Math.min(h,(o-r)/(p(F,(t=>t.length))-1)),F),U=g(L,(n=>(o-r-(n.length-1)*t)/_(n,S)));for(const n of L){let i=r;for(const e of n){e.y0=i,e.y1=i+e.value*U,i=e.y1+t;for(const t of e.sourceLinks)t.width=t.value*U}i=(o-i+t)/(n.length+1);for(let t=0;t<n.length;++t){var W=n[t];W.y0+=i*(t+1),W.y1+=i*(t+1)}!function(t){if(void 0===e)for(var{sourceLinks:n,targetLinks:i}of t)n.sort(b),i.sort(v)}(n)}for(let e=0;e<y;++e){var G=Math.pow(.99,e),V=Math.max(1-G,(e+1)/y);!function(e,i,r){for(let l=e.length-2;0<=l;--l){var s,o=e[l];for(const n of o){let e=0,r=0;for(var{target:a,value:h}of n.sourceLinks)h*=a.layer-n.layer,e+=function(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(var{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(var{target:o,width:a}of n.sourceLinks){if(o===e)break;i-=a}return i}(n,a)*h,r+=h;0<r&&(s=(e/r-n.y0)*i,n.y0+=s,n.y1+=s,N(n))}void 0===n&&o.sort(w),x(o,r)}}(F,G,V),function(e,i,r){for(let l=1,c=e.length;l<c;++l){var s,o=e[l];for(const n of o){let e=0,r=0;for(var{source:a,value:h}of n.targetLinks)h*=n.layer-a.layer,e+=function(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(var{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(var{source:o,width:a}of e.targetLinks){if(o===n)break;i-=a}return i}(a,n)*h,r+=h;0<r&&(s=(e/r-n.y0)*i,n.y0+=s,n.y1+=s,N(n))}void 0===n&&o.sort(w),x(o,r)}}(F,G,V)}return I(m),m}function x(n,e){var i=n.length>>1,s=n[i];P(n,s.y0-t,i-1,e),T(n,s.y1+t,1+i,e),P(n,o,n.length-1,e),T(n,r,0,e)}function T(n,e,i,r){for(;i<n.length;++i){var s=n[i],o=(e-s.y0)*r;1e-6<o&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function P(n,e,i,r){for(;0<=i;--i){var s=n[i],o=(s.y1-e)*r;1e-6<o&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function N({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(b);for(const{target:{targetLinks:n}}of t)n.sort(v)}}return d.update=function(t){return I(t),t},d.nodeId=function(t){return arguments.length?(l="function"==typeof t?t:m(t),d):l},d.nodeAlign=function(t){return arguments.length?(c="function"==typeof t?t:m(t),d):c},d.nodeSort=function(t){return arguments.length?(n=t,d):n},d.nodeWidth=function(t){return arguments.length?(a=+t,d):a},d.nodePadding=function(n){return arguments.length?(h=t=+n,d):h},d.nodes=function(t){return arguments.length?(u="function"==typeof t?t:m(t),d):u},d.links=function(t){return arguments.length?(f="function"==typeof t?t:m(t),d):f},d.linkSort=function(t){return arguments.length?(e=t,d):e},d.size=function(t){return arguments.length?(i=r=0,s=+t[0],o=+t[1],d):[s-i,o-r]},d.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],o=+t[1][1],d):[[i,r],[s,o]]},d.iterations=function(t){return arguments.length?(y=+t,d):y},d}().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(C?15:0)).nodeAlign(s).extent([[0,0],[T,x]])(h);const D=y(d);o.append("g").attr("class","nodes").selectAll(".node").data(h.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=ot.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>D(t.id)));P=t((({id:t,value:n})=>C?t+"\n"+N+Math.round(100*n)/100+O:t),"getText"),o.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(h.nodes).join("text").attr("x",(t=>t.x0<T/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(C?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<T/2?"start":"end")).text(P),s=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(h.links).join("g").attr("class","link").style("mix-blend-mode","multiply");var j=a?.linkColor??"gradient";let $;switch("gradient"===j&&((x=s.append("linearGradient").attr("id",(t=>(t.uid=ot.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0))).append("stop").attr("offset","0%").attr("stop-color",(t=>D(t.source.id))),x.append("stop").attr("offset","100%").attr("stop-color",(t=>D(t.target.id)))),j){case"gradient":$=t((t=>t.uid),"coloring");break;case"source":$=t((t=>D(t.source.id)),"coloring");break;case"target":$=t((t=>D(t.target.id)),"coloring");break;default:$=j}s.append("path").attr("d",V().source(X).target(q)).attr("stroke",$).attr("stroke-width",(t=>Math.max(1,t.width))),f(void 0,o,0,i)}),"draw"),lt={draw:ht},ct=t((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),ut=t((t=>`.label {\n font-family: ${t.fontFamily};\n }`),"getStyles"),ft=R.parse.bind(R),yt=(R.parse=t=>ft(ct(t)),{styles:ut,parser:R,db:st,renderer:lt});export{yt as diagram};
@@ -0,0 +1 @@
1
+ import{g as t,a as e,d as a,b as r,c as s,e as i}from"./chunk-TZMSLE5B-ed6d6d7e.js";import{_ as n,s as o,c,n as h,g as l,b as d,o as p,d as g,p as u,J as x,t as y,l as m,i as b,x as T,e as E,L as f,M as w,u as I,a as L,j as v,k,m as P,N as _,O as N,E as A,P as M,Z as O}from"./web-0016ac81.js";import{I as S}from"./chunk-QZHKN3VN-a979a9fe.js";var D=function(){var t=n((function(t,e,a,r){for(a=a||{},r=t.length;r--;a[t[r]]=e);return a}),"o"),e=[1,2],a=[1,3],r=[1,4],s=[2,4],i=[1,9],o=[1,11],c=[1,13],h=[1,14],l=[1,16],d=[1,17],p=[1,18],g=[1,24],u=[1,25],x=[1,26],y=[1,27],m=[1,28],b=[1,29],T=[1,30],E=[1,31],f=[1,32],w=[1,33],I=[1,34],L=[1,35],v=[1,36],k=[1,37],P=[1,38],_=[1,39],N=[1,41],A=[1,42],M=[1,43],O=[1,44],S=[1,45],D=[1,46],R=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],C=[2,71],$=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],Y=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],V=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],W=[69,70,71],q=[1,127];e={trace:n((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:n((function(t,e,a,r,s,i,n){var o=i.length-1;switch(s){case 3:return r.apply(i[o]),i[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:i[o-1].push(i[o]),this.$=i[o-1];break;case 6:case 7:case 11:case 12:case 63:this.$=i[o];break;case 15:i[o].type="createParticipant",this.$=i[o];break;case 16:i[o-1].unshift({type:"boxStart",boxData:r.parseBoxData(i[o-2])}),i[o-1].push({type:"boxEnd",boxText:i[o-2]}),this.$=i[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-2]),sequenceIndexStep:Number(i[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-1].actor};break;case 29:r.setDiagramTitle(i[o].substring(6)),this.$=i[o].substring(6);break;case 30:r.setDiagramTitle(i[o].substring(7)),this.$=i[o].substring(7);break;case 31:this.$=i[o].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=i[o].trim(),r.setAccDescription(this.$);break;case 34:i[o-1].unshift({type:"loopStart",loopText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.LOOP_START}),i[o-1].push({type:"loopEnd",loopText:i[o-2],signalType:r.LINETYPE.LOOP_END}),this.$=i[o-1];break;case 35:i[o-1].unshift({type:"rectStart",color:r.parseMessage(i[o-2]),signalType:r.LINETYPE.RECT_START}),i[o-1].push({type:"rectEnd",color:r.parseMessage(i[o-2]),signalType:r.LINETYPE.RECT_END}),this.$=i[o-1];break;case 36:i[o-1].unshift({type:"optStart",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.OPT_START}),i[o-1].push({type:"optEnd",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.OPT_END}),this.$=i[o-1];break;case 37:i[o-1].unshift({type:"altStart",altText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.ALT_START}),i[o-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=i[o-1];break;case 38:i[o-1].unshift({type:"parStart",parText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.PAR_START}),i[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=i[o-1];break;case 39:i[o-1].unshift({type:"parStart",parText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.PAR_OVER_START}),i[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=i[o-1];break;case 40:i[o-1].unshift({type:"criticalStart",criticalText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.CRITICAL_START}),i[o-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=i[o-1];break;case 41:i[o-1].unshift({type:"breakStart",breakText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.BREAK_START}),i[o-1].push({type:"breakEnd",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.BREAK_END}),this.$=i[o-1];break;case 43:this.$=i[o-3].concat([{type:"option",optionText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},i[o]]);break;case 45:this.$=i[o-3].concat([{type:"and",parText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.PAR_AND},i[o]]);break;case 47:this.$=i[o-3].concat([{type:"else",altText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.ALT_ELSE},i[o]]);break;case 48:i[o-3].draw="participant",i[o-3].type="addParticipant",i[o-3].description=r.parseMessage(i[o-1]),this.$=i[o-3];break;case 49:case 53:i[o-1].draw="participant",i[o-1].type="addParticipant",this.$=i[o-1];break;case 50:i[o-3].draw="actor",i[o-3].type="addParticipant",i[o-3].description=r.parseMessage(i[o-1]),this.$=i[o-3];break;case 51:i[o-1].draw="actor",i[o-1].type="addParticipant",this.$=i[o-1];break;case 52:i[o-1].type="destroyParticipant",this.$=i[o-1];break;case 54:this.$=[i[o-1],{type:"addNote",placement:i[o-2],actor:i[o-1].actor,text:i[o]}];break;case 55:i[o-2]=[].concat(i[o-1],i[o-1]).slice(0,2),i[o-2][0]=i[o-2][0].actor,i[o-2][1]=i[o-2][1].actor,this.$=[i[o-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:i[o-2].slice(0,2),text:i[o]}];break;case 56:this.$=[i[o-1],{type:"addLinks",actor:i[o-1].actor,text:i[o]}];break;case 57:this.$=[i[o-1],{type:"addALink",actor:i[o-1].actor,text:i[o]}];break;case 58:this.$=[i[o-1],{type:"addProperties",actor:i[o-1].actor,text:i[o]}];break;case 59:this.$=[i[o-1],{type:"addDetails",actor:i[o-1].actor,text:i[o]}];break;case 62:this.$=[i[o-2],i[o]];break;case 64:this.$=r.PLACEMENT.LEFTOF;break;case 65:this.$=r.PLACEMENT.RIGHTOF;break;case 66:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor}];break;case 67:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-4].actor}];break;case 68:this.$=[i[o-3],i[o-1],{type:"addMessage",from:i[o-3].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o]}];break;case 69:this.$={type:"addParticipant",actor:i[o-1],config:i[o]};break;case 70:this.$=i[o-1].trim();break;case 71:this.$={type:"addParticipant",actor:i[o]};break;case 72:this.$=r.LINETYPE.SOLID_OPEN;break;case 73:this.$=r.LINETYPE.DOTTED_OPEN;break;case 74:this.$=r.LINETYPE.SOLID;break;case 75:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=r.LINETYPE.DOTTED;break;case 77:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=r.LINETYPE.SOLID_CROSS;break;case 79:this.$=r.LINETYPE.DOTTED_CROSS;break;case 80:this.$=r.LINETYPE.SOLID_POINT;break;case 81:this.$=r.LINETYPE.DOTTED_POINT;break;case 82:this.$=r.parseMessage(i[o].trim().substring(1))}}),"anonymous"),table:[{3:1,4:e,5:a,6:r},{1:[3]},{3:5,4:e,5:a,6:r},{3:6,4:e,5:a,6:r},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:o,8:8,9:10,12:12,13:c,14:h,17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},t(R,[2,5]),{9:47,12:12,13:c,14:h,17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},t(R,[2,7]),t(R,[2,8]),t(R,[2,14]),{12:48,50:k,52:P,53:_},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:D},{22:55,71:D},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(R,[2,29]),t(R,[2,30]),{32:[1,61]},{34:[1,62]},t(R,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:D},{22:75,71:D},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:D},{22:92,71:D},{22:93,71:D},{22:94,71:D},t([5,51,65,76,77,78,79,80,81,82,83,84,85,86],C),t(R,[2,6]),t(R,[2,15]),t($,[2,9],{10:95}),t(R,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},t(R,[2,21]),{5:[1,99]},{5:[1,100]},t(R,[2,24]),t(R,[2,25]),t(R,[2,26]),t(R,[2,27]),t(R,[2,28]),t(R,[2,31]),t(R,[2,32]),t(B,s,{7:101}),t(B,s,{7:102}),t(B,s,{7:103}),t(Y,s,{40:104,7:105}),t(V,s,{42:106,7:107}),t(V,s,{7:107,42:108}),t(F,s,{45:109,7:110}),t(B,s,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},t([5,51],C,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:D},t(W,[2,72]),t(W,[2,73]),t(W,[2,74]),t(W,[2,75]),t(W,[2,76]),t(W,[2,77]),t(W,[2,78]),t(W,[2,79]),t(W,[2,80]),t(W,[2,81]),{22:123,71:D},{22:125,59:124,71:D},{71:[2,64]},{71:[2,65]},{57:126,86:q},{57:128,86:q},{57:129,86:q},{57:130,86:q},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:k,52:P,53:_},{5:[1,136]},t(R,[2,19]),t(R,[2,20]),t(R,[2,22]),t(R,[2,23]),{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[1,137],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[1,138],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[1,139],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{16:[1,140]},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[2,46],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,49:[1,141],50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{16:[1,142]},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[2,44],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,48:[1,143],50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{16:[1,144]},{16:[1,145]},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[2,42],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,47:[1,146],50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[1,147],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{15:[1,148]},t(R,[2,49]),t(R,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},t(R,[2,51]),t(R,[2,52]),{22:151,71:D},{22:152,71:D},{57:153,86:q},{57:154,86:q},{57:155,86:q},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},t(R,[2,16]),t($,[2,10]),{12:157,50:k,52:P,53:_},t($,[2,12]),t($,[2,13]),t(R,[2,18]),t(R,[2,34]),t(R,[2,35]),t(R,[2,36]),t(R,[2,37]),{15:[1,158]},t(R,[2,38]),{15:[1,159]},t(R,[2,39]),t(R,[2,40]),{15:[1,160]},t(R,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:q},{57:165,86:q},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:D},t($,[2,11]),t(Y,s,{7:105,40:167}),t(V,s,{7:107,42:168}),t(F,s,{7:110,45:169}),t(R,[2,48]),{5:[2,70]},t(R,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:n((function(t,e){var a;if(!e.recoverable)throw(a=new Error(t)).hash=e,a;this.trace(t)}),"parseError"),parse:n((function(t){var e,a=this,r=[0],s=[],i=[null],o=[],c=this.table,h="",l=0,d=0,p=o.slice.call(arguments,1),g=Object.create(this.lexer),u={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(u.yy[e]=this.yy[e]);g.setInput(t,u.yy),u.yy.lexer=g,u.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var x=g.yylloc,y=(o.push(x),g.options&&g.options.ranges);function m(){var t=s.pop()||g.lex()||1;return"number"!=typeof t&&(t instanceof Array&&(t=(s=t).pop()),t=a.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,n((function(t){r.length=r.length-2*t,i.length=i.length-t,o.length=o.length-t}),"popStack"),n(m,"lex");for(var b,T,E,f,w,I,L={};;){if(T=r[r.length-1],void 0===(E=this.defaultActions[T]||(null==b&&(b=m()),c[T]&&c[T][b]))||!E.length||!E[0]){var v,k=[];for(f in c[T])this.terminals_[f]&&2<f&&k.push("'"+this.terminals_[f]+"'");v=g.showPosition?"Parse error on line "+(l+1)+":\n"+g.showPosition()+"\nExpecting "+k.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(v,{text:g.match,token:this.terminals_[b]||b,line:g.yylineno,loc:x,expected:k})}if(E[0]instanceof Array&&1<E.length)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+b);switch(E[0]){case 1:r.push(b),i.push(g.yytext),o.push(g.yylloc),r.push(E[1]),b=null,d=g.yyleng,h=g.yytext,l=g.yylineno,x=g.yylloc;break;case 2:if(w=this.productions_[E[1]][1],L.$=i[i.length-w],L._$={first_line:o[o.length-(w||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(w||1)].first_column,last_column:o[o.length-1].last_column},y&&(L._$.range=[o[o.length-(w||1)].range[0],o[o.length-1].range[1]]),void 0!==(I=this.performAction.apply(L,[h,d,l,u.yy,E[1],i,o].concat(p))))return I;w&&(r=r.slice(0,-1*w*2),i=i.slice(0,-1*w),o=o.slice(0,-1*w)),r.push(this.productions_[E[1]][0]),i.push(L.$),o.push(L._$),I=c[r[r.length-2]][r[r.length-1]],r.push(I);break;case 3:return!0}}return!0}),"parse")},a={EOF:1,parseError:n((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:n((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:n((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:n((function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g),r=(this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e,t=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),a.length-1&&(this.yylineno-=a.length-1),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:a?(a.length===t.length?this.yylloc.first_column:0)+t[t.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:n((function(){return this._more=!0,this}),"more"),reject:n((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:n((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:n((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(20<t.length?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:n((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(20<t.length?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:n((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:n((function(t,e){var a,r;if(this.options.backtrack_lexer&&(r={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)&&(r.yylloc.range=this.yylloc.range.slice(0)),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.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],a=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack)for(var s in r)this[s]=r[s];return!1}),"test_match"),next:n((function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,a,r,s=this._currentRules(),i=0;i<s.length;i++)if((a=this._input.match(this.rules[s[i]]))&&(!e||a[0].length>e[0].length))if(e=a,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(a,s[i])))return t;if(!this._backtrack)return!1;e=!1}else if(!this.options.flex)break;return e?!1!==(t=this.test_match(e,s[r]))&&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:n((function(){return this.next()||this.lex()}),"lex"),begin:n((function(t){this.conditionStack.push(t)}),"begin"),popState:n((function(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:n((function(){return(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]]:this.conditions.INITIAL).rules}),"_currentRules"),topState:n((function(t){return 0<=(t=this.conditionStack.length-1-Math.abs(t||0))?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:n((function(t){this.begin(t)}),"pushState"),stateStackSize:n((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:n((function(t,e,a,r){switch(a){case 0:case 56:case 72:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:case 57:return e.yytext=e.yytext.trim(),71;case 11:case 17:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:case 69:return 86;case 70:return 69;case 71:return 70;case 73:return"INVALID"}}),"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}};function z(){this.yy={}}return e.lexer=a,n(z,"Parser"),new((z.prototype=e).Parser=z)}(),R=D.parser=D,C={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},$={FILLED:0,OPEN:1},B={LEFTOF:0,RIGHTOF:1,OVER:2},Y="actor",V="control",F="database",W="entity",q=class{constructor(){this.state=new S((()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0}))),this.setAccTitle=o,this.setAccDescription=c,this.setDiagramTitle=h,this.getAccTitle=l,this.getAccDescription=d,this.getDiagramTitle=p,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(g().wrap),this.LINETYPE=C,this.ARROWTYPE=$,this.PLACEMENT=B}static{n(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,a,r,s){let i,n=this.state.records.currentBox;if(void 0!==s){let t;t=s.includes("\n")?s+"\n":"{\n"+s+"\n}",i=u(t,{schema:x})}if(r=i?.type??r,s=this.state.records.actors.get(t)){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw new Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(n=s.box||this.state.records.currentBox,s.box=n,s&&e===s.name&&null==a)return}null==a?.text&&(a={text:e,type:r}),null!=r&&null!=a.text||(a={text:e,type:r}),this.state.records.actors.set(t,{box:n,name:e,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor&&(s=this.state.records.actors.get(this.state.records.prevActor))&&(s.nextActor=t),this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,a=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&a++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&a--;return a}addMessage(t,e,a,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a.text,wrap:a.wrap??this.autoWrap(),answer:r})}addSignal(t,e,a,r,s=!1){var i;if(r===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1)throw(i=new Error("Trying to inactivate an inactive participant ("+t+")")).hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},i;return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:r,activate:s}),!0}hasAtLeastOneBox(){return 0<this.state.records.boxes.length}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some((t=>t.name))}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();var e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:g().sequence?.wrap??!1}clear(){this.state.reset(),y()}parseMessage(t){t=t.trim();var{wrap:t,cleanedText:e}=this.extractWrap(t),e={text:e,wrap:t};return m.debug("parseMessage: "+JSON.stringify(e)),e}parseBoxData(t){var e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let a=e?.[1]?e[1].trim():"transparent",r=e?.[2]?e[2].trim():void 0;window?.CSS?window.CSS.supports("color",a)||(a="transparent",r=t.trim()):((e=(new Option).style).color=a,e.color!==a&&(a="transparent",r=t.trim()));var{wrap:e,cleanedText:t}=this.extractWrap(r);return{text:t?b(t,g()):void 0,color:a,wrap:e}}addNote(t,e,a){var r={actor:t,placement:e,message:a.text,wrap:a.wrap??this.autoWrap()};t=[].concat(t,t);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t[0],to:t[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){t=this.getActor(t);try{let r=b(e.text,g());r=(r=r.replace(/&equals;/g,"=")).replace(/&amp;/g,"&");var a=JSON.parse(r);this.insertLinks(t,a)}catch(t){m.error("error while parsing actor link text",t)}}addALink(t,e){t=this.getActor(t);try{var a={};let n=b(e.text,g());var r=n.indexOf("@"),s=(n=(n=n.replace(/&equals;/g,"=")).replace(/&amp;/g,"&")).slice(0,r-1).trim(),i=n.slice(r+1).trim();a[s]=i,this.insertLinks(t,a)}catch(t){m.error("error while parsing actor link text",t)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const a in e)t.links[a]=e[a]}addProperties(t,e){t=this.getActor(t);try{var a=b(e.text,g()),r=JSON.parse(a);this.insertProperties(t,r)}catch(t){m.error("error while parsing actor properties text",t)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const a in e)t.properties[a]=e[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){t=this.getActor(t),e=document.getElementById(e.text);try{var a=e.innerHTML,r=JSON.parse(a);r.properties&&this.insertProperties(t,r.properties),r.links&&this.insertLinks(t,r.links)}catch(t){m.error("error while parsing actor details text",t)}}getActorProperty(t,e){if(void 0!==t?.properties)return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach((t=>{this.apply(t)}));else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":o(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return g().sequence}},z=n((t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n \n .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n\n`),"getStyles"),H="actor-top",j="actor-bottom",U="actor-box",G="actor-man",K=n((function(t,e){return a(t,e)}),"drawRect"),X=n((function(t,e,a,r,s){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};var i=e.links,n=e.actorCnt,o=e.rectData,c=(e="none",s&&(e="block !important"),t.append("g")),h=(s=(c.attr("id","actor"+n+"_popup"),c.attr("class","actorPopupMenu"),c.attr("display",e),""),void 0!==o.class&&(s=" "+o.class),o.width>a?o.width:a);if((t=c.append("rect")).attr("class","actorPopupMenuPanel"+s),t.attr("x",o.x),t.attr("y",o.height),t.attr("fill",o.fill),t.attr("stroke",o.stroke),t.attr("width",h),t.attr("height",o.height),t.attr("rx",o.rx),t.attr("ry",o.ry),null!=i){var l,d=20;for(l in i){var p=c.append("a"),g=P(i[l]);p.attr("xlink:href",g),p.attr("target","_blank"),Pt(r)(l,p,o.x+10,o.height+d,h,20,{class:"actor"},r),d+=30}}return t.attr("height",d),{height:o.height+d,width:h}}),"drawPopup"),Z=n((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle"),J=n((async function(t,e,a=null){var r=t.append("foreignObject"),s=await N(e.text,A());s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),"noteText"===e.class){t=((t=t.node().firstChild).setAttribute("height",s.height+2*e.textMargin),t.getBBox());r.attr("x",Math.round(t.x+t.width/2-s.width/2)).attr("y",Math.round(t.y+t.height/2-s.height/2))}else if(a){let{startx:i,stopx:n,starty:o}=a;i>n&&(t=i,i=n,n=t),r.attr("x",Math.round(i+Math.abs(i-n)/2-s.width/2)),"loopText"===e.class?r.attr("y",Math.round(o)):r.attr("y",Math.round(o-s.height))}return[r]}),"drawKatex"),Q=n((function(t,e){let a=0,r=0;var s,i,o=e.text.split(E.lineBreakRegex),[c,h]=M(e.fontSize),l=[];let d=0,p=n((()=>e.y),"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&0<e.textMargin)switch(e.valign){case"top":case"start":p=n((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":p=n((()=>Math.round(e.y+(a+r+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":p=n((()=>Math.round(e.y+(a+r+2*e.textMargin)-e.textMargin)),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for([s,i]of o.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==c&&(d=s*c);var g,u=t.append("text"),x=(u.attr("x",e.x),u.attr("y",p()),void 0!==e.anchor&&u.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&u.style("font-family",e.fontFamily),void 0!==h&&u.style("font-size",h),void 0!==e.fontWeight&&u.style("font-weight",e.fontWeight),void 0!==e.fill&&u.attr("fill",e.fill),void 0!==e.class&&u.attr("class",e.class),void 0!==e.dy?u.attr("dy",e.dy):0!==d&&u.attr("dy",d),i||O);(e.tspan?((g=u.append("tspan")).attr("x",e.x),void 0!==e.fill&&g.attr("fill",e.fill),g):u).text(x),void 0!==e.valign&&void 0!==e.textMargin&&0<e.textMargin&&(r+=(u._groups||u)[0][0].getBBox().height,a=r),l.push(u)}return l}),"drawText"),tt=n((function(t,e){function a(t,e,a,r,s){return t+","+e+" "+(t+a)+","+e+" "+(t+a)+","+(e+r-s)+" "+(t+a-1.2*s)+","+(e+r)+" "+t+","+(e+r)}n(a,"genPoints");var r=t.append("polygon");return r.attr("points",a(e.x,e.y,e.width,e.height,7)),r.attr("class","labelBox"),e.y=e.y+e.height/2,Q(t,e),r}),"drawLabel"),et=-1,at=n(((t,e,a,r)=>{t.select&&a.forEach((a=>{a=e.get(a);var s=t.select("#actor"+a.actorCnt);!r.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):r.mirrorActors&&s.attr("y2",a.stopy)}))}),"fixLifeLineHeights"),rt=n((function(e,a,r,n){var o=n?a.stopy:a.starty,c=a.x+a.width/2,h=o+a.height,l=e=e.append("g").lower();n||(et++,Object.keys(a.links||{}).length&&!r.forceMenus&&l.attr("onclick",Z(`actor${et}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+et).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),l=e.append("g"),a.actorCnt=et,null!=a.links&&l.attr("id","root-"+et)),h=t(),c="actor",a.properties?.class?c=a.properties.class:h.fill="#eaeaea",c+=n?" "+j:" "+H,h.x=a.x,h.y=o,h.width=a.width,h.height=a.height,h.class=c,h.rx=3,h.ry=3,h.name=a.name,e=K(l,h);a.rectData=h,a.properties?.icon&&("@"===(n=a.properties.icon.trim()).charAt(0)?s(l,h.x+h.width-20,h.y+10,n.substr(1)):i(l,h.x+h.width-20,h.y+10,n)),kt(r,f(a.description))(a.description,l,h.x,h.y,h.width,h.height,{class:"actor "+U},r);let d=a.height;return e.node&&(o=e.node().getBBox(),a.height=o.height,d=o.height),d}),"drawActorTypeParticipant"),st=n((function(e,a,r,n){var o=n?a.stopy:a.starty,c=a.x+a.width/2,h=o+a.height,l=e=e.append("g").lower();n||(et++,Object.keys(a.links||{}).length&&!r.forceMenus&&l.attr("onclick",Z(`actor${et}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+et).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),l=e.append("g"),a.actorCnt=et,null!=a.links&&l.attr("id","root-"+et)),h=t(),c="actor",a.properties?.class?c=a.properties.class:h.fill="#eaeaea",c+=n?" "+j:" "+H,h.x=a.x,h.y=o,h.width=a.width,h.height=a.height,h.class=c,h.name=a.name,e={...h,x:h.x+-6,y:h.y+6,class:"actor"},n=K(l,h);K(l,e),a.rectData=h,a.properties?.icon&&("@"===(o=a.properties.icon.trim()).charAt(0)?s(l,h.x+h.width-20,h.y+10,o.substr(1)):i(l,h.x+h.width-20,h.y+10,o)),kt(r,f(a.description))(a.description,l,h.x-6,h.y+6,h.width,h.height,{class:"actor "+U},r);let d=a.height;return n.node&&(c=n.node().getBBox(),a.height=c.height,d=c.height),d}),"drawActorTypeCollections"),it=n((function(e,a,r,n){var o=n?a.stopy:a.starty,c=a.x+a.width/2,h=o+a.height;let l=e=e.append("g").lower();n||(et++,Object.keys(a.links||{}).length&&!r.forceMenus&&l.attr("onclick",Z(`actor${et}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+et).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),l=e.append("g"),a.actorCnt=et,null!=a.links&&l.attr("id","root-"+et)),h=t();let d="actor";a.properties?.class?d=a.properties.class:h.fill="#eaeaea",d+=n?" "+j:" "+H,h.x=a.x,h.y=o,h.width=a.width,h.height=a.height,h.class=d,h.name=a.name;e=(c=h.height/2)/(2.5+h.height/50),n=l.append("g"),o=l.append("g");n.append("path").attr("d",`M ${h.x},${h.y+c}\n a ${e},${c} 0 0 0 0,${h.height}\n h ${h.width-2*e}\n a ${e},${c} 0 0 0 0,-${h.height}\n Z\n `).attr("class",d),o.append("path").attr("d",`M ${h.x},${h.y+c}\n a ${e},${c} 0 0 0 0,`+h.height).attr("stroke","#666").attr("stroke-width","1px").attr("class",d),n.attr("transform",`translate(${e}, ${-h.height/2})`),o.attr("transform",`translate(${h.width-e}, ${-h.height/2})`),a.rectData=h,a.properties?.icon&&(c=a.properties.icon.trim(),o=h.x+h.width-20,e=h.y+10,"@"===c.charAt(0)?s(l,o,e,c.substr(1)):i(l,o,e,c)),kt(r,f(a.description))(a.description,l,h.x,h.y,h.width,h.height,{class:"actor "+U},r);let p=a.height;return(o=n.select("path:last-child")).node()&&(e=o.node().getBBox(),a.height=e.height,p=e.height),p}),"drawActorTypeQueue"),nt=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+75,c=e.append("g").lower();s||(et++,c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),a.actorCnt=et),c=e.append("g");let h=G;return h+=s?" "+j:" "+H,c.attr("class",h),c.attr("name",a.name),(o=t()).x=a.x,o.y=i,o.fill="#eaeaea",o.width=a.width,o.height=a.height,o.class="actor",n=a.x+a.width/2,e=i+30,c.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),c.append("circle").attr("cx",n).attr("cy",e).attr("r",18).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),c.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${n}, ${e-18})`),i=c.node().getBBox(),a.height=i.height+2*(r?.sequence?.labelBoxHeight??0),kt(r,f(a.description))(a.description,c,o.x,o.y+18+(s?5:10),o.width,o.height,{class:"actor "+G},r),a.height}),"drawActorTypeControl"),ot=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+75,c=e.append("g").lower();e=e.append("g");let h=G;h+=s?" "+j:" "+H,e.attr("class",h),e.attr("name",a.name);var l=t(),d=(l.x=a.x,l.y=i,l.fill="#eaeaea",l.width=a.width,l.height=a.height,l.class="actor",a.x+a.width/2),p=i+(s?10:25);e.append("circle").attr("cx",d).attr("cy",p).attr("r",18).attr("width",a.width).attr("height",a.height),e.append("line").attr("x1",d-18).attr("x2",d+18).attr("y1",p+18).attr("y2",p+18).attr("stroke","#333").attr("stroke-width",2),d=e.node().getBBox();return a.height=d.height+(r?.sequence?.labelBoxHeight??0),s||(et++,c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),a.actorCnt=et),kt(r,f(a.description))(a.description,e,l.x,l.y+(s?(p-i+18-5)/2:(p+18-i)/2),l.width,l.height,{class:"actor "+G},r),e.attr("transform","translate(0, 9)"),a.height}),"drawActorTypeEntity"),ct=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+a.height+2*r.boxTextMargin;let c=e=e.append("g").lower();s||(et++,Object.keys(a.links||{}).length&&!r.forceMenus&&c.attr("onclick",Z(`actor${et}_popup`)).attr("cursor","pointer"),c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),c=e.append("g"),a.actorCnt=et,null!=a.links&&c.attr("id","root-"+et)),o=t();let h="actor";a.properties?.class?h=a.properties.class:o.fill="#eaeaea",h+=s?" "+j:" "+H,o.x=a.x,o.y=i,o.width=a.width,o.height=a.height,o.class=h,o.name=a.name,o.x=a.x,o.y=i;n=o.width/4,e=o.width/4;var l=(i=n/2)/(2.5+n/50),d=c.append("g");i=`\n M ${o.x},${o.y+l}\n a ${i},${l} 0 0 0 ${n},0\n a ${i},${l} 0 0 0 -${n},0\n l 0,${e-2*l}\n a ${i},${l} 0 0 0 ${n},0\n l 0,-${e-2*l}\n`;return(i=(d.append("path").attr("d",i).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",h),s?d.attr("transform",`translate(${1.5*n}, ${o.height/4-2*l})`):d.attr("transform",`translate(${1.5*n}, ${(o.height+l)/4})`),a.rectData=o,kt(r,f(a.description))(a.description,c,o.x,o.y+(s?(o.height+e)/4:(o.height+l)/2),o.width,o.height,{class:"actor "+U},r),d.select("path:last-child"))).node()&&(n=i.node().getBBox(),a.height=n.height+(r.sequence.labelBoxHeight??0)),a.height}),"drawActorTypeDatabase"),ht=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+80,c=e.append("g").lower();s||(et++,c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),a.actorCnt=et),c=e.append("g");let h=G;return h+=s?" "+j:" "+H,c.attr("class",h),c.attr("name",a.name),(o=t()).x=a.x,o.y=i,o.fill="#eaeaea",o.width=a.width,o.height=a.height,o.class="actor",c.append("line").attr("id","actor-man-torso"+et).attr("x1",a.x+a.width/2-75).attr("y1",i+10).attr("x2",a.x+a.width/2-15).attr("y2",i+10),c.append("line").attr("id","actor-man-arms"+et).attr("x1",a.x+a.width/2-75).attr("y1",i+0).attr("x2",a.x+a.width/2-75).attr("y2",i+20),c.append("circle").attr("cx",a.x+a.width/2).attr("cy",i+10).attr("r",30),n=c.node().getBBox(),a.height=n.height+(r.sequence.labelBoxHeight??0),kt(r,f(a.description))(a.description,c,o.x,o.y+(s?11:18),o.width,o.height,{class:"actor "+G},r),c.attr("transform","translate(0,22)"),a.height}),"drawActorTypeBoundary"),lt=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+80,c=e.append("g").lower();s||(et++,c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),a.actorCnt=et),c=e.append("g");let h=G;return h+=s?" "+j:" "+H,c.attr("class",h),c.attr("name",a.name),(o=t()).x=a.x,o.y=i,o.fill="#eaeaea",o.width=a.width,o.height=a.height,o.class="actor",o.rx=3,o.ry=3,c.append("line").attr("id","actor-man-torso"+et).attr("x1",n).attr("y1",i+25).attr("x2",n).attr("y2",i+45),c.append("line").attr("id","actor-man-arms"+et).attr("x1",n-18).attr("y1",i+33).attr("x2",n+18).attr("y2",i+33),c.append("line").attr("x1",n-18).attr("y1",i+60).attr("x2",n).attr("y2",i+45),c.append("line").attr("x1",n).attr("y1",i+45).attr("x2",n+18-2).attr("y2",i+60),(e=c.append("circle")).attr("cx",a.x+a.width/2),e.attr("cy",i+10),e.attr("r",15),e.attr("width",a.width),e.attr("height",a.height),s=c.node().getBBox(),a.height=s.height,kt(r,f(a.description))(a.description,c,o.x,o.y+35,o.width,o.height,{class:"actor "+G},r),a.height}),"drawActorTypeActor"),dt=n((async function(t,e,a,r){switch(e.type){case"actor":return lt(t,e,a,r);case"participant":return rt(t,e,a,r);case"boundary":return ht(t,e,a,r);case"control":return nt(t,e,a,r);case"entity":return ot(t,e,a,r);case"database":return ct(t,e,a,r);case"collections":return st(t,e,a,r);case"queue":return it(t,e,a,r)}}),"drawActor"),pt=n((function(t,e,a){t=t.append("g"),yt(t,e),e.name&&kt(a)(e.name,t,e.x,e.y+a.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),t.lower()}),"drawBox"),gt=n((function(t){return t.append("g")}),"anchorElement"),ut=n((function(e,a,r,s,i){var n=t(),o=a.anchored;n.x=a.startx,n.y=a.starty,n.class="activation"+i%3,n.width=a.stopx-a.startx,n.height=r-a.starty,K(o,n)}),"drawActivation"),xt=n((async function(t,a,r,s){var{boxMargin:i,boxTextMargin:o,labelBoxHeight:s,labelBoxWidth:c,messageFontFamily:h,messageFontSize:l,messageFontWeight:d}=s;const p=t.append("g"),g=n((function(t,e,a,r){return p.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",r).attr("class","loopLine")}),"drawLoopLine");g(a.startx,a.starty,a.stopx,a.starty),g(a.stopx,a.starty,a.stopx,a.stopy),g(a.startx,a.stopy,a.stopx,a.stopy),g(a.startx,a.starty,a.startx,a.stopy),void 0!==a.sections&&a.sections.forEach((function(t){g(a.startx,t.y,a.stopx,t.y).style("stroke-dasharray","3, 3")}));let u=e();u.text=r,u.x=a.startx,u.y=a.starty,u.fontFamily=h,u.fontSize=l,u.fontWeight=d,u.anchor="middle",u.valign="middle",u.tspan=!1,u.width=c||50,u.height=s||20,u.textMargin=o,u.class="labelText",tt(p,u),(u=Lt()).text=a.title,u.x=a.startx+c/2+(a.stopx-a.startx)/2,u.y=a.starty+i+o,u.anchor="middle",u.valign="middle",u.textMargin=o,u.class="loopText",u.fontFamily=h,u.fontSize=l,u.fontWeight=d,u.wrap=!0;var x=f(u.text)?await J(p,u,a):Q(p,u);if(void 0!==a.sectionTitles)for(var[y,m]of Object.entries(a.sectionTitles))m.message&&(u.text=m.message,u.x=a.startx+(a.stopx-a.startx)/2,u.y=a.sections[y].y+i+o,u.class="loopText",u.anchor="middle",u.valign="middle",u.tspan=!1,u.fontFamily=h,u.fontSize=l,u.fontWeight=d,u.wrap=a.wrap,f(u.text)?(a.starty=a.sections[y].y,await J(p,u,a)):Q(p,u),m=Math.round(x.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e))),a.sections[y].height+=m-(i+o));return a.height=Math.round(a.stopy-a.starty),p}),"drawLoop"),yt=n((function(t,e){r(t,e)}),"drawBackgroundRect"),mt=n((function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")}),"insertDatabaseIcon"),bt=n((function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")}),"insertComputerIcon"),Tt=n((function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")}),"insertClockIcon"),Et=n((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")}),"insertArrowHead"),ft=n((function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"insertArrowFilledHead"),wt=n((function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)}),"insertSequenceNumber"),It=n((function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")}),"insertArrowCrossHead"),Lt=n((function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}}),"getTextObj"),vt=n((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),kt=function(){function t(t,e,a,r,i,n,o){s(e.append("text").attr("x",a+i/2).attr("y",r+n/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,a,r,i,n,o,c){var{actorFontSize:c,actorFontFamily:h,actorFontWeight:l}=c,[d,p]=M(c),g=t.split(E.lineBreakRegex);for(let t=0;t<g.length;t++){var u=t*d-d*(g.length-1)/2,x=e.append("text").attr("x",a+i/2).attr("y",r).style("text-anchor","middle").style("font-size",p).style("font-weight",l).style("font-family",h);x.append("tspan").attr("x",a+i/2).attr("dy",u).text(g[t]),x.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(x,o)}}function a(t,a,r,i,n,o,c,h){var l=(a=a.append("switch")).append("foreignObject").attr("x",r).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,a,r,i,n,o,c,h),s(l,c)}async function r(t,a,r,i,n,o,c,h){var l=await w(t,A());(l=(a=a.append("switch")).append("foreignObject").attr("x",r+n/2-l.width/2).attr("y",i+o/2-l.height/2).attr("width",l.width).attr("height",l.height).append("xhtml:div").style("height","100%").style("width","100%")).append("div").style("text-align","center").style("vertical-align","middle").html(await N(t,A())),e(t,a,r,i,n,o,c,h),s(l,c)}function s(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return n(t,"byText"),n(e,"byTspan"),n(a,"byFo"),n(r,"byKatex"),n(s,"_setTextAttrs"),function(s,i=!1){return i?r:"fo"===s.textPlacement?a:"old"===s.textPlacement?t:e}}(),Pt=function(){function t(t,e,a,s,i,n,o){r(e.append("text").attr("x",a).attr("y",s).style("text-anchor","start").text(t),o)}function e(t,e,a,s,i,n,o,c){var{actorFontSize:h,actorFontFamily:l,actorFontWeight:d}=c,p=t.split(E.lineBreakRegex);for(let t=0;t<p.length;t++){var g=t*h-h*(p.length-1)/2,u=e.append("text").attr("x",a).attr("y",s).style("text-anchor","start").style("font-size",h).style("font-weight",d).style("font-family",l);u.append("tspan").attr("x",a).attr("dy",g).text(p[t]),u.attr("y",s+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(u,o)}}function a(t,a,s,i,n,o,c,h){(n=(a=a.append("switch")).append("foreignObject").attr("x",s).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%")).append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,a,s,i,0,o,c,h),r(n,c)}function r(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return n(t,"byText"),n(e,"byTspan"),n(a,"byFo"),n(r,"_setTextAttrs"),function(r){return"fo"===r.textPlacement?a:"old"===r.textPlacement?t:e}}(),_t={drawRect:K,drawText:Q,drawLabel:tt,drawActor:dt,drawBox:pt,drawPopup:X,anchorElement:gt,drawActivation:ut,drawLoop:xt,drawBackgroundRect:yt,insertArrowHead:Et,insertArrowFilledHead:ft,insertSequenceNumber:wt,insertArrowCrossHead:It,insertDatabaseIcon:mt,insertComputerIcon:bt,insertClockIcon:Tt,getTextObj:Lt,getNoteRect:vt,fixLifeLineHeights:at,sanitizeUrl:P},Nt={},At={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:n((function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))}),"getHeight"),clear:n((function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]}),"clear"),addBox:n((function(t){this.boxes.push(t)}),"addBox"),addActor:n((function(t){this.actors.push(t)}),"addActor"),addLoop:n((function(t){this.loops.push(t)}),"addLoop"),addMessage:n((function(t){this.messages.push(t)}),"addMessage"),addNote:n((function(t){this.notes.push(t)}),"addNote"),lastActor:n((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:n((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:n((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:n((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:n((function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Vt(g())}),"init"),updateVal:n((function(t,e,a,r){void 0===t[e]?t[e]=a:t[e]=r(a,t[e])}),"updateVal"),updateBounds:n((function(t,e,a,r){const s=this;let i=0;function o(o){return n((function(n){i++;var c=s.sequenceItems.length-i+1;s.updateVal(n,"starty",e-c*Nt.boxMargin,Math.min),s.updateVal(n,"stopy",r+c*Nt.boxMargin,Math.max),s.updateVal(At.data,"startx",t-c*Nt.boxMargin,Math.min),s.updateVal(At.data,"stopx",a+c*Nt.boxMargin,Math.max),"activation"!==o&&(s.updateVal(n,"startx",t-c*Nt.boxMargin,Math.min),s.updateVal(n,"stopx",a+c*Nt.boxMargin,Math.max),s.updateVal(At.data,"starty",e-c*Nt.boxMargin,Math.min),s.updateVal(At.data,"stopy",r+c*Nt.boxMargin,Math.max))}),"updateItemBounds")}n(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))}),"updateBounds"),insert:n((function(t,e,a,r){var s=E.getMin(t,a);t=E.getMax(t,a),a=E.getMin(e,r),e=E.getMax(e,r);this.updateVal(At.data,"startx",s,Math.min),this.updateVal(At.data,"starty",a,Math.min),this.updateVal(At.data,"stopx",t,Math.max),this.updateVal(At.data,"stopy",e,Math.max),this.updateBounds(s,a,t,e)}),"insert"),newActivation:n((function(t,e,a){a=a.get(t.from);var r=Ft(t.from).length||0;a=a.x+a.width/2+(r-1)*Nt.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Nt.activationWidth,stopy:void 0,actor:t.from,anchored:_t.anchorElement(e)})}),"newActivation"),endActivation:n((function(t){return t=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from),this.activations.splice(t,1)[0]}),"endActivation"),createLoop:n((function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}}),"createLoop"),newLoop:n((function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:n((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:n((function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap}),"isLoopOverlap"),addSectionToLoop:n((function(t){var e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:At.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:n((function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)}),"saveVerticalPos"),resetVerticalPos:n((function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)}),"resetVerticalPos"),bumpVerticalPos:n((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=E.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:n((function(){return this.verticalPos}),"getVerticalPos"),getBounds:n((function(){return{bounds:this.data,models:this.models}}),"getBounds")},Mt=n((async function(a,r){At.bumpVerticalPos(Nt.boxMargin),r.height=Nt.boxMargin,r.starty=At.getVerticalPos();var s=t(),i=(a=(s.x=r.startx,s.y=r.starty,s.width=r.width||Nt.width,s.class="note",a.append("g")),_t.drawRect(a,s)),n=(a=((n=e()).x=r.startx,n.y=r.starty,n.width=s.width,n.dy="1em",n.text=r.message,n.class="noteText",n.fontFamily=Nt.noteFontFamily,n.fontSize=Nt.noteFontSize,n.fontWeight=Nt.noteFontWeight,n.anchor=Nt.noteAlign,n.textMargin=Nt.noteMargin,n.valign="center",f(n.text)?await J(a,n):Q(a,n)),Math.round(a.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e))));i.attr("height",n+2*Nt.noteMargin),r.height+=n+2*Nt.noteMargin,At.bumpVerticalPos(n+2*Nt.noteMargin),r.stopy=r.starty+n+2*Nt.noteMargin,r.stopx=r.startx+s.width,At.insert(r.startx,r.starty,r.stopx,r.stopy),At.models.addNote(r)}),"drawNote"),Ot=n((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont"),St=n((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont"),Dt=n((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function Rt(t,e){At.bumpVerticalPos(10);var{startx:a,stopx:r,message:s}=e,i=E.splitBreaks(s).length,n=f(s),s=n?await w(s,g()):I.calculateTextDimensions(s,Ot(Nt));n||(n=s.height/i,e.height+=n,At.bumpVerticalPos(n));let o,c=s.height-10;return i=s.width,a===r?(o=At.getVerticalPos()+c,Nt.rightAngles||(c+=Nt.boxMargin,o=At.getVerticalPos()+c),c+=30,n=E.getMax(i/2,Nt.width/2),At.insert(a-n,At.getVerticalPos()-10+c,r+n,At.getVerticalPos()+30+c)):(c+=Nt.boxMargin,o=At.getVerticalPos()+c,At.insert(a,o-10,r,o)),At.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,At.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),o}n(Rt,"boundMessage");var Ct=n((async function(t,a,r,s){var{startx:a,stopx:i,starty:n,message:o,type:c,sequenceIndex:h,sequenceVisible:l}=a,d=I.calculateTextDimensions(o,Ot(Nt)),p=e(),n=(p.x=a,p.y=n+10,p.width=i-a,p.class="messageText",p.dy="1em",p.text=o,p.fontFamily=Nt.messageFontFamily,p.fontSize=Nt.messageFontSize,p.fontWeight=Nt.messageFontWeight,p.anchor=Nt.messageAlign,p.valign="center",p.textMargin=Nt.wrapPadding,p.tspan=!1,f(p.text)?await J(t,p,{startx:a,stopx:i,starty:r}):Q(t,p),d.width);let g,u=(a===i?g=Nt.rightAngles?t.append("path").attr("d",`M ${a},${r} H ${a+E.getMax(Nt.width/2,n/2)} V ${r+25} H `+a):t.append("path").attr("d","M "+a+","+r+" C "+(a+60)+","+(r-10)+" "+(a+60)+","+(r+30)+" "+a+","+(r+20)):((g=t.append("line")).attr("x1",a),g.attr("y1",r),g.attr("x2",i),g.attr("y2",r)),c===s.db.LINETYPE.DOTTED||c===s.db.LINETYPE.DOTTED_CROSS||c===s.db.LINETYPE.DOTTED_POINT||c===s.db.LINETYPE.DOTTED_OPEN||c===s.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0"),"");Nt.arrowMarkerAbsolute&&(u=_(!0)),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),c!==s.db.LINETYPE.SOLID&&c!==s.db.LINETYPE.DOTTED||g.attr("marker-end","url("+u+"#arrowhead)"),c!==s.db.LINETYPE.BIDIRECTIONAL_SOLID&&c!==s.db.LINETYPE.BIDIRECTIONAL_DOTTED||(g.attr("marker-start","url("+u+"#arrowhead)"),g.attr("marker-end","url("+u+"#arrowhead)")),c!==s.db.LINETYPE.SOLID_POINT&&c!==s.db.LINETYPE.DOTTED_POINT||g.attr("marker-end","url("+u+"#filled-head)"),c!==s.db.LINETYPE.SOLID_CROSS&&c!==s.db.LINETYPE.DOTTED_CROSS||g.attr("marker-end","url("+u+"#crosshead)"),(l||Nt.showSequenceNumbers)&&(c!==s.db.LINETYPE.BIDIRECTIONAL_SOLID&&c!==s.db.LINETYPE.BIDIRECTIONAL_DOTTED||(a<i?g.attr("x1",a+12):g.attr("x1",a+6)),t.append("line").attr("x1",a).attr("y1",r).attr("x2",a).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+u+"#sequencenumber)"),t.append("text").attr("x",a).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(h))}),"drawMessage"),$t=n((function(t,e,a,r,s,i,n){let o,c=0,h=0,l=0;for(const t of r){var d=e.get(t),p=d.box;o&&o!=p&&(n||At.models.addBox(o),h+=Nt.boxMargin+o.margin),p&&p!=o&&(n||(p.x=c+h,p.y=s),h+=p.margin),d.width=d.width||Nt.width,d.height=E.getMax(d.height||Nt.height,Nt.height),d.margin=d.margin||Nt.actorMargin,l=E.getMax(l,d.height),a.get(d.name)&&(h+=d.width/2),d.x=c+h,d.starty=At.getVerticalPos(),At.insert(d.x,s,d.x+d.width,d.height),c+=d.width+h,d.box&&(d.box.width=c+p.margin-d.box.x),h=d.margin,o=d.box,At.models.addActor(d)}o&&!n&&At.models.addBox(o),At.bumpVerticalPos(l)}),"addActorRenderingData"),Bt=n((async function(t,e,a,r){if(r){let r=0;At.bumpVerticalPos(2*Nt.boxMargin);for(const i of a){var s=((s=e.get(i)).stopy||(s.stopy=At.getVerticalPos()),await _t.drawActor(t,s,Nt,!0));r=E.getMax(r,s)}At.bumpVerticalPos(r+Nt.boxMargin)}else for(const r of a){var i=e.get(r);await _t.drawActor(t,i,Nt,!1)}}),"drawActors"),Yt=n((function(t,e,a,r){let s=0,i=0;for(const c of a){var n=e.get(c),o=Ut(n);(o=_t.drawPopup(t,n,o,Nt,Nt.forceMenus,r)).height>s&&(s=o.height),o.width+n.x>i&&(i=o.width+n.x)}return{maxHeight:s,maxWidth:i}}),"drawActorsPopup"),Vt=n((function(t){L(Nt,t),t.fontFamily&&(Nt.actorFontFamily=Nt.noteFontFamily=Nt.messageFontFamily=t.fontFamily),t.fontSize&&(Nt.actorFontSize=Nt.noteFontSize=Nt.messageFontSize=t.fontSize),t.fontWeight&&(Nt.actorFontWeight=Nt.noteFontWeight=Nt.messageFontWeight=t.fontWeight)}),"setConf"),Ft=n((function(t){return At.activations.filter((function(e){return e.actor===t}))}),"actorActivations"),Wt=n((function(t,e){return e=e.get(t),[(t=Ft(t)).reduce((function(t,e){return E.getMin(t,e.startx)}),e.x+e.width/2-1),t.reduce((function(t,e){return E.getMax(t,e.stopx)}),e.x+e.width/2+1)]}),"activationBounds");function qt(t,e,a,r,s){At.bumpVerticalPos(a);let i=r;e.id&&e.message&&t[e.id]&&(a=t[e.id].width,t=Ot(Nt),e.message=I.wrapLabel(`[${e.message}]`,a-2*Nt.wrapPadding,t),e.width=a,e.wrap=!0,a=I.calculateTextDimensions(e.message,t),i=r+(t=E.getMax(a.height,Nt.labelBoxHeight)),m.debug(t+" - "+e.message)),s(e),At.bumpVerticalPos(i)}function zt(t,e,a,r,s,i,o){function c(a,r){a.x<s.get(t.from).x?(At.insert(e.stopx-r,e.starty,e.startx,e.stopy+a.height/2+Nt.noteMargin),e.stopx=e.stopx+r):(At.insert(e.startx,e.starty,e.stopx+r,e.stopy+a.height/2+Nt.noteMargin),e.stopx=e.stopx-r)}function h(a,r){a.x<s.get(t.to).x?(At.insert(e.startx-r,e.starty,e.stopx,e.stopy+a.height/2+Nt.noteMargin),e.startx=e.startx+r):(At.insert(e.stopx,e.starty,e.startx+r,e.stopy+a.height/2+Nt.noteMargin),e.startx=e.startx-r)}n(c,"receiverAdjustment"),n(h,"senderAdjustment");var l=[Y,V,W,F];i.get(t.to)==r?(c(i=s.get(t.to),l.includes(i.type)?21:i.width/2+3),i.starty=a-i.height/2,At.bumpVerticalPos(i.height/2)):o.get(t.from)==r?(i=s.get(t.from),Nt.mirrorActors&&h(i,l.includes(i.type)?18:i.width/2),i.stopy=a-i.height/2,At.bumpVerticalPos(i.height/2)):o.get(t.to)==r&&(i=s.get(t.to),Nt.mirrorActors&&c(i,l.includes(i.type)?21:i.width/2+3),i.stopy=a-i.height/2,At.bumpVerticalPos(i.height/2))}n(qt,"adjustLoopHeightForWrap"),n(zt,"adjustCreatedDestroyedData");var Ht=n((async function(t,e,a,r){var{securityLevel:s,sequence:i}=g();let o;Nt=i,"sandbox"===s&&(o=v("#i"+e));i=v("sandbox"===s?o.nodes()[0].contentDocument.body:"body");var c="sandbox"===s?o.nodes()[0].contentDocument:document;At.init(),m.debug(r.db);const h="sandbox"===s?i.select(`[id="${e}"]`):v(`[id="${e}"]`);var l=r.db.getActors(),d=r.db.getCreatedActors(),p=r.db.getDestroyedActors(),s=r.db.getBoxes();let u=r.db.getActorKeys();var i=r.db.getMessages(),x=(e=r.db.getDiagramTitle(),r.db.hasAtLeastOneBox()),y=r.db.hasAtLeastOneBoxWithTitle(),b=await jt(l,i,r);if(Nt.height=await Gt(l,b,s),_t.insertComputerIcon(h),_t.insertDatabaseIcon(h),_t.insertClockIcon(h),x&&(At.bumpVerticalPos(Nt.boxMargin),y)&&At.bumpVerticalPos(s[0].textMaxHeight),!0===Nt.hideUnusedParticipants){const t=new Set;i.forEach((e=>{t.add(e.from),t.add(e.to)})),u=u.filter((e=>t.has(e)))}$t(h,l,d,u,0,i,!1);var T=await Zt(i,l,b,r);function E(t,e){var a=At.endActivation(t);a.starty+18>e&&(a.starty=e-6,e+=12),_t.drawActivation(h,a,e,Nt,Ft(t.from).length),At.insert(a.startx,e-10,a.stopx,e)}_t.insertArrowHead(h),_t.insertArrowCrossHead(h),_t.insertArrowFilledHead(h),_t.insertSequenceNumber(h),n(E,"activeEnd");let f=1,w=1;var I=[],L=[];let P=0;for(const e of i){let a,s,i;switch(e.type){case r.db.LINETYPE.NOTE:At.resetVerticalPos(),s=e.noteModel,await Mt(h,s);break;case r.db.LINETYPE.ACTIVE_START:At.newActivation(e,h,l);break;case r.db.LINETYPE.ACTIVE_END:E(e,At.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.LOOP_END:a=At.endLoop(),await _t.drawLoop(h,a,"loop",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.RECT_START:qt(T,e,Nt.boxMargin,Nt.boxMargin,(t=>At.newLoop(void 0,t.message)));break;case r.db.LINETYPE.RECT_END:a=At.endLoop(),L.push(a),At.models.addLoop(a),At.bumpVerticalPos(a.stopy-At.getVerticalPos());break;case r.db.LINETYPE.OPT_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.OPT_END:a=At.endLoop(),await _t.drawLoop(h,a,"opt",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.ALT_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.ALT_ELSE:qt(T,e,Nt.boxMargin+Nt.boxTextMargin,Nt.boxMargin,(t=>At.addSectionToLoop(t)));break;case r.db.LINETYPE.ALT_END:a=At.endLoop(),await _t.drawLoop(h,a,"alt",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t))),At.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:qt(T,e,Nt.boxMargin+Nt.boxTextMargin,Nt.boxMargin,(t=>At.addSectionToLoop(t)));break;case r.db.LINETYPE.PAR_END:a=At.endLoop(),await _t.drawLoop(h,a,"par",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.AUTONUMBER:f=e.message.start||f,w=e.message.step||w,e.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.CRITICAL_OPTION:qt(T,e,Nt.boxMargin+Nt.boxTextMargin,Nt.boxMargin,(t=>At.addSectionToLoop(t)));break;case r.db.LINETYPE.CRITICAL_END:a=At.endLoop(),await _t.drawLoop(h,a,"critical",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.BREAK_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.BREAK_END:a=At.endLoop(),await _t.drawLoop(h,a,"break",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;default:try{(i=e.msgModel).starty=At.getVerticalPos(),i.sequenceIndex=f,i.sequenceVisible=r.db.showSequenceNumbers();var _=await Rt(0,i);zt(e,i,_,P,l,d,p),I.push({messageModel:i,lineStartY:_}),At.models.addMessage(i)}catch(t){m.error("error while drawing message",t)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(f+=w),P++}m.debug("createdActors",d),m.debug("destroyedActors",p),await Bt(h,l,u,!1);for(const t of I)await Ct(h,t.messageModel,t.lineStartY,r);Nt.mirrorActors&&await Bt(h,l,u,!0),L.forEach((t=>_t.drawBackgroundRect(h,t))),at(h,l,u,Nt);for(const t of At.models.boxes){t.height=At.getVerticalPos()-t.y,At.insert(t.x,t.y,t.x+t.width,t.height);var N=2*Nt.boxMargin;t.startx=t.x-N,t.starty=t.y-.25*N,t.stopx=t.startx+t.width+2*N,t.stopy=t.starty+t.height+.75*N,t.stroke="rgb(0,0,0, 0.5)",_t.drawBox(h,t,Nt)}x&&At.bumpVerticalPos(Nt.boxMargin),y=Yt(h,l,u,c),void 0===(s=At.getBounds().bounds).startx&&(s.startx=0),void 0===s.starty&&(s.starty=0),void 0===s.stopx&&(s.stopx=0),void 0===s.stopy&&(s.stopy=0);let A=s.stopy-s.starty,M=(A=A<y.maxHeight?y.maxHeight:A)+2*Nt.diagramMarginY,O=(Nt.mirrorActors&&(M=M-Nt.boxMargin+Nt.bottomMarginAdj),s.stopx-s.startx);b=(O=O<y.maxWidth?y.maxWidth:O)+2*Nt.diagramMarginX,e&&h.append("text").text(e).attr("x",(s.stopx-s.startx)/2-2*Nt.diagramMarginX).attr("y",-25),k(h,M,b,Nt.useMaxWidth),i=e?40:0,h.attr("viewBox",s.startx-Nt.diagramMarginX+" -"+(Nt.diagramMarginY+i)+" "+b+" "+(M+i)),m.debug("models:",At.models)}),"draw");async function jt(t,e,a){var r,s,i,n,o={};for(const c of e)t.get(c.to)&&t.get(c.from)&&(r=t.get(c.to),c.placement===a.db.PLACEMENT.LEFTOF&&!r.prevActor||c.placement===a.db.PLACEMENT.RIGHTOF&&!r.nextActor||(s=!(i=void 0!==c.placement),i=(i?St:Ot)(Nt),n=c.wrap?I.wrapLabel(c.message,Nt.width-2*Nt.wrapPadding,i):c.message,n=(f(n)?await w(c.message,g()):I.calculateTextDimensions(n,i)).width+2*Nt.wrapPadding,s&&c.from===r.nextActor?o[c.to]=E.getMax(o[c.to]||0,n):s&&c.from===r.prevActor?o[c.from]=E.getMax(o[c.from]||0,n):s&&c.from===c.to?(o[c.from]=E.getMax(o[c.from]||0,n/2),o[c.to]=E.getMax(o[c.to]||0,n/2)):c.placement===a.db.PLACEMENT.RIGHTOF?o[c.from]=E.getMax(o[c.from]||0,n):c.placement===a.db.PLACEMENT.LEFTOF?o[r.prevActor]=E.getMax(o[r.prevActor]||0,n):c.placement===a.db.PLACEMENT.OVER&&(r.prevActor&&(o[r.prevActor]=E.getMax(o[r.prevActor]||0,n/2)),r.nextActor)&&(o[c.from]=E.getMax(o[c.from]||0,n/2))));return m.debug("maxMessageWidthPerActor:",o),o}n(jt,"getMaxMessageWidthPerActor");var Ut=n((function(t){let e=0;var a=Dt(Nt);for(const s in t.links){var r=I.calculateTextDimensions(s,a).width+2*Nt.wrapPadding+2*Nt.boxMargin;e<r&&(e=r)}return e}),"getRequiredPopupWidth");async function Gt(t,e,a){let r=0;for(const e of t.keys()){var s=t.get(e),i=(s.wrap&&(s.description=I.wrapLabel(s.description,Nt.width-2*Nt.wrapPadding,Dt(Nt))),f(s.description)?await w(s.description,g()):I.calculateTextDimensions(s.description,Dt(Nt)));s.width=s.wrap?Nt.width:E.getMax(Nt.width,i.width+2*Nt.wrapPadding),s.height=s.wrap?E.getMax(i.height,Nt.height):Nt.height,r=E.getMax(r,s.height)}for(const a in e){var n,o=t.get(a);o&&((n=t.get(o.nextActor))?(n=e[a]+Nt.actorMargin-o.width/2-n.width/2,o.margin=E.getMax(n,Nt.actorMargin)):(n=e[a]+Nt.actorMargin-o.width/2,o.margin=E.getMax(n,Nt.actorMargin)))}let c=0;return a.forEach((e=>{var a=Ot(Nt),r=e.actorKeys.reduce(((e,a)=>e+(t.get(a).width+(t.get(a).margin||0))),0);r=r+8*Nt.boxMargin-2*Nt.boxTextMargin,e.wrap&&(e.name=I.wrapLabel(e.name,r-2*Nt.wrapPadding,a)),a=I.calculateTextDimensions(e.name,a),c=E.getMax(a.height,c),a=E.getMax(r,a.width+2*Nt.wrapPadding);e.margin=Nt.boxTextMargin,r<a&&(e.margin+=(a-r)/2)})),a.forEach((t=>t.textMaxHeight=c)),E.getMax(r,Nt.height)}n(Gt,"calculateActorMargins");var Kt=n((async function(t,e,a){var r=e.get(t.from),s=(e=e.get(t.to),r.x),i=e.x,n=t.wrap&&t.message,o=f(t.message)?await w(t.message,g()):I.calculateTextDimensions(n?I.wrapLabel(t.message,Nt.width,St(Nt)):t.message,St(Nt)),c={width:n?Nt.width:E.getMax(Nt.width,o.width+2*Nt.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===a.db.PLACEMENT.RIGHTOF?(c.width=n?E.getMax(Nt.width,o.width):E.getMax(r.width/2+e.width/2,o.width+2*Nt.noteMargin),c.startx=s+(r.width+Nt.actorMargin)/2):t.placement===a.db.PLACEMENT.LEFTOF?(c.width=n?E.getMax(Nt.width,o.width+2*Nt.noteMargin):E.getMax(r.width/2+e.width/2,o.width+2*Nt.noteMargin),c.startx=s-c.width+(r.width-Nt.actorMargin)/2):t.to===t.from?(o=I.calculateTextDimensions(n?I.wrapLabel(t.message,E.getMax(Nt.width,r.width),St(Nt)):t.message,St(Nt)),c.width=n?E.getMax(Nt.width,r.width):E.getMax(r.width,Nt.width,o.width+2*Nt.noteMargin),c.startx=s+(r.width-c.width)/2):(c.width=Math.abs(s+r.width/2-(i+e.width/2))+Nt.actorMargin,c.startx=s<i?s+r.width/2-Nt.actorMargin/2:i+e.width/2-Nt.actorMargin/2),n&&(c.message=I.wrapLabel(t.message,c.width-2*Nt.wrapPadding,St(Nt))),m.debug(`NM:[${c.startx},${c.stopx},${c.starty},${c.stopy}:${c.width},${c.height}=${t.message}]`),c}),"buildNoteModel"),Xt=n((function(t,e,a){if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};var[r,s]=Wt(t.from,e),[e,i]=Wt(t.to,e);const o=r<=e;let c=o?s:r,h=o?e:i;var l=2<Math.abs(e-i),d=n((t=>o?-t:t),"adjustValue");t.from===t.to?h=c:(t.activate&&!l&&(h+=d(Nt.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=d(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(c-=d(3))),l=[r,s,e,i],a=Math.abs(c-h),t.wrap&&t.message&&(t.message=I.wrapLabel(t.message,E.getMax(a+2*Nt.wrapPadding,Nt.width),Ot(Nt))),d=I.calculateTextDimensions(t.message,Ot(Nt));return{width:E.getMax(t.wrap?0:d.width+2*Nt.wrapPadding,a+2*Nt.wrapPadding,Nt.width),height:0,startx:c,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,l),toBounds:Math.max.apply(null,l)}}),"buildMessageModel"),Zt=n((async function(t,e,a,r){var s={},i=[];let n,o,c;for(const a of t){switch(a.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:i.push({id:a.id,msg:a.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:a.message&&(s[(n=i.pop()).id]=n,s[a.id]=n,i.push(n));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s[(n=i.pop()).id]=n;break;case r.db.LINETYPE.ACTIVE_START:var h=e.get(a.from||a.to.actor),l=Ft(a.from||a.to.actor).length;l={startx:h=h.x+h.width/2+(l-1)*Nt.activationWidth/2,stopx:h+Nt.activationWidth,actor:a.from,enabled:!0};At.activations.push(l);break;case r.db.LINETYPE.ACTIVE_END:h=At.activations.map((t=>t.actor)).lastIndexOf(a.from),At.activations.splice(h,1).splice(0,1)}void 0!==a.placement?(o=await Kt(a,e,r),a.noteModel=o,i.forEach((t=>{(n=t).from=E.getMin(n.from,o.startx),n.to=E.getMax(n.to,o.startx+o.width),n.width=E.getMax(n.width,Math.abs(n.from-n.to))-Nt.labelBoxWidth}))):(c=Xt(a,e,r),(a.msgModel=c).startx&&c.stopx&&0<i.length&&i.forEach((t=>{var r;n=t,c.startx===c.stopx?(t=e.get(a.from),r=e.get(a.to),n.from=E.getMin(t.x-c.width/2,t.x-t.width/2,n.from),n.to=E.getMax(r.x+c.width/2,r.x+t.width/2,n.to),n.width=E.getMax(n.width,Math.abs(n.to-n.from))-Nt.labelBoxWidth):(n.from=E.getMin(c.startx,n.from),n.to=E.getMax(c.stopx,n.to),n.width=E.getMax(n.width,c.width)-Nt.labelBoxWidth)})))}return At.activations=[],m.debug("Loop type widths:",s),s}),"calculateLoopBounds"),Jt={parser:R,get db(){return new q},renderer:{bounds:At,drawActors:Bt,drawActorsPopup:Yt,setConf:Vt,draw:Ht},styles:z,init:n((t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,T({sequence:{wrap:t.wrap}}))}),"init")};export{Jt as diagram};
@@ -0,0 +1 @@
1
+ import{g as t,a as e,d as a,b as r,c as s,e as i}from"./chunk-TZMSLE5B-6755c559.js";import{_ as n,s as o,c,n as h,g as l,b as d,o as p,d as g,p as u,J as x,t as y,l as m,i as b,x as T,e as E,L as f,M as w,u as I,a as L,j as v,k,m as P,N as _,O as N,E as A,P as M,Z as O}from"./web-4e6d8ea9.js";import{I as S}from"./chunk-QZHKN3VN-d57979be.js";var D=function(){var t=n((function(t,e,a,r){for(a=a||{},r=t.length;r--;a[t[r]]=e);return a}),"o"),e=[1,2],a=[1,3],r=[1,4],s=[2,4],i=[1,9],o=[1,11],c=[1,13],h=[1,14],l=[1,16],d=[1,17],p=[1,18],g=[1,24],u=[1,25],x=[1,26],y=[1,27],m=[1,28],b=[1,29],T=[1,30],E=[1,31],f=[1,32],w=[1,33],I=[1,34],L=[1,35],v=[1,36],k=[1,37],P=[1,38],_=[1,39],N=[1,41],A=[1,42],M=[1,43],O=[1,44],S=[1,45],D=[1,46],R=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],C=[2,71],$=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],Y=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],V=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],W=[69,70,71],q=[1,127];e={trace:n((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:n((function(t,e,a,r,s,i,n){var o=i.length-1;switch(s){case 3:return r.apply(i[o]),i[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:i[o-1].push(i[o]),this.$=i[o-1];break;case 6:case 7:case 11:case 12:case 63:this.$=i[o];break;case 15:i[o].type="createParticipant",this.$=i[o];break;case 16:i[o-1].unshift({type:"boxStart",boxData:r.parseBoxData(i[o-2])}),i[o-1].push({type:"boxEnd",boxText:i[o-2]}),this.$=i[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-2]),sequenceIndexStep:Number(i[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-1].actor};break;case 29:r.setDiagramTitle(i[o].substring(6)),this.$=i[o].substring(6);break;case 30:r.setDiagramTitle(i[o].substring(7)),this.$=i[o].substring(7);break;case 31:this.$=i[o].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=i[o].trim(),r.setAccDescription(this.$);break;case 34:i[o-1].unshift({type:"loopStart",loopText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.LOOP_START}),i[o-1].push({type:"loopEnd",loopText:i[o-2],signalType:r.LINETYPE.LOOP_END}),this.$=i[o-1];break;case 35:i[o-1].unshift({type:"rectStart",color:r.parseMessage(i[o-2]),signalType:r.LINETYPE.RECT_START}),i[o-1].push({type:"rectEnd",color:r.parseMessage(i[o-2]),signalType:r.LINETYPE.RECT_END}),this.$=i[o-1];break;case 36:i[o-1].unshift({type:"optStart",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.OPT_START}),i[o-1].push({type:"optEnd",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.OPT_END}),this.$=i[o-1];break;case 37:i[o-1].unshift({type:"altStart",altText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.ALT_START}),i[o-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=i[o-1];break;case 38:i[o-1].unshift({type:"parStart",parText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.PAR_START}),i[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=i[o-1];break;case 39:i[o-1].unshift({type:"parStart",parText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.PAR_OVER_START}),i[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=i[o-1];break;case 40:i[o-1].unshift({type:"criticalStart",criticalText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.CRITICAL_START}),i[o-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=i[o-1];break;case 41:i[o-1].unshift({type:"breakStart",breakText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.BREAK_START}),i[o-1].push({type:"breakEnd",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.BREAK_END}),this.$=i[o-1];break;case 43:this.$=i[o-3].concat([{type:"option",optionText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},i[o]]);break;case 45:this.$=i[o-3].concat([{type:"and",parText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.PAR_AND},i[o]]);break;case 47:this.$=i[o-3].concat([{type:"else",altText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.ALT_ELSE},i[o]]);break;case 48:i[o-3].draw="participant",i[o-3].type="addParticipant",i[o-3].description=r.parseMessage(i[o-1]),this.$=i[o-3];break;case 49:case 53:i[o-1].draw="participant",i[o-1].type="addParticipant",this.$=i[o-1];break;case 50:i[o-3].draw="actor",i[o-3].type="addParticipant",i[o-3].description=r.parseMessage(i[o-1]),this.$=i[o-3];break;case 51:i[o-1].draw="actor",i[o-1].type="addParticipant",this.$=i[o-1];break;case 52:i[o-1].type="destroyParticipant",this.$=i[o-1];break;case 54:this.$=[i[o-1],{type:"addNote",placement:i[o-2],actor:i[o-1].actor,text:i[o]}];break;case 55:i[o-2]=[].concat(i[o-1],i[o-1]).slice(0,2),i[o-2][0]=i[o-2][0].actor,i[o-2][1]=i[o-2][1].actor,this.$=[i[o-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:i[o-2].slice(0,2),text:i[o]}];break;case 56:this.$=[i[o-1],{type:"addLinks",actor:i[o-1].actor,text:i[o]}];break;case 57:this.$=[i[o-1],{type:"addALink",actor:i[o-1].actor,text:i[o]}];break;case 58:this.$=[i[o-1],{type:"addProperties",actor:i[o-1].actor,text:i[o]}];break;case 59:this.$=[i[o-1],{type:"addDetails",actor:i[o-1].actor,text:i[o]}];break;case 62:this.$=[i[o-2],i[o]];break;case 64:this.$=r.PLACEMENT.LEFTOF;break;case 65:this.$=r.PLACEMENT.RIGHTOF;break;case 66:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor}];break;case 67:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-4].actor}];break;case 68:this.$=[i[o-3],i[o-1],{type:"addMessage",from:i[o-3].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o]}];break;case 69:this.$={type:"addParticipant",actor:i[o-1],config:i[o]};break;case 70:this.$=i[o-1].trim();break;case 71:this.$={type:"addParticipant",actor:i[o]};break;case 72:this.$=r.LINETYPE.SOLID_OPEN;break;case 73:this.$=r.LINETYPE.DOTTED_OPEN;break;case 74:this.$=r.LINETYPE.SOLID;break;case 75:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=r.LINETYPE.DOTTED;break;case 77:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=r.LINETYPE.SOLID_CROSS;break;case 79:this.$=r.LINETYPE.DOTTED_CROSS;break;case 80:this.$=r.LINETYPE.SOLID_POINT;break;case 81:this.$=r.LINETYPE.DOTTED_POINT;break;case 82:this.$=r.parseMessage(i[o].trim().substring(1))}}),"anonymous"),table:[{3:1,4:e,5:a,6:r},{1:[3]},{3:5,4:e,5:a,6:r},{3:6,4:e,5:a,6:r},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:o,8:8,9:10,12:12,13:c,14:h,17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},t(R,[2,5]),{9:47,12:12,13:c,14:h,17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},t(R,[2,7]),t(R,[2,8]),t(R,[2,14]),{12:48,50:k,52:P,53:_},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:D},{22:55,71:D},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(R,[2,29]),t(R,[2,30]),{32:[1,61]},{34:[1,62]},t(R,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:D},{22:75,71:D},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:D},{22:92,71:D},{22:93,71:D},{22:94,71:D},t([5,51,65,76,77,78,79,80,81,82,83,84,85,86],C),t(R,[2,6]),t(R,[2,15]),t($,[2,9],{10:95}),t(R,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},t(R,[2,21]),{5:[1,99]},{5:[1,100]},t(R,[2,24]),t(R,[2,25]),t(R,[2,26]),t(R,[2,27]),t(R,[2,28]),t(R,[2,31]),t(R,[2,32]),t(B,s,{7:101}),t(B,s,{7:102}),t(B,s,{7:103}),t(Y,s,{40:104,7:105}),t(V,s,{42:106,7:107}),t(V,s,{7:107,42:108}),t(F,s,{45:109,7:110}),t(B,s,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},t([5,51],C,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:D},t(W,[2,72]),t(W,[2,73]),t(W,[2,74]),t(W,[2,75]),t(W,[2,76]),t(W,[2,77]),t(W,[2,78]),t(W,[2,79]),t(W,[2,80]),t(W,[2,81]),{22:123,71:D},{22:125,59:124,71:D},{71:[2,64]},{71:[2,65]},{57:126,86:q},{57:128,86:q},{57:129,86:q},{57:130,86:q},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:k,52:P,53:_},{5:[1,136]},t(R,[2,19]),t(R,[2,20]),t(R,[2,22]),t(R,[2,23]),{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[1,137],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[1,138],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[1,139],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{16:[1,140]},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[2,46],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,49:[1,141],50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{16:[1,142]},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[2,44],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,48:[1,143],50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{16:[1,144]},{16:[1,145]},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[2,42],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,47:[1,146],50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{4:i,5:o,8:8,9:10,12:12,13:c,14:h,16:[1,147],17:15,18:l,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:v,50:k,52:P,53:_,55:N,60:A,61:M,62:O,63:S,71:D},{15:[1,148]},t(R,[2,49]),t(R,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},t(R,[2,51]),t(R,[2,52]),{22:151,71:D},{22:152,71:D},{57:153,86:q},{57:154,86:q},{57:155,86:q},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},t(R,[2,16]),t($,[2,10]),{12:157,50:k,52:P,53:_},t($,[2,12]),t($,[2,13]),t(R,[2,18]),t(R,[2,34]),t(R,[2,35]),t(R,[2,36]),t(R,[2,37]),{15:[1,158]},t(R,[2,38]),{15:[1,159]},t(R,[2,39]),t(R,[2,40]),{15:[1,160]},t(R,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:q},{57:165,86:q},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:D},t($,[2,11]),t(Y,s,{7:105,40:167}),t(V,s,{7:107,42:168}),t(F,s,{7:110,45:169}),t(R,[2,48]),{5:[2,70]},t(R,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:n((function(t,e){var a;if(!e.recoverable)throw(a=new Error(t)).hash=e,a;this.trace(t)}),"parseError"),parse:n((function(t){var e,a=this,r=[0],s=[],i=[null],o=[],c=this.table,h="",l=0,d=0,p=o.slice.call(arguments,1),g=Object.create(this.lexer),u={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(u.yy[e]=this.yy[e]);g.setInput(t,u.yy),u.yy.lexer=g,u.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var x=g.yylloc,y=(o.push(x),g.options&&g.options.ranges);function m(){var t=s.pop()||g.lex()||1;return"number"!=typeof t&&(t instanceof Array&&(t=(s=t).pop()),t=a.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,n((function(t){r.length=r.length-2*t,i.length=i.length-t,o.length=o.length-t}),"popStack"),n(m,"lex");for(var b,T,E,f,w,I,L={};;){if(T=r[r.length-1],void 0===(E=this.defaultActions[T]||(null==b&&(b=m()),c[T]&&c[T][b]))||!E.length||!E[0]){var v,k=[];for(f in c[T])this.terminals_[f]&&2<f&&k.push("'"+this.terminals_[f]+"'");v=g.showPosition?"Parse error on line "+(l+1)+":\n"+g.showPosition()+"\nExpecting "+k.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(v,{text:g.match,token:this.terminals_[b]||b,line:g.yylineno,loc:x,expected:k})}if(E[0]instanceof Array&&1<E.length)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+b);switch(E[0]){case 1:r.push(b),i.push(g.yytext),o.push(g.yylloc),r.push(E[1]),b=null,d=g.yyleng,h=g.yytext,l=g.yylineno,x=g.yylloc;break;case 2:if(w=this.productions_[E[1]][1],L.$=i[i.length-w],L._$={first_line:o[o.length-(w||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(w||1)].first_column,last_column:o[o.length-1].last_column},y&&(L._$.range=[o[o.length-(w||1)].range[0],o[o.length-1].range[1]]),void 0!==(I=this.performAction.apply(L,[h,d,l,u.yy,E[1],i,o].concat(p))))return I;w&&(r=r.slice(0,-1*w*2),i=i.slice(0,-1*w),o=o.slice(0,-1*w)),r.push(this.productions_[E[1]][0]),i.push(L.$),o.push(L._$),I=c[r[r.length-2]][r[r.length-1]],r.push(I);break;case 3:return!0}}return!0}),"parse")},a={EOF:1,parseError:n((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:n((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:n((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:n((function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g),r=(this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e,t=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),a.length-1&&(this.yylineno-=a.length-1),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:a?(a.length===t.length?this.yylloc.first_column:0)+t[t.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:n((function(){return this._more=!0,this}),"more"),reject:n((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:n((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:n((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(20<t.length?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:n((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(20<t.length?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:n((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:n((function(t,e){var a,r;if(this.options.backtrack_lexer&&(r={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)&&(r.yylloc.range=this.yylloc.range.slice(0)),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.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],a=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack)for(var s in r)this[s]=r[s];return!1}),"test_match"),next:n((function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,a,r,s=this._currentRules(),i=0;i<s.length;i++)if((a=this._input.match(this.rules[s[i]]))&&(!e||a[0].length>e[0].length))if(e=a,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(a,s[i])))return t;if(!this._backtrack)return!1;e=!1}else if(!this.options.flex)break;return e?!1!==(t=this.test_match(e,s[r]))&&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:n((function(){return this.next()||this.lex()}),"lex"),begin:n((function(t){this.conditionStack.push(t)}),"begin"),popState:n((function(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:n((function(){return(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]]:this.conditions.INITIAL).rules}),"_currentRules"),topState:n((function(t){return 0<=(t=this.conditionStack.length-1-Math.abs(t||0))?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:n((function(t){this.begin(t)}),"pushState"),stateStackSize:n((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:n((function(t,e,a,r){switch(a){case 0:case 56:case 72:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:case 57:return e.yytext=e.yytext.trim(),71;case 11:case 17:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:case 69:return 86;case 70:return 69;case 71:return 70;case 73:return"INVALID"}}),"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}};function z(){this.yy={}}return e.lexer=a,n(z,"Parser"),new((z.prototype=e).Parser=z)}(),R=D.parser=D,C={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},$={FILLED:0,OPEN:1},B={LEFTOF:0,RIGHTOF:1,OVER:2},Y="actor",V="control",F="database",W="entity",q=class{constructor(){this.state=new S((()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0}))),this.setAccTitle=o,this.setAccDescription=c,this.setDiagramTitle=h,this.getAccTitle=l,this.getAccDescription=d,this.getDiagramTitle=p,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(g().wrap),this.LINETYPE=C,this.ARROWTYPE=$,this.PLACEMENT=B}static{n(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,a,r,s){let i,n=this.state.records.currentBox;if(void 0!==s){let t;t=s.includes("\n")?s+"\n":"{\n"+s+"\n}",i=u(t,{schema:x})}if(r=i?.type??r,s=this.state.records.actors.get(t)){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw new Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(n=s.box||this.state.records.currentBox,s.box=n,s&&e===s.name&&null==a)return}null==a?.text&&(a={text:e,type:r}),null!=r&&null!=a.text||(a={text:e,type:r}),this.state.records.actors.set(t,{box:n,name:e,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor&&(s=this.state.records.actors.get(this.state.records.prevActor))&&(s.nextActor=t),this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,a=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&a++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&a--;return a}addMessage(t,e,a,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a.text,wrap:a.wrap??this.autoWrap(),answer:r})}addSignal(t,e,a,r,s=!1){var i;if(r===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1)throw(i=new Error("Trying to inactivate an inactive participant ("+t+")")).hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},i;return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:r,activate:s}),!0}hasAtLeastOneBox(){return 0<this.state.records.boxes.length}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some((t=>t.name))}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();var e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:g().sequence?.wrap??!1}clear(){this.state.reset(),y()}parseMessage(t){t=t.trim();var{wrap:t,cleanedText:e}=this.extractWrap(t),e={text:e,wrap:t};return m.debug("parseMessage: "+JSON.stringify(e)),e}parseBoxData(t){var e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let a=e?.[1]?e[1].trim():"transparent",r=e?.[2]?e[2].trim():void 0;window?.CSS?window.CSS.supports("color",a)||(a="transparent",r=t.trim()):((e=(new Option).style).color=a,e.color!==a&&(a="transparent",r=t.trim()));var{wrap:e,cleanedText:t}=this.extractWrap(r);return{text:t?b(t,g()):void 0,color:a,wrap:e}}addNote(t,e,a){var r={actor:t,placement:e,message:a.text,wrap:a.wrap??this.autoWrap()};t=[].concat(t,t);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t[0],to:t[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){t=this.getActor(t);try{let r=b(e.text,g());r=(r=r.replace(/&equals;/g,"=")).replace(/&amp;/g,"&");var a=JSON.parse(r);this.insertLinks(t,a)}catch(t){m.error("error while parsing actor link text",t)}}addALink(t,e){t=this.getActor(t);try{var a={};let n=b(e.text,g());var r=n.indexOf("@"),s=(n=(n=n.replace(/&equals;/g,"=")).replace(/&amp;/g,"&")).slice(0,r-1).trim(),i=n.slice(r+1).trim();a[s]=i,this.insertLinks(t,a)}catch(t){m.error("error while parsing actor link text",t)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const a in e)t.links[a]=e[a]}addProperties(t,e){t=this.getActor(t);try{var a=b(e.text,g()),r=JSON.parse(a);this.insertProperties(t,r)}catch(t){m.error("error while parsing actor properties text",t)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const a in e)t.properties[a]=e[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){t=this.getActor(t),e=document.getElementById(e.text);try{var a=e.innerHTML,r=JSON.parse(a);r.properties&&this.insertProperties(t,r.properties),r.links&&this.insertLinks(t,r.links)}catch(t){m.error("error while parsing actor details text",t)}}getActorProperty(t,e){if(void 0!==t?.properties)return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach((t=>{this.apply(t)}));else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":o(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return g().sequence}},z=n((t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n \n .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n\n`),"getStyles"),H="actor-top",j="actor-bottom",U="actor-box",G="actor-man",K=n((function(t,e){return a(t,e)}),"drawRect"),X=n((function(t,e,a,r,s){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};var i=e.links,n=e.actorCnt,o=e.rectData,c=(e="none",s&&(e="block !important"),t.append("g")),h=(s=(c.attr("id","actor"+n+"_popup"),c.attr("class","actorPopupMenu"),c.attr("display",e),""),void 0!==o.class&&(s=" "+o.class),o.width>a?o.width:a);if((t=c.append("rect")).attr("class","actorPopupMenuPanel"+s),t.attr("x",o.x),t.attr("y",o.height),t.attr("fill",o.fill),t.attr("stroke",o.stroke),t.attr("width",h),t.attr("height",o.height),t.attr("rx",o.rx),t.attr("ry",o.ry),null!=i){var l,d=20;for(l in i){var p=c.append("a"),g=P(i[l]);p.attr("xlink:href",g),p.attr("target","_blank"),Pt(r)(l,p,o.x+10,o.height+d,h,20,{class:"actor"},r),d+=30}}return t.attr("height",d),{height:o.height+d,width:h}}),"drawPopup"),Z=n((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle"),J=n((async function(t,e,a=null){var r=t.append("foreignObject"),s=await N(e.text,A());s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),"noteText"===e.class){t=((t=t.node().firstChild).setAttribute("height",s.height+2*e.textMargin),t.getBBox());r.attr("x",Math.round(t.x+t.width/2-s.width/2)).attr("y",Math.round(t.y+t.height/2-s.height/2))}else if(a){let{startx:i,stopx:n,starty:o}=a;i>n&&(t=i,i=n,n=t),r.attr("x",Math.round(i+Math.abs(i-n)/2-s.width/2)),"loopText"===e.class?r.attr("y",Math.round(o)):r.attr("y",Math.round(o-s.height))}return[r]}),"drawKatex"),Q=n((function(t,e){let a=0,r=0;var s,i,o=e.text.split(E.lineBreakRegex),[c,h]=M(e.fontSize),l=[];let d=0,p=n((()=>e.y),"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&0<e.textMargin)switch(e.valign){case"top":case"start":p=n((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":p=n((()=>Math.round(e.y+(a+r+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":p=n((()=>Math.round(e.y+(a+r+2*e.textMargin)-e.textMargin)),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for([s,i]of o.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==c&&(d=s*c);var g,u=t.append("text"),x=(u.attr("x",e.x),u.attr("y",p()),void 0!==e.anchor&&u.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&u.style("font-family",e.fontFamily),void 0!==h&&u.style("font-size",h),void 0!==e.fontWeight&&u.style("font-weight",e.fontWeight),void 0!==e.fill&&u.attr("fill",e.fill),void 0!==e.class&&u.attr("class",e.class),void 0!==e.dy?u.attr("dy",e.dy):0!==d&&u.attr("dy",d),i||O);(e.tspan?((g=u.append("tspan")).attr("x",e.x),void 0!==e.fill&&g.attr("fill",e.fill),g):u).text(x),void 0!==e.valign&&void 0!==e.textMargin&&0<e.textMargin&&(r+=(u._groups||u)[0][0].getBBox().height,a=r),l.push(u)}return l}),"drawText"),tt=n((function(t,e){function a(t,e,a,r,s){return t+","+e+" "+(t+a)+","+e+" "+(t+a)+","+(e+r-s)+" "+(t+a-1.2*s)+","+(e+r)+" "+t+","+(e+r)}n(a,"genPoints");var r=t.append("polygon");return r.attr("points",a(e.x,e.y,e.width,e.height,7)),r.attr("class","labelBox"),e.y=e.y+e.height/2,Q(t,e),r}),"drawLabel"),et=-1,at=n(((t,e,a,r)=>{t.select&&a.forEach((a=>{a=e.get(a);var s=t.select("#actor"+a.actorCnt);!r.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):r.mirrorActors&&s.attr("y2",a.stopy)}))}),"fixLifeLineHeights"),rt=n((function(e,a,r,n){var o=n?a.stopy:a.starty,c=a.x+a.width/2,h=o+a.height,l=e=e.append("g").lower();n||(et++,Object.keys(a.links||{}).length&&!r.forceMenus&&l.attr("onclick",Z(`actor${et}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+et).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),l=e.append("g"),a.actorCnt=et,null!=a.links&&l.attr("id","root-"+et)),h=t(),c="actor",a.properties?.class?c=a.properties.class:h.fill="#eaeaea",c+=n?" "+j:" "+H,h.x=a.x,h.y=o,h.width=a.width,h.height=a.height,h.class=c,h.rx=3,h.ry=3,h.name=a.name,e=K(l,h);a.rectData=h,a.properties?.icon&&("@"===(n=a.properties.icon.trim()).charAt(0)?s(l,h.x+h.width-20,h.y+10,n.substr(1)):i(l,h.x+h.width-20,h.y+10,n)),kt(r,f(a.description))(a.description,l,h.x,h.y,h.width,h.height,{class:"actor "+U},r);let d=a.height;return e.node&&(o=e.node().getBBox(),a.height=o.height,d=o.height),d}),"drawActorTypeParticipant"),st=n((function(e,a,r,n){var o=n?a.stopy:a.starty,c=a.x+a.width/2,h=o+a.height,l=e=e.append("g").lower();n||(et++,Object.keys(a.links||{}).length&&!r.forceMenus&&l.attr("onclick",Z(`actor${et}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+et).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),l=e.append("g"),a.actorCnt=et,null!=a.links&&l.attr("id","root-"+et)),h=t(),c="actor",a.properties?.class?c=a.properties.class:h.fill="#eaeaea",c+=n?" "+j:" "+H,h.x=a.x,h.y=o,h.width=a.width,h.height=a.height,h.class=c,h.name=a.name,e={...h,x:h.x+-6,y:h.y+6,class:"actor"},n=K(l,h);K(l,e),a.rectData=h,a.properties?.icon&&("@"===(o=a.properties.icon.trim()).charAt(0)?s(l,h.x+h.width-20,h.y+10,o.substr(1)):i(l,h.x+h.width-20,h.y+10,o)),kt(r,f(a.description))(a.description,l,h.x-6,h.y+6,h.width,h.height,{class:"actor "+U},r);let d=a.height;return n.node&&(c=n.node().getBBox(),a.height=c.height,d=c.height),d}),"drawActorTypeCollections"),it=n((function(e,a,r,n){var o=n?a.stopy:a.starty,c=a.x+a.width/2,h=o+a.height;let l=e=e.append("g").lower();n||(et++,Object.keys(a.links||{}).length&&!r.forceMenus&&l.attr("onclick",Z(`actor${et}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+et).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),l=e.append("g"),a.actorCnt=et,null!=a.links&&l.attr("id","root-"+et)),h=t();let d="actor";a.properties?.class?d=a.properties.class:h.fill="#eaeaea",d+=n?" "+j:" "+H,h.x=a.x,h.y=o,h.width=a.width,h.height=a.height,h.class=d,h.name=a.name;e=(c=h.height/2)/(2.5+h.height/50),n=l.append("g"),o=l.append("g");n.append("path").attr("d",`M ${h.x},${h.y+c}\n a ${e},${c} 0 0 0 0,${h.height}\n h ${h.width-2*e}\n a ${e},${c} 0 0 0 0,-${h.height}\n Z\n `).attr("class",d),o.append("path").attr("d",`M ${h.x},${h.y+c}\n a ${e},${c} 0 0 0 0,`+h.height).attr("stroke","#666").attr("stroke-width","1px").attr("class",d),n.attr("transform",`translate(${e}, ${-h.height/2})`),o.attr("transform",`translate(${h.width-e}, ${-h.height/2})`),a.rectData=h,a.properties?.icon&&(c=a.properties.icon.trim(),o=h.x+h.width-20,e=h.y+10,"@"===c.charAt(0)?s(l,o,e,c.substr(1)):i(l,o,e,c)),kt(r,f(a.description))(a.description,l,h.x,h.y,h.width,h.height,{class:"actor "+U},r);let p=a.height;return(o=n.select("path:last-child")).node()&&(e=o.node().getBBox(),a.height=e.height,p=e.height),p}),"drawActorTypeQueue"),nt=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+75,c=e.append("g").lower();s||(et++,c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),a.actorCnt=et),c=e.append("g");let h=G;return h+=s?" "+j:" "+H,c.attr("class",h),c.attr("name",a.name),(o=t()).x=a.x,o.y=i,o.fill="#eaeaea",o.width=a.width,o.height=a.height,o.class="actor",n=a.x+a.width/2,e=i+30,c.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),c.append("circle").attr("cx",n).attr("cy",e).attr("r",18).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),c.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${n}, ${e-18})`),i=c.node().getBBox(),a.height=i.height+2*(r?.sequence?.labelBoxHeight??0),kt(r,f(a.description))(a.description,c,o.x,o.y+18+(s?5:10),o.width,o.height,{class:"actor "+G},r),a.height}),"drawActorTypeControl"),ot=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+75,c=e.append("g").lower();e=e.append("g");let h=G;h+=s?" "+j:" "+H,e.attr("class",h),e.attr("name",a.name);var l=t(),d=(l.x=a.x,l.y=i,l.fill="#eaeaea",l.width=a.width,l.height=a.height,l.class="actor",a.x+a.width/2),p=i+(s?10:25);e.append("circle").attr("cx",d).attr("cy",p).attr("r",18).attr("width",a.width).attr("height",a.height),e.append("line").attr("x1",d-18).attr("x2",d+18).attr("y1",p+18).attr("y2",p+18).attr("stroke","#333").attr("stroke-width",2),d=e.node().getBBox();return a.height=d.height+(r?.sequence?.labelBoxHeight??0),s||(et++,c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),a.actorCnt=et),kt(r,f(a.description))(a.description,e,l.x,l.y+(s?(p-i+18-5)/2:(p+18-i)/2),l.width,l.height,{class:"actor "+G},r),e.attr("transform","translate(0, 9)"),a.height}),"drawActorTypeEntity"),ct=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+a.height+2*r.boxTextMargin;let c=e=e.append("g").lower();s||(et++,Object.keys(a.links||{}).length&&!r.forceMenus&&c.attr("onclick",Z(`actor${et}_popup`)).attr("cursor","pointer"),c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),c=e.append("g"),a.actorCnt=et,null!=a.links&&c.attr("id","root-"+et)),o=t();let h="actor";a.properties?.class?h=a.properties.class:o.fill="#eaeaea",h+=s?" "+j:" "+H,o.x=a.x,o.y=i,o.width=a.width,o.height=a.height,o.class=h,o.name=a.name,o.x=a.x,o.y=i;n=o.width/4,e=o.width/4;var l=(i=n/2)/(2.5+n/50),d=c.append("g");i=`\n M ${o.x},${o.y+l}\n a ${i},${l} 0 0 0 ${n},0\n a ${i},${l} 0 0 0 -${n},0\n l 0,${e-2*l}\n a ${i},${l} 0 0 0 ${n},0\n l 0,-${e-2*l}\n`;return(i=(d.append("path").attr("d",i).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",h),s?d.attr("transform",`translate(${1.5*n}, ${o.height/4-2*l})`):d.attr("transform",`translate(${1.5*n}, ${(o.height+l)/4})`),a.rectData=o,kt(r,f(a.description))(a.description,c,o.x,o.y+(s?(o.height+e)/4:(o.height+l)/2),o.width,o.height,{class:"actor "+U},r),d.select("path:last-child"))).node()&&(n=i.node().getBBox(),a.height=n.height+(r.sequence.labelBoxHeight??0)),a.height}),"drawActorTypeDatabase"),ht=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+80,c=e.append("g").lower();s||(et++,c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),a.actorCnt=et),c=e.append("g");let h=G;return h+=s?" "+j:" "+H,c.attr("class",h),c.attr("name",a.name),(o=t()).x=a.x,o.y=i,o.fill="#eaeaea",o.width=a.width,o.height=a.height,o.class="actor",c.append("line").attr("id","actor-man-torso"+et).attr("x1",a.x+a.width/2-75).attr("y1",i+10).attr("x2",a.x+a.width/2-15).attr("y2",i+10),c.append("line").attr("id","actor-man-arms"+et).attr("x1",a.x+a.width/2-75).attr("y1",i+0).attr("x2",a.x+a.width/2-75).attr("y2",i+20),c.append("circle").attr("cx",a.x+a.width/2).attr("cy",i+10).attr("r",30),n=c.node().getBBox(),a.height=n.height+(r.sequence.labelBoxHeight??0),kt(r,f(a.description))(a.description,c,o.x,o.y+(s?11:18),o.width,o.height,{class:"actor "+G},r),c.attr("transform","translate(0,22)"),a.height}),"drawActorTypeBoundary"),lt=n((function(e,a,r,s){var i=s?a.stopy:a.starty,n=a.x+a.width/2,o=i+80,c=e.append("g").lower();s||(et++,c.append("line").attr("id","actor"+et).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name),a.actorCnt=et),c=e.append("g");let h=G;return h+=s?" "+j:" "+H,c.attr("class",h),c.attr("name",a.name),(o=t()).x=a.x,o.y=i,o.fill="#eaeaea",o.width=a.width,o.height=a.height,o.class="actor",o.rx=3,o.ry=3,c.append("line").attr("id","actor-man-torso"+et).attr("x1",n).attr("y1",i+25).attr("x2",n).attr("y2",i+45),c.append("line").attr("id","actor-man-arms"+et).attr("x1",n-18).attr("y1",i+33).attr("x2",n+18).attr("y2",i+33),c.append("line").attr("x1",n-18).attr("y1",i+60).attr("x2",n).attr("y2",i+45),c.append("line").attr("x1",n).attr("y1",i+45).attr("x2",n+18-2).attr("y2",i+60),(e=c.append("circle")).attr("cx",a.x+a.width/2),e.attr("cy",i+10),e.attr("r",15),e.attr("width",a.width),e.attr("height",a.height),s=c.node().getBBox(),a.height=s.height,kt(r,f(a.description))(a.description,c,o.x,o.y+35,o.width,o.height,{class:"actor "+G},r),a.height}),"drawActorTypeActor"),dt=n((async function(t,e,a,r){switch(e.type){case"actor":return lt(t,e,a,r);case"participant":return rt(t,e,a,r);case"boundary":return ht(t,e,a,r);case"control":return nt(t,e,a,r);case"entity":return ot(t,e,a,r);case"database":return ct(t,e,a,r);case"collections":return st(t,e,a,r);case"queue":return it(t,e,a,r)}}),"drawActor"),pt=n((function(t,e,a){t=t.append("g"),yt(t,e),e.name&&kt(a)(e.name,t,e.x,e.y+a.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),t.lower()}),"drawBox"),gt=n((function(t){return t.append("g")}),"anchorElement"),ut=n((function(e,a,r,s,i){var n=t(),o=a.anchored;n.x=a.startx,n.y=a.starty,n.class="activation"+i%3,n.width=a.stopx-a.startx,n.height=r-a.starty,K(o,n)}),"drawActivation"),xt=n((async function(t,a,r,s){var{boxMargin:i,boxTextMargin:o,labelBoxHeight:s,labelBoxWidth:c,messageFontFamily:h,messageFontSize:l,messageFontWeight:d}=s;const p=t.append("g"),g=n((function(t,e,a,r){return p.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",r).attr("class","loopLine")}),"drawLoopLine");g(a.startx,a.starty,a.stopx,a.starty),g(a.stopx,a.starty,a.stopx,a.stopy),g(a.startx,a.stopy,a.stopx,a.stopy),g(a.startx,a.starty,a.startx,a.stopy),void 0!==a.sections&&a.sections.forEach((function(t){g(a.startx,t.y,a.stopx,t.y).style("stroke-dasharray","3, 3")}));let u=e();u.text=r,u.x=a.startx,u.y=a.starty,u.fontFamily=h,u.fontSize=l,u.fontWeight=d,u.anchor="middle",u.valign="middle",u.tspan=!1,u.width=c||50,u.height=s||20,u.textMargin=o,u.class="labelText",tt(p,u),(u=Lt()).text=a.title,u.x=a.startx+c/2+(a.stopx-a.startx)/2,u.y=a.starty+i+o,u.anchor="middle",u.valign="middle",u.textMargin=o,u.class="loopText",u.fontFamily=h,u.fontSize=l,u.fontWeight=d,u.wrap=!0;var x=f(u.text)?await J(p,u,a):Q(p,u);if(void 0!==a.sectionTitles)for(var[y,m]of Object.entries(a.sectionTitles))m.message&&(u.text=m.message,u.x=a.startx+(a.stopx-a.startx)/2,u.y=a.sections[y].y+i+o,u.class="loopText",u.anchor="middle",u.valign="middle",u.tspan=!1,u.fontFamily=h,u.fontSize=l,u.fontWeight=d,u.wrap=a.wrap,f(u.text)?(a.starty=a.sections[y].y,await J(p,u,a)):Q(p,u),m=Math.round(x.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e))),a.sections[y].height+=m-(i+o));return a.height=Math.round(a.stopy-a.starty),p}),"drawLoop"),yt=n((function(t,e){r(t,e)}),"drawBackgroundRect"),mt=n((function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")}),"insertDatabaseIcon"),bt=n((function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")}),"insertComputerIcon"),Tt=n((function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")}),"insertClockIcon"),Et=n((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")}),"insertArrowHead"),ft=n((function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"insertArrowFilledHead"),wt=n((function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)}),"insertSequenceNumber"),It=n((function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")}),"insertArrowCrossHead"),Lt=n((function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}}),"getTextObj"),vt=n((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),kt=function(){function t(t,e,a,r,i,n,o){s(e.append("text").attr("x",a+i/2).attr("y",r+n/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,a,r,i,n,o,c){var{actorFontSize:c,actorFontFamily:h,actorFontWeight:l}=c,[d,p]=M(c),g=t.split(E.lineBreakRegex);for(let t=0;t<g.length;t++){var u=t*d-d*(g.length-1)/2,x=e.append("text").attr("x",a+i/2).attr("y",r).style("text-anchor","middle").style("font-size",p).style("font-weight",l).style("font-family",h);x.append("tspan").attr("x",a+i/2).attr("dy",u).text(g[t]),x.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(x,o)}}function a(t,a,r,i,n,o,c,h){var l=(a=a.append("switch")).append("foreignObject").attr("x",r).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,a,r,i,n,o,c,h),s(l,c)}async function r(t,a,r,i,n,o,c,h){var l=await w(t,A());(l=(a=a.append("switch")).append("foreignObject").attr("x",r+n/2-l.width/2).attr("y",i+o/2-l.height/2).attr("width",l.width).attr("height",l.height).append("xhtml:div").style("height","100%").style("width","100%")).append("div").style("text-align","center").style("vertical-align","middle").html(await N(t,A())),e(t,a,r,i,n,o,c,h),s(l,c)}function s(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return n(t,"byText"),n(e,"byTspan"),n(a,"byFo"),n(r,"byKatex"),n(s,"_setTextAttrs"),function(s,i=!1){return i?r:"fo"===s.textPlacement?a:"old"===s.textPlacement?t:e}}(),Pt=function(){function t(t,e,a,s,i,n,o){r(e.append("text").attr("x",a).attr("y",s).style("text-anchor","start").text(t),o)}function e(t,e,a,s,i,n,o,c){var{actorFontSize:h,actorFontFamily:l,actorFontWeight:d}=c,p=t.split(E.lineBreakRegex);for(let t=0;t<p.length;t++){var g=t*h-h*(p.length-1)/2,u=e.append("text").attr("x",a).attr("y",s).style("text-anchor","start").style("font-size",h).style("font-weight",d).style("font-family",l);u.append("tspan").attr("x",a).attr("dy",g).text(p[t]),u.attr("y",s+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(u,o)}}function a(t,a,s,i,n,o,c,h){(n=(a=a.append("switch")).append("foreignObject").attr("x",s).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%")).append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,a,s,i,0,o,c,h),r(n,c)}function r(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return n(t,"byText"),n(e,"byTspan"),n(a,"byFo"),n(r,"_setTextAttrs"),function(r){return"fo"===r.textPlacement?a:"old"===r.textPlacement?t:e}}(),_t={drawRect:K,drawText:Q,drawLabel:tt,drawActor:dt,drawBox:pt,drawPopup:X,anchorElement:gt,drawActivation:ut,drawLoop:xt,drawBackgroundRect:yt,insertArrowHead:Et,insertArrowFilledHead:ft,insertSequenceNumber:wt,insertArrowCrossHead:It,insertDatabaseIcon:mt,insertComputerIcon:bt,insertClockIcon:Tt,getTextObj:Lt,getNoteRect:vt,fixLifeLineHeights:at,sanitizeUrl:P},Nt={},At={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:n((function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))}),"getHeight"),clear:n((function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]}),"clear"),addBox:n((function(t){this.boxes.push(t)}),"addBox"),addActor:n((function(t){this.actors.push(t)}),"addActor"),addLoop:n((function(t){this.loops.push(t)}),"addLoop"),addMessage:n((function(t){this.messages.push(t)}),"addMessage"),addNote:n((function(t){this.notes.push(t)}),"addNote"),lastActor:n((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:n((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:n((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:n((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:n((function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Vt(g())}),"init"),updateVal:n((function(t,e,a,r){void 0===t[e]?t[e]=a:t[e]=r(a,t[e])}),"updateVal"),updateBounds:n((function(t,e,a,r){const s=this;let i=0;function o(o){return n((function(n){i++;var c=s.sequenceItems.length-i+1;s.updateVal(n,"starty",e-c*Nt.boxMargin,Math.min),s.updateVal(n,"stopy",r+c*Nt.boxMargin,Math.max),s.updateVal(At.data,"startx",t-c*Nt.boxMargin,Math.min),s.updateVal(At.data,"stopx",a+c*Nt.boxMargin,Math.max),"activation"!==o&&(s.updateVal(n,"startx",t-c*Nt.boxMargin,Math.min),s.updateVal(n,"stopx",a+c*Nt.boxMargin,Math.max),s.updateVal(At.data,"starty",e-c*Nt.boxMargin,Math.min),s.updateVal(At.data,"stopy",r+c*Nt.boxMargin,Math.max))}),"updateItemBounds")}n(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))}),"updateBounds"),insert:n((function(t,e,a,r){var s=E.getMin(t,a);t=E.getMax(t,a),a=E.getMin(e,r),e=E.getMax(e,r);this.updateVal(At.data,"startx",s,Math.min),this.updateVal(At.data,"starty",a,Math.min),this.updateVal(At.data,"stopx",t,Math.max),this.updateVal(At.data,"stopy",e,Math.max),this.updateBounds(s,a,t,e)}),"insert"),newActivation:n((function(t,e,a){a=a.get(t.from);var r=Ft(t.from).length||0;a=a.x+a.width/2+(r-1)*Nt.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Nt.activationWidth,stopy:void 0,actor:t.from,anchored:_t.anchorElement(e)})}),"newActivation"),endActivation:n((function(t){return t=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from),this.activations.splice(t,1)[0]}),"endActivation"),createLoop:n((function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}}),"createLoop"),newLoop:n((function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:n((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:n((function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap}),"isLoopOverlap"),addSectionToLoop:n((function(t){var e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:At.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:n((function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)}),"saveVerticalPos"),resetVerticalPos:n((function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)}),"resetVerticalPos"),bumpVerticalPos:n((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=E.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:n((function(){return this.verticalPos}),"getVerticalPos"),getBounds:n((function(){return{bounds:this.data,models:this.models}}),"getBounds")},Mt=n((async function(a,r){At.bumpVerticalPos(Nt.boxMargin),r.height=Nt.boxMargin,r.starty=At.getVerticalPos();var s=t(),i=(a=(s.x=r.startx,s.y=r.starty,s.width=r.width||Nt.width,s.class="note",a.append("g")),_t.drawRect(a,s)),n=(a=((n=e()).x=r.startx,n.y=r.starty,n.width=s.width,n.dy="1em",n.text=r.message,n.class="noteText",n.fontFamily=Nt.noteFontFamily,n.fontSize=Nt.noteFontSize,n.fontWeight=Nt.noteFontWeight,n.anchor=Nt.noteAlign,n.textMargin=Nt.noteMargin,n.valign="center",f(n.text)?await J(a,n):Q(a,n)),Math.round(a.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e))));i.attr("height",n+2*Nt.noteMargin),r.height+=n+2*Nt.noteMargin,At.bumpVerticalPos(n+2*Nt.noteMargin),r.stopy=r.starty+n+2*Nt.noteMargin,r.stopx=r.startx+s.width,At.insert(r.startx,r.starty,r.stopx,r.stopy),At.models.addNote(r)}),"drawNote"),Ot=n((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont"),St=n((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont"),Dt=n((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function Rt(t,e){At.bumpVerticalPos(10);var{startx:a,stopx:r,message:s}=e,i=E.splitBreaks(s).length,n=f(s),s=n?await w(s,g()):I.calculateTextDimensions(s,Ot(Nt));n||(n=s.height/i,e.height+=n,At.bumpVerticalPos(n));let o,c=s.height-10;return i=s.width,a===r?(o=At.getVerticalPos()+c,Nt.rightAngles||(c+=Nt.boxMargin,o=At.getVerticalPos()+c),c+=30,n=E.getMax(i/2,Nt.width/2),At.insert(a-n,At.getVerticalPos()-10+c,r+n,At.getVerticalPos()+30+c)):(c+=Nt.boxMargin,o=At.getVerticalPos()+c,At.insert(a,o-10,r,o)),At.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,At.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),o}n(Rt,"boundMessage");var Ct=n((async function(t,a,r,s){var{startx:a,stopx:i,starty:n,message:o,type:c,sequenceIndex:h,sequenceVisible:l}=a,d=I.calculateTextDimensions(o,Ot(Nt)),p=e(),n=(p.x=a,p.y=n+10,p.width=i-a,p.class="messageText",p.dy="1em",p.text=o,p.fontFamily=Nt.messageFontFamily,p.fontSize=Nt.messageFontSize,p.fontWeight=Nt.messageFontWeight,p.anchor=Nt.messageAlign,p.valign="center",p.textMargin=Nt.wrapPadding,p.tspan=!1,f(p.text)?await J(t,p,{startx:a,stopx:i,starty:r}):Q(t,p),d.width);let g,u=(a===i?g=Nt.rightAngles?t.append("path").attr("d",`M ${a},${r} H ${a+E.getMax(Nt.width/2,n/2)} V ${r+25} H `+a):t.append("path").attr("d","M "+a+","+r+" C "+(a+60)+","+(r-10)+" "+(a+60)+","+(r+30)+" "+a+","+(r+20)):((g=t.append("line")).attr("x1",a),g.attr("y1",r),g.attr("x2",i),g.attr("y2",r)),c===s.db.LINETYPE.DOTTED||c===s.db.LINETYPE.DOTTED_CROSS||c===s.db.LINETYPE.DOTTED_POINT||c===s.db.LINETYPE.DOTTED_OPEN||c===s.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0"),"");Nt.arrowMarkerAbsolute&&(u=_(!0)),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),c!==s.db.LINETYPE.SOLID&&c!==s.db.LINETYPE.DOTTED||g.attr("marker-end","url("+u+"#arrowhead)"),c!==s.db.LINETYPE.BIDIRECTIONAL_SOLID&&c!==s.db.LINETYPE.BIDIRECTIONAL_DOTTED||(g.attr("marker-start","url("+u+"#arrowhead)"),g.attr("marker-end","url("+u+"#arrowhead)")),c!==s.db.LINETYPE.SOLID_POINT&&c!==s.db.LINETYPE.DOTTED_POINT||g.attr("marker-end","url("+u+"#filled-head)"),c!==s.db.LINETYPE.SOLID_CROSS&&c!==s.db.LINETYPE.DOTTED_CROSS||g.attr("marker-end","url("+u+"#crosshead)"),(l||Nt.showSequenceNumbers)&&(c!==s.db.LINETYPE.BIDIRECTIONAL_SOLID&&c!==s.db.LINETYPE.BIDIRECTIONAL_DOTTED||(a<i?g.attr("x1",a+12):g.attr("x1",a+6)),t.append("line").attr("x1",a).attr("y1",r).attr("x2",a).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+u+"#sequencenumber)"),t.append("text").attr("x",a).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(h))}),"drawMessage"),$t=n((function(t,e,a,r,s,i,n){let o,c=0,h=0,l=0;for(const t of r){var d=e.get(t),p=d.box;o&&o!=p&&(n||At.models.addBox(o),h+=Nt.boxMargin+o.margin),p&&p!=o&&(n||(p.x=c+h,p.y=s),h+=p.margin),d.width=d.width||Nt.width,d.height=E.getMax(d.height||Nt.height,Nt.height),d.margin=d.margin||Nt.actorMargin,l=E.getMax(l,d.height),a.get(d.name)&&(h+=d.width/2),d.x=c+h,d.starty=At.getVerticalPos(),At.insert(d.x,s,d.x+d.width,d.height),c+=d.width+h,d.box&&(d.box.width=c+p.margin-d.box.x),h=d.margin,o=d.box,At.models.addActor(d)}o&&!n&&At.models.addBox(o),At.bumpVerticalPos(l)}),"addActorRenderingData"),Bt=n((async function(t,e,a,r){if(r){let r=0;At.bumpVerticalPos(2*Nt.boxMargin);for(const i of a){var s=((s=e.get(i)).stopy||(s.stopy=At.getVerticalPos()),await _t.drawActor(t,s,Nt,!0));r=E.getMax(r,s)}At.bumpVerticalPos(r+Nt.boxMargin)}else for(const r of a){var i=e.get(r);await _t.drawActor(t,i,Nt,!1)}}),"drawActors"),Yt=n((function(t,e,a,r){let s=0,i=0;for(const c of a){var n=e.get(c),o=Ut(n);(o=_t.drawPopup(t,n,o,Nt,Nt.forceMenus,r)).height>s&&(s=o.height),o.width+n.x>i&&(i=o.width+n.x)}return{maxHeight:s,maxWidth:i}}),"drawActorsPopup"),Vt=n((function(t){L(Nt,t),t.fontFamily&&(Nt.actorFontFamily=Nt.noteFontFamily=Nt.messageFontFamily=t.fontFamily),t.fontSize&&(Nt.actorFontSize=Nt.noteFontSize=Nt.messageFontSize=t.fontSize),t.fontWeight&&(Nt.actorFontWeight=Nt.noteFontWeight=Nt.messageFontWeight=t.fontWeight)}),"setConf"),Ft=n((function(t){return At.activations.filter((function(e){return e.actor===t}))}),"actorActivations"),Wt=n((function(t,e){return e=e.get(t),[(t=Ft(t)).reduce((function(t,e){return E.getMin(t,e.startx)}),e.x+e.width/2-1),t.reduce((function(t,e){return E.getMax(t,e.stopx)}),e.x+e.width/2+1)]}),"activationBounds");function qt(t,e,a,r,s){At.bumpVerticalPos(a);let i=r;e.id&&e.message&&t[e.id]&&(a=t[e.id].width,t=Ot(Nt),e.message=I.wrapLabel(`[${e.message}]`,a-2*Nt.wrapPadding,t),e.width=a,e.wrap=!0,a=I.calculateTextDimensions(e.message,t),i=r+(t=E.getMax(a.height,Nt.labelBoxHeight)),m.debug(t+" - "+e.message)),s(e),At.bumpVerticalPos(i)}function zt(t,e,a,r,s,i,o){function c(a,r){a.x<s.get(t.from).x?(At.insert(e.stopx-r,e.starty,e.startx,e.stopy+a.height/2+Nt.noteMargin),e.stopx=e.stopx+r):(At.insert(e.startx,e.starty,e.stopx+r,e.stopy+a.height/2+Nt.noteMargin),e.stopx=e.stopx-r)}function h(a,r){a.x<s.get(t.to).x?(At.insert(e.startx-r,e.starty,e.stopx,e.stopy+a.height/2+Nt.noteMargin),e.startx=e.startx+r):(At.insert(e.stopx,e.starty,e.startx+r,e.stopy+a.height/2+Nt.noteMargin),e.startx=e.startx-r)}n(c,"receiverAdjustment"),n(h,"senderAdjustment");var l=[Y,V,W,F];i.get(t.to)==r?(c(i=s.get(t.to),l.includes(i.type)?21:i.width/2+3),i.starty=a-i.height/2,At.bumpVerticalPos(i.height/2)):o.get(t.from)==r?(i=s.get(t.from),Nt.mirrorActors&&h(i,l.includes(i.type)?18:i.width/2),i.stopy=a-i.height/2,At.bumpVerticalPos(i.height/2)):o.get(t.to)==r&&(i=s.get(t.to),Nt.mirrorActors&&c(i,l.includes(i.type)?21:i.width/2+3),i.stopy=a-i.height/2,At.bumpVerticalPos(i.height/2))}n(qt,"adjustLoopHeightForWrap"),n(zt,"adjustCreatedDestroyedData");var Ht=n((async function(t,e,a,r){var{securityLevel:s,sequence:i}=g();let o;Nt=i,"sandbox"===s&&(o=v("#i"+e));i=v("sandbox"===s?o.nodes()[0].contentDocument.body:"body");var c="sandbox"===s?o.nodes()[0].contentDocument:document;At.init(),m.debug(r.db);const h="sandbox"===s?i.select(`[id="${e}"]`):v(`[id="${e}"]`);var l=r.db.getActors(),d=r.db.getCreatedActors(),p=r.db.getDestroyedActors(),s=r.db.getBoxes();let u=r.db.getActorKeys();var i=r.db.getMessages(),x=(e=r.db.getDiagramTitle(),r.db.hasAtLeastOneBox()),y=r.db.hasAtLeastOneBoxWithTitle(),b=await jt(l,i,r);if(Nt.height=await Gt(l,b,s),_t.insertComputerIcon(h),_t.insertDatabaseIcon(h),_t.insertClockIcon(h),x&&(At.bumpVerticalPos(Nt.boxMargin),y)&&At.bumpVerticalPos(s[0].textMaxHeight),!0===Nt.hideUnusedParticipants){const t=new Set;i.forEach((e=>{t.add(e.from),t.add(e.to)})),u=u.filter((e=>t.has(e)))}$t(h,l,d,u,0,i,!1);var T=await Zt(i,l,b,r);function E(t,e){var a=At.endActivation(t);a.starty+18>e&&(a.starty=e-6,e+=12),_t.drawActivation(h,a,e,Nt,Ft(t.from).length),At.insert(a.startx,e-10,a.stopx,e)}_t.insertArrowHead(h),_t.insertArrowCrossHead(h),_t.insertArrowFilledHead(h),_t.insertSequenceNumber(h),n(E,"activeEnd");let f=1,w=1;var I=[],L=[];let P=0;for(const e of i){let a,s,i;switch(e.type){case r.db.LINETYPE.NOTE:At.resetVerticalPos(),s=e.noteModel,await Mt(h,s);break;case r.db.LINETYPE.ACTIVE_START:At.newActivation(e,h,l);break;case r.db.LINETYPE.ACTIVE_END:E(e,At.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.LOOP_END:a=At.endLoop(),await _t.drawLoop(h,a,"loop",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.RECT_START:qt(T,e,Nt.boxMargin,Nt.boxMargin,(t=>At.newLoop(void 0,t.message)));break;case r.db.LINETYPE.RECT_END:a=At.endLoop(),L.push(a),At.models.addLoop(a),At.bumpVerticalPos(a.stopy-At.getVerticalPos());break;case r.db.LINETYPE.OPT_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.OPT_END:a=At.endLoop(),await _t.drawLoop(h,a,"opt",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.ALT_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.ALT_ELSE:qt(T,e,Nt.boxMargin+Nt.boxTextMargin,Nt.boxMargin,(t=>At.addSectionToLoop(t)));break;case r.db.LINETYPE.ALT_END:a=At.endLoop(),await _t.drawLoop(h,a,"alt",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t))),At.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:qt(T,e,Nt.boxMargin+Nt.boxTextMargin,Nt.boxMargin,(t=>At.addSectionToLoop(t)));break;case r.db.LINETYPE.PAR_END:a=At.endLoop(),await _t.drawLoop(h,a,"par",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.AUTONUMBER:f=e.message.start||f,w=e.message.step||w,e.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.CRITICAL_OPTION:qt(T,e,Nt.boxMargin+Nt.boxTextMargin,Nt.boxMargin,(t=>At.addSectionToLoop(t)));break;case r.db.LINETYPE.CRITICAL_END:a=At.endLoop(),await _t.drawLoop(h,a,"critical",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;case r.db.LINETYPE.BREAK_START:qt(T,e,Nt.boxMargin,Nt.boxMargin+Nt.boxTextMargin,(t=>At.newLoop(t)));break;case r.db.LINETYPE.BREAK_END:a=At.endLoop(),await _t.drawLoop(h,a,"break",Nt),At.bumpVerticalPos(a.stopy-At.getVerticalPos()),At.models.addLoop(a);break;default:try{(i=e.msgModel).starty=At.getVerticalPos(),i.sequenceIndex=f,i.sequenceVisible=r.db.showSequenceNumbers();var _=await Rt(0,i);zt(e,i,_,P,l,d,p),I.push({messageModel:i,lineStartY:_}),At.models.addMessage(i)}catch(t){m.error("error while drawing message",t)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(f+=w),P++}m.debug("createdActors",d),m.debug("destroyedActors",p),await Bt(h,l,u,!1);for(const t of I)await Ct(h,t.messageModel,t.lineStartY,r);Nt.mirrorActors&&await Bt(h,l,u,!0),L.forEach((t=>_t.drawBackgroundRect(h,t))),at(h,l,u,Nt);for(const t of At.models.boxes){t.height=At.getVerticalPos()-t.y,At.insert(t.x,t.y,t.x+t.width,t.height);var N=2*Nt.boxMargin;t.startx=t.x-N,t.starty=t.y-.25*N,t.stopx=t.startx+t.width+2*N,t.stopy=t.starty+t.height+.75*N,t.stroke="rgb(0,0,0, 0.5)",_t.drawBox(h,t,Nt)}x&&At.bumpVerticalPos(Nt.boxMargin),y=Yt(h,l,u,c),void 0===(s=At.getBounds().bounds).startx&&(s.startx=0),void 0===s.starty&&(s.starty=0),void 0===s.stopx&&(s.stopx=0),void 0===s.stopy&&(s.stopy=0);let A=s.stopy-s.starty,M=(A=A<y.maxHeight?y.maxHeight:A)+2*Nt.diagramMarginY,O=(Nt.mirrorActors&&(M=M-Nt.boxMargin+Nt.bottomMarginAdj),s.stopx-s.startx);b=(O=O<y.maxWidth?y.maxWidth:O)+2*Nt.diagramMarginX,e&&h.append("text").text(e).attr("x",(s.stopx-s.startx)/2-2*Nt.diagramMarginX).attr("y",-25),k(h,M,b,Nt.useMaxWidth),i=e?40:0,h.attr("viewBox",s.startx-Nt.diagramMarginX+" -"+(Nt.diagramMarginY+i)+" "+b+" "+(M+i)),m.debug("models:",At.models)}),"draw");async function jt(t,e,a){var r,s,i,n,o={};for(const c of e)t.get(c.to)&&t.get(c.from)&&(r=t.get(c.to),c.placement===a.db.PLACEMENT.LEFTOF&&!r.prevActor||c.placement===a.db.PLACEMENT.RIGHTOF&&!r.nextActor||(s=!(i=void 0!==c.placement),i=(i?St:Ot)(Nt),n=c.wrap?I.wrapLabel(c.message,Nt.width-2*Nt.wrapPadding,i):c.message,n=(f(n)?await w(c.message,g()):I.calculateTextDimensions(n,i)).width+2*Nt.wrapPadding,s&&c.from===r.nextActor?o[c.to]=E.getMax(o[c.to]||0,n):s&&c.from===r.prevActor?o[c.from]=E.getMax(o[c.from]||0,n):s&&c.from===c.to?(o[c.from]=E.getMax(o[c.from]||0,n/2),o[c.to]=E.getMax(o[c.to]||0,n/2)):c.placement===a.db.PLACEMENT.RIGHTOF?o[c.from]=E.getMax(o[c.from]||0,n):c.placement===a.db.PLACEMENT.LEFTOF?o[r.prevActor]=E.getMax(o[r.prevActor]||0,n):c.placement===a.db.PLACEMENT.OVER&&(r.prevActor&&(o[r.prevActor]=E.getMax(o[r.prevActor]||0,n/2)),r.nextActor)&&(o[c.from]=E.getMax(o[c.from]||0,n/2))));return m.debug("maxMessageWidthPerActor:",o),o}n(jt,"getMaxMessageWidthPerActor");var Ut=n((function(t){let e=0;var a=Dt(Nt);for(const s in t.links){var r=I.calculateTextDimensions(s,a).width+2*Nt.wrapPadding+2*Nt.boxMargin;e<r&&(e=r)}return e}),"getRequiredPopupWidth");async function Gt(t,e,a){let r=0;for(const e of t.keys()){var s=t.get(e),i=(s.wrap&&(s.description=I.wrapLabel(s.description,Nt.width-2*Nt.wrapPadding,Dt(Nt))),f(s.description)?await w(s.description,g()):I.calculateTextDimensions(s.description,Dt(Nt)));s.width=s.wrap?Nt.width:E.getMax(Nt.width,i.width+2*Nt.wrapPadding),s.height=s.wrap?E.getMax(i.height,Nt.height):Nt.height,r=E.getMax(r,s.height)}for(const a in e){var n,o=t.get(a);o&&((n=t.get(o.nextActor))?(n=e[a]+Nt.actorMargin-o.width/2-n.width/2,o.margin=E.getMax(n,Nt.actorMargin)):(n=e[a]+Nt.actorMargin-o.width/2,o.margin=E.getMax(n,Nt.actorMargin)))}let c=0;return a.forEach((e=>{var a=Ot(Nt),r=e.actorKeys.reduce(((e,a)=>e+(t.get(a).width+(t.get(a).margin||0))),0);r=r+8*Nt.boxMargin-2*Nt.boxTextMargin,e.wrap&&(e.name=I.wrapLabel(e.name,r-2*Nt.wrapPadding,a)),a=I.calculateTextDimensions(e.name,a),c=E.getMax(a.height,c),a=E.getMax(r,a.width+2*Nt.wrapPadding);e.margin=Nt.boxTextMargin,r<a&&(e.margin+=(a-r)/2)})),a.forEach((t=>t.textMaxHeight=c)),E.getMax(r,Nt.height)}n(Gt,"calculateActorMargins");var Kt=n((async function(t,e,a){var r=e.get(t.from),s=(e=e.get(t.to),r.x),i=e.x,n=t.wrap&&t.message,o=f(t.message)?await w(t.message,g()):I.calculateTextDimensions(n?I.wrapLabel(t.message,Nt.width,St(Nt)):t.message,St(Nt)),c={width:n?Nt.width:E.getMax(Nt.width,o.width+2*Nt.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===a.db.PLACEMENT.RIGHTOF?(c.width=n?E.getMax(Nt.width,o.width):E.getMax(r.width/2+e.width/2,o.width+2*Nt.noteMargin),c.startx=s+(r.width+Nt.actorMargin)/2):t.placement===a.db.PLACEMENT.LEFTOF?(c.width=n?E.getMax(Nt.width,o.width+2*Nt.noteMargin):E.getMax(r.width/2+e.width/2,o.width+2*Nt.noteMargin),c.startx=s-c.width+(r.width-Nt.actorMargin)/2):t.to===t.from?(o=I.calculateTextDimensions(n?I.wrapLabel(t.message,E.getMax(Nt.width,r.width),St(Nt)):t.message,St(Nt)),c.width=n?E.getMax(Nt.width,r.width):E.getMax(r.width,Nt.width,o.width+2*Nt.noteMargin),c.startx=s+(r.width-c.width)/2):(c.width=Math.abs(s+r.width/2-(i+e.width/2))+Nt.actorMargin,c.startx=s<i?s+r.width/2-Nt.actorMargin/2:i+e.width/2-Nt.actorMargin/2),n&&(c.message=I.wrapLabel(t.message,c.width-2*Nt.wrapPadding,St(Nt))),m.debug(`NM:[${c.startx},${c.stopx},${c.starty},${c.stopy}:${c.width},${c.height}=${t.message}]`),c}),"buildNoteModel"),Xt=n((function(t,e,a){if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};var[r,s]=Wt(t.from,e),[e,i]=Wt(t.to,e);const o=r<=e;let c=o?s:r,h=o?e:i;var l=2<Math.abs(e-i),d=n((t=>o?-t:t),"adjustValue");t.from===t.to?h=c:(t.activate&&!l&&(h+=d(Nt.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=d(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(c-=d(3))),l=[r,s,e,i],a=Math.abs(c-h),t.wrap&&t.message&&(t.message=I.wrapLabel(t.message,E.getMax(a+2*Nt.wrapPadding,Nt.width),Ot(Nt))),d=I.calculateTextDimensions(t.message,Ot(Nt));return{width:E.getMax(t.wrap?0:d.width+2*Nt.wrapPadding,a+2*Nt.wrapPadding,Nt.width),height:0,startx:c,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,l),toBounds:Math.max.apply(null,l)}}),"buildMessageModel"),Zt=n((async function(t,e,a,r){var s={},i=[];let n,o,c;for(const a of t){switch(a.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:i.push({id:a.id,msg:a.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:a.message&&(s[(n=i.pop()).id]=n,s[a.id]=n,i.push(n));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s[(n=i.pop()).id]=n;break;case r.db.LINETYPE.ACTIVE_START:var h=e.get(a.from||a.to.actor),l=Ft(a.from||a.to.actor).length;l={startx:h=h.x+h.width/2+(l-1)*Nt.activationWidth/2,stopx:h+Nt.activationWidth,actor:a.from,enabled:!0};At.activations.push(l);break;case r.db.LINETYPE.ACTIVE_END:h=At.activations.map((t=>t.actor)).lastIndexOf(a.from),At.activations.splice(h,1).splice(0,1)}void 0!==a.placement?(o=await Kt(a,e,r),a.noteModel=o,i.forEach((t=>{(n=t).from=E.getMin(n.from,o.startx),n.to=E.getMax(n.to,o.startx+o.width),n.width=E.getMax(n.width,Math.abs(n.from-n.to))-Nt.labelBoxWidth}))):(c=Xt(a,e,r),(a.msgModel=c).startx&&c.stopx&&0<i.length&&i.forEach((t=>{var r;n=t,c.startx===c.stopx?(t=e.get(a.from),r=e.get(a.to),n.from=E.getMin(t.x-c.width/2,t.x-t.width/2,n.from),n.to=E.getMax(r.x+c.width/2,r.x+t.width/2,n.to),n.width=E.getMax(n.width,Math.abs(n.to-n.from))-Nt.labelBoxWidth):(n.from=E.getMin(c.startx,n.from),n.to=E.getMax(c.stopx,n.to),n.width=E.getMax(n.width,c.width)-Nt.labelBoxWidth)})))}return At.activations=[],m.debug("Loop type widths:",s),s}),"calculateLoopBounds"),Jt={parser:R,get db(){return new q},renderer:{bounds:At,drawActors:Bt,drawActorsPopup:Yt,setConf:Vt,draw:Ht},styles:z,init:n((t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,T({sequence:{wrap:t.wrap}}))}),"init")};export{Jt as diagram};