agentic-diff 0.1.8 → 0.1.10

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 (80) hide show
  1. package/dist/THIRD-PARTY-LICENSES.txt +2476 -186
  2. package/dist/cli.js +359 -52
  3. package/dist/web/assets/{FileEditor-ySBcHrW6.js → FileEditor-C-89fTy9.js} +3 -3
  4. package/dist/web/assets/abnfDiagram-VCTEODGH-C49HvP8-.js +1 -0
  5. package/dist/web/assets/architecture-7GRP2DOG-CBx-Hahm.js +1 -0
  6. package/dist/web/assets/architectureDiagram-5GKGNRK7-Cz6oQJGV.js +36 -0
  7. package/dist/web/assets/blockDiagram-I7D4REHJ-DyavTEyC.js +129 -0
  8. package/dist/web/assets/c4Diagram-7LVT6UL2-C5YYMNh9.js +38 -0
  9. package/dist/web/assets/channel-BaeyAqOu.js +1 -0
  10. package/dist/web/assets/chunk-2Q5K7J3B-Cmy5RQpP.js +1 -0
  11. package/dist/web/assets/chunk-5VM5RSS4-Bl5su3lF.js +15 -0
  12. package/dist/web/assets/chunk-F27PBJKO-ClNflvco.js +1 -0
  13. package/dist/web/assets/chunk-IMKFNOWR-C-NKFJCn.js +231 -0
  14. package/dist/web/assets/chunk-JWPE2WC7-DL2sZ8xq.js +1 -0
  15. package/dist/web/assets/chunk-POPQ4Y6H-BBYxqD_7.js +1 -0
  16. package/dist/web/assets/chunk-SHT3W25Y-DqecC6IS.js +168 -0
  17. package/dist/web/assets/chunk-SVP7TREG-CykZJApb.js +88 -0
  18. package/dist/web/assets/chunk-TICWLB2K-tYRVcQZJ.js +206 -0
  19. package/dist/web/assets/chunk-XXDRQBXY-D1ybtwL8.js +1 -0
  20. package/dist/web/assets/classDiagram-ZZMXUADV-BfOlT7v5.js +1 -0
  21. package/dist/web/assets/classDiagram-v2-VYDZK3BY-BfOlT7v5.js +1 -0
  22. package/dist/web/assets/cose-bilkent-JH36ORCC-XcptgDNS.js +1 -0
  23. package/dist/web/assets/cynefin-OW5HDTMX-CrdM8CNN.js +1 -0
  24. package/dist/web/assets/cynefinDiagram-5FMLGOSQ-B2BjF2Np.js +62 -0
  25. package/dist/web/assets/cytoscape.esm-CFkBLF6F.js +321 -0
  26. package/dist/web/assets/d3-scale-okpWUcMn.js +1 -0
  27. package/dist/web/assets/dagre-CHqJHIuQ.js +1 -0
  28. package/dist/web/assets/dagre-GXQ25YYZ-BVwOMWlS.js +4 -0
  29. package/dist/web/assets/diagram-S7CK7UJ4-BbgOrdTP.js +30 -0
  30. package/dist/web/assets/diagram-UQ7AKVKN-dmEGfy18.js +41 -0
  31. package/dist/web/assets/diagram-VSXAHHWV-C1AAi9ds.js +3 -0
  32. package/dist/web/assets/diagram-VX7I27RA-CXE3jVhR.js +24 -0
  33. package/dist/web/assets/diagram-Z3DM3KII-CJmAyH70.js +24 -0
  34. package/dist/web/assets/ebnfDiagram-PWID7BFC-BfTsv3U-.js +1 -0
  35. package/dist/web/assets/erDiagram-RLTQ6QDP-DTCj-KOY.js +99 -0
  36. package/dist/web/assets/eventmodeling-NTZA5JFV-Bl6oaFeK.js +1 -0
  37. package/dist/web/assets/flowDiagram-HODETNUW-CFEMKVwu.js +1 -0
  38. package/dist/web/assets/ganttDiagram-EL5Y4UJY-DyGkH9mL.js +292 -0
  39. package/dist/web/assets/gitGraph-4MIJSDKK-B9_GxpLb.js +1 -0
  40. package/dist/web/assets/gitGraphDiagram-WWUBYQGX-B1D08k6k.js +106 -0
  41. package/dist/web/assets/{index-BsLHBrFu.css → index-CWSKyE-r.css} +1 -1
  42. package/dist/web/assets/index-DZKge1Ex.js +63 -0
  43. package/dist/web/assets/info-A6RAGUB7-JX_tOlLA.js +1 -0
  44. package/dist/web/assets/infoDiagram-27XIBGKW-Bf0m1pFs.js +2 -0
  45. package/dist/web/assets/ishikawaDiagram-5VMMS53U-BVrp2sns.js +70 -0
  46. package/dist/web/assets/journeyDiagram-3NMN7TZE-hOGZiS97.js +139 -0
  47. package/dist/web/assets/kanban-definition-UXKFOSKX-DS-3wdxe.js +89 -0
  48. package/dist/web/assets/katex-BreMo9lq.js +257 -0
  49. package/dist/web/assets/mermaid-parser.core-BX15ctWm.js +166 -0
  50. package/dist/web/assets/mermaid.core-DTGmDhfV.js +312 -0
  51. package/dist/web/assets/mindmap-definition-YA3MSWOX-6LNGKzRE.js +96 -0
  52. package/dist/web/assets/packet-AYTQ26CC-7xVJxDG1.js +1 -0
  53. package/dist/web/assets/pegDiagram-XKGWAZYB-DtH9gLh9.js +1 -0
  54. package/dist/web/assets/pie-WAS4IAKB-Bw4FZEO0.js +1 -0
  55. package/dist/web/assets/pieDiagram-E7YTZNPT-m4yruZNh.js +39 -0
  56. package/dist/web/assets/quadrantDiagram-AXDQQJYC-y4L1cf7l.js +7 -0
  57. package/dist/web/assets/radar-RG4KPBEZ-BW371lik.js +1 -0
  58. package/dist/web/assets/railroad-74A4TZTK-BgXIJFVf.js +1 -0
  59. package/dist/web/assets/railroad-abnf-HS5TGJTU-DnsEfmjU.js +1 -0
  60. package/dist/web/assets/railroad-ebnf-LZEXJU2U-CRCK52WR.js +1 -0
  61. package/dist/web/assets/railroad-peg-WCYAUIDC-D5HgIhmP.js +1 -0
  62. package/dist/web/assets/railroadDiagram-O6MQD6OU-BxEd5py5.js +1 -0
  63. package/dist/web/assets/requirementDiagram-BXWQKSXE-CwJ0sNiM.js +84 -0
  64. package/dist/web/assets/sankeyDiagram-P5KCCOFB-Da85_fPb.js +40 -0
  65. package/dist/web/assets/sequenceDiagram-WJ2MYXX4-CW_G65sH.js +162 -0
  66. package/dist/web/assets/sizeCapture-INFHLROL-2x3la0Bj.js +1 -0
  67. package/dist/web/assets/stateDiagram-D77RDMKH-CqdLpUep.js +1 -0
  68. package/dist/web/assets/stateDiagram-v2-MP3YSRHH-CZng7GId.js +1 -0
  69. package/dist/web/assets/swimlanes-42K2YHIH-DMh0NoSR.js +1 -0
  70. package/dist/web/assets/swimlanesDiagram-VR7AAH4N-CKaOPN8U.js +8 -0
  71. package/dist/web/assets/timeline-definition-24CTP7MA-DLGi-xy-.js +120 -0
  72. package/dist/web/assets/treeView-Q6P3EWNA-Cze9-s5B.js +1 -0
  73. package/dist/web/assets/treemap-WGGIJYW6-BZ9A7GPw.js +1 -0
  74. package/dist/web/assets/vennDiagram-4TSXK5OY-spL-BBOp.js +34 -0
  75. package/dist/web/assets/wardley-WFR3VGLG-DSwp5vCl.js +1 -0
  76. package/dist/web/assets/wardleyDiagram-VM6X3IG4-ubLr3NNH.js +78 -0
  77. package/dist/web/assets/xychartDiagram-S5SC5T6Z-CJnigrLu.js +7 -0
  78. package/dist/web/index.html +2 -2
  79. package/package.json +1 -1
  80. package/dist/web/assets/index-2aup9CVk.js +0 -62
@@ -0,0 +1 @@
1
+ function e(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function t(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function n(n){let i,a,o;n.length===2?(i=n===e||n===t?n:r,a=n,o=n):(i=e,a=(t,r)=>e(n(t),r),o=(e,t)=>n(e)-t);function s(e,t,n=0,r=e.length){if(n<r){if(i(t,t)!==0)return r;do{let i=n+r>>>1;a(e[i],t)<0?n=i+1:r=i}while(n<r)}return n}function c(e,t,n=0,r=e.length){if(n<r){if(i(t,t)!==0)return r;do{let i=n+r>>>1;a(e[i],t)<=0?n=i+1:r=i}while(n<r)}return n}function l(e,t,n=0,r=e.length){let i=s(e,t,n,r-1);return i>n&&o(e[i-1],t)>-o(e[i],t)?i-1:i}return{left:s,center:l,right:c}}function r(){return 0}function i(e){return e===null?NaN:+e}var a=n(e),o=a.right;a.left,n(i).center;var s=class extends Map{constructor(e,t=d){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(c(this,e))}has(e){return super.has(c(this,e))}set(e,t){return super.set(l(this,e),t)}delete(e){return super.delete(u(this,e))}};function c({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function l({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function u({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function d(e){return typeof e==`object`&&e?e.valueOf():e}Array.prototype.slice;var f=Math.sqrt(50),p=Math.sqrt(10),m=Math.sqrt(2);function h(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=f?10:a>=p?5:a>=m?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?h(e,t,n*2):[s,c,l]}function g(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?h(t,e,n):h(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function _(e,t,n){return t=+t,e=+e,n=+n,h(e,t,n)[2]}function v(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?_(t,e,n):_(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function y(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function b(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ee(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function x(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function S(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function C(){}var w=.7,T=1/w,E=`\\s*([+-]?\\d+)\\s*`,D=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,O=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,te=/^#([0-9a-f]{3,8})$/,ne=RegExp(`^rgb\\(${E},${E},${E}\\)$`),re=RegExp(`^rgb\\(${O},${O},${O}\\)$`),ie=RegExp(`^rgba\\(${E},${E},${E},${D}\\)$`),ae=RegExp(`^rgba\\(${O},${O},${O},${D}\\)$`),oe=RegExp(`^hsl\\(${D},${O},${O}\\)$`),se=RegExp(`^hsla\\(${D},${O},${O},${D}\\)$`),ce={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};x(C,k,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:le,formatHex:le,formatHex8:ue,formatHsl:de,formatRgb:fe,toString:fe});function le(){return this.rgb().formatHex()}function ue(){return this.rgb().formatHex8()}function de(){return Se(this).formatHsl()}function fe(){return this.rgb().formatRgb()}function k(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=te.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?pe(t):n===3?new A(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?me(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?me(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ne.exec(e))?new A(t[1],t[2],t[3],1):(t=re.exec(e))?new A(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ie.exec(e))?me(t[1],t[2],t[3],t[4]):(t=ae.exec(e))?me(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oe.exec(e))?xe(t[1],t[2]/100,t[3]/100,1):(t=se.exec(e))?xe(t[1],t[2]/100,t[3]/100,t[4]):ce.hasOwnProperty(e)?pe(ce[e]):e===`transparent`?new A(NaN,NaN,NaN,0):null}function pe(e){return new A(e>>16&255,e>>8&255,e&255,1)}function me(e,t,n,r){return r<=0&&(e=t=n=NaN),new A(e,t,n,r)}function he(e){return e instanceof C||(e=k(e)),e?(e=e.rgb(),new A(e.r,e.g,e.b,e.opacity)):new A}function ge(e,t,n,r){return arguments.length===1?he(e):new A(e,t,n,r??1)}function A(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}x(A,ge,S(C,{brighter(e){return e=e==null?T:T**+e,new A(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?w:w**+e,new A(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new A(j(this.r),j(this.g),j(this.b),be(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_e,formatHex:_e,formatHex8:ve,formatRgb:ye,toString:ye}));function _e(){return`#${M(this.r)}${M(this.g)}${M(this.b)}`}function ve(){return`#${M(this.r)}${M(this.g)}${M(this.b)}${M((isNaN(this.opacity)?1:this.opacity)*255)}`}function ye(){let e=be(this.opacity);return`${e===1?`rgb(`:`rgba(`}${j(this.r)}, ${j(this.g)}, ${j(this.b)}${e===1?`)`:`, ${e})`}`}function be(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function j(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function M(e){return e=j(e),(e<16?`0`:``)+e.toString(16)}function xe(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new N(e,t,n,r)}function Se(e){if(e instanceof N)return new N(e.h,e.s,e.l,e.opacity);if(e instanceof C||(e=k(e)),!e)return new N;if(e instanceof N)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new N(o,s,c,e.opacity)}function Ce(e,t,n,r){return arguments.length===1?Se(e):new N(e,t,n,r??1)}function N(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}x(N,Ce,S(C,{brighter(e){return e=e==null?T:T**+e,new N(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?w:w**+e,new N(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new A(Ee(e>=240?e-240:e+120,i,r),Ee(e,i,r),Ee(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new N(we(this.h),Te(this.s),Te(this.l),be(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=be(this.opacity);return`${e===1?`hsl(`:`hsla(`}${we(this.h)}, ${Te(this.s)*100}%, ${Te(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function we(e){return e=(e||0)%360,e<0?e+360:e}function Te(e){return Math.max(0,Math.min(1,e||0))}function Ee(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var De=Math.PI/180,Oe=180/Math.PI,ke=18,Ae=.96422,je=1,Me=.82521,Ne=4/29,P=6/29,Pe=3*P*P,Fe=P*P*P;function Ie(e){if(e instanceof F)return new F(e.l,e.a,e.b,e.opacity);if(e instanceof I)return We(e);e instanceof A||(e=he(e));var t=Ve(e.r),n=Ve(e.g),r=Ve(e.b),i=Re((.2225045*t+.7168786*n+.0606169*r)/je),a,o;return t===n&&n===r?a=o=i:(a=Re((.4360747*t+.3850649*n+.1430804*r)/Ae),o=Re((.0139322*t+.0971045*n+.7141733*r)/Me)),new F(116*i-16,500*(a-i),200*(i-o),e.opacity)}function Le(e,t,n,r){return arguments.length===1?Ie(e):new F(e,t,n,r??1)}function F(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}x(F,Le,S(C,{brighter(e){return new F(this.l+ke*(e??1),this.a,this.b,this.opacity)},darker(e){return new F(this.l-ke*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Ae*ze(t),e=je*ze(e),n=Me*ze(n),new A(Be(3.1338561*t-1.6168667*e-.4906146*n),Be(-.9787684*t+1.9161415*e+.033454*n),Be(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Re(e){return e>Fe?e**(1/3):e/Pe+Ne}function ze(e){return e>P?e*e*e:Pe*(e-Ne)}function Be(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function Ve(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function He(e){if(e instanceof I)return new I(e.h,e.c,e.l,e.opacity);if(e instanceof F||(e=Ie(e)),e.a===0&&e.b===0)return new I(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Oe;return new I(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Ue(e,t,n,r){return arguments.length===1?He(e):new I(e,t,n,r??1)}function I(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function We(e){if(isNaN(e.h))return new F(e.l,0,0,e.opacity);var t=e.h*De;return new F(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}x(I,Ue,S(C,{brighter(e){return new I(this.h,this.c,this.l+ke*(e??1),this.opacity)},darker(e){return new I(this.h,this.c,this.l-ke*(e??1),this.opacity)},rgb(){return We(this).rgb()}}));var Ge=-.14861,Ke=1.78277,qe=-.29227,Je=-.90649,Ye=1.97294,Xe=Ye*Je,Ze=Ye*Ke,Qe=Ke*qe-Je*Ge;function $e(e){if(e instanceof L)return new L(e.h,e.s,e.l,e.opacity);e instanceof A||(e=he(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Qe*r+Xe*t-Ze*n)/(Qe+Xe-Ze),a=r-i,o=(Ye*(n-i)-qe*a)/Je,s=Math.sqrt(o*o+a*a)/(Ye*i*(1-i)),c=s?Math.atan2(o,a)*Oe-120:NaN;return new L(c<0?c+360:c,s,i,e.opacity)}function et(e,t,n,r){return arguments.length===1?$e(e):new L(e,t,n,r??1)}function L(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}x(L,et,S(C,{brighter(e){return e=e==null?T:T**+e,new L(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?w:w**+e,new L(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*De,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new A(255*(t+n*(Ge*r+Ke*i)),255*(t+n*(qe*r+Je*i)),255*(t+Ye*r*n),this.opacity)}}));function tt(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function nt(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r<t-1?e[r+2]:2*a-i;return tt((n-r/t)*t,o,i,a,s)}}var rt=e=>()=>e;function it(e,t){return function(n){return e+n*t}}function at(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function ot(e,t){var n=t-e;return n?it(e,n>180||n<-180?n-360*Math.round(n/360):n):rt(isNaN(e)?t:e)}function st(e){return(e=+e)==1?R:function(t,n){return n-t?at(t,n,e):rt(isNaN(t)?n:t)}}function R(e,t){var n=t-e;return n?it(e,n):rt(isNaN(e)?t:e)}var ct=(function e(t){var n=st(t);function r(e,t){var r=n((e=ge(e)).r,(t=ge(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=R(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function lt(e){return function(t){for(var n=t.length,r=Array(n),i=Array(n),a=Array(n),o=0,s;o<n;++o)s=ge(t[o]),r[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return r=e(r),i=e(i),a=e(a),s.opacity=1,function(e){return s.r=r(e),s.g=i(e),s.b=a(e),s+``}}}var ut=lt(nt);function dt(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function ft(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pt(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=St(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function mt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ht(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gt(e,t){var n={},r={},i;for(i in typeof e==`object`&&e||(e={}),typeof t==`object`&&t||(t={}),t)i in e?n[i]=St(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var _t=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vt=new RegExp(_t.source,`g`);function yt(e){return function(){return e}}function bt(e){return function(t){return e(t)+``}}function xt(e,t){var n=_t.lastIndex=vt.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=_t.exec(e))&&(i=vt.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ht(r,i)})),n=vt.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?bt(c[0].x):yt(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function St(e,t){var n=typeof t,r;return t==null||n===`boolean`?rt(t):(n===`number`?ht:n===`string`?(r=k(t))?(t=r,ct):xt:t instanceof k?ct:t instanceof Date?mt:ft(t)?dt:Array.isArray(t)?pt:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?gt:ht)(e,t)}function Ct(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var wt=1e-12;function Tt(e){return((e=Math.exp(e))+1/e)/2}function Et(e){return((e=Math.exp(e))-1/e)/2}function Dt(e){return((e=Math.exp(2*e))-1)/(e+1)}(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<wt)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Tt(y),c=s/(n*g)*(i*Dt(t*r+y)-Et(y));return[a+c*d,o+c*f,s*i/Tt(t*r+y)]}}return m.duration=Math.abs(h)*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4);function Ot(e){return function(t,n){var r=e((t=Ue(t)).h,(n=Ue(n)).h),i=R(t.c,n.c),a=R(t.l,n.l),o=R(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var kt=Ot(ot);function At(e){return(function t(n){n=+n;function r(t,r){var i=e((t=et(t)).h,(r=et(r)).h),a=R(t.s,r.s),o=R(t.l,r.l),s=R(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}At(ot);var jt=At(R);function Mt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function Nt(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function z(e){return e=Nt(Math.abs(e)),e?e[1]:NaN}function Pt(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Ft(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var It=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lt(e){if(!(t=It.exec(e)))throw Error(`invalid format: `+e);var t;return new Rt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Lt.prototype=Rt.prototype;function Rt(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Rt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function zt(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var Bt;function Vt(e,t){var n=Nt(e,t);if(!n)return Bt=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Bt=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+Nt(e,Math.max(0,t+a-1))[0]}function Ht(e,t){var n=Nt(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Ut={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Mt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Ht(e*100,t),r:Ht,s:Vt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Wt(e){return e}var Gt=Array.prototype.map,Kt=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function qt(e){var t=e.grouping===void 0||e.thousands===void 0?Wt:Pt(Gt.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?Wt:Ft(Gt.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=Lt(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Ut[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),ee=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),x=Ut[y],S=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function C(e){var n=b,r=ee,o,l,p;if(y===`c`)r=x(e)+r,e=``;else{e=+e;var C=e<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),_),v&&(e=zt(e)),C&&+e==0&&f!==`+`&&(C=!1),n=(C?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&Bt!==void 0?Kt[8+Bt/3]:``)+r+(C&&f===`(`?`)`:``),S){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var w=n.length+e.length+r.length,T=w<h?Array(h-w+1).join(u):``;switch(g&&m&&(e=t(T+e,T.length?h-r.length:1/0),T=``),d){case`<`:e=n+e+r+T;break;case`=`:e=n+T+e+r;break;case`^`:e=T.slice(0,w=T.length>>1)+n+e+r+T.slice(w);break;default:e=T+n+e+r}return a(e)}return C.toString=function(){return e+``},C}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(z(t)/3)))*3,r=10**-n,i=l((e=Lt(e),e.type=`f`,e),{suffix:Kt[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Jt,Yt,Xt;Zt({thousands:`,`,grouping:[3],currency:[`$`,``]});function Zt(e){return Jt=qt(e),Yt=Jt.format,Xt=Jt.formatPrefix,Jt}function Qt(e){return Math.max(0,-z(Math.abs(e)))}function $t(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(z(t)/3)))*3-z(Math.abs(e)))}function en(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,z(t)-z(e))+1}var tn=new Date,nn=new Date;function B(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>B(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(tn.setTime(+t),nn.setTime(+r),e(tn),e(nn),Math.floor(n(tn,nn))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var rn=B(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rn.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?B(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rn),rn.range;var V=1e3,H=V*60,U=H*60,W=U*24,an=W*7,on=W*30,sn=W*365,G=B(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*V)},(e,t)=>(t-e)/V,e=>e.getUTCSeconds());G.range;var cn=B(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*V)},(e,t)=>{e.setTime(+e+t*H)},(e,t)=>(t-e)/H,e=>e.getMinutes());cn.range;var ln=B(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*H)},(e,t)=>(t-e)/H,e=>e.getUTCMinutes());ln.range;var un=B(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*V-e.getMinutes()*H)},(e,t)=>{e.setTime(+e+t*U)},(e,t)=>(t-e)/U,e=>e.getHours());un.range;var dn=B(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*U)},(e,t)=>(t-e)/U,e=>e.getUTCHours());dn.range;var K=B(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*H)/W,e=>e.getDate()-1);K.range;var fn=B(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/W,e=>e.getUTCDate()-1);fn.range;var pn=B(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/W,e=>Math.floor(e/W));pn.range;function q(e){return B(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*H)/an)}var mn=q(0),hn=q(1),gn=q(2),_n=q(3),J=q(4),vn=q(5),yn=q(6);mn.range,hn.range,gn.range,_n.range,J.range,vn.range,yn.range;function Y(e){return B(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/an)}var bn=Y(0),xn=Y(1),Sn=Y(2),Cn=Y(3),wn=Y(4),Tn=Y(5),En=Y(6);bn.range,xn.range,Sn.range,Cn.range,wn.range,Tn.range,En.range;var Dn=B(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Dn.range;var On=B(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());On.range;var X=B(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());X.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:B(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),X.range;var Z=B(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Z.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:B(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Z.range;function kn(e,t,r,i,a,o){let s=[[G,1,V],[G,5,5*V],[G,15,15*V],[G,30,30*V],[o,1,H],[o,5,5*H],[o,15,15*H],[o,30,30*H],[a,1,U],[a,3,3*U],[a,6,6*U],[a,12,12*U],[i,1,W],[i,2,2*W],[r,1,an],[t,1,on],[t,3,3*on],[e,1,sn]];function c(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:l(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function l(t,r,i){let a=Math.abs(r-t)/i,o=n(([,,e])=>e).right(s,a);if(o===s.length)return e.every(v(t/sn,r/sn,i));if(o===0)return rn.every(Math.max(v(t,r,i),1));let[c,l]=s[a/s[o-1][2]<s[o][2]/a?o-1:o];return c.every(l)}return[c,l]}var[An,jn]=kn(Z,On,bn,pn,dn,ln),[Mn,Nn]=kn(X,Dn,mn,K,un,cn);function Pn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Fn(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function In(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ln(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Hn(i),u=Un(i),d=Hn(a),f=Un(a),p=Hn(o),m=Un(o),h=Hn(s),g=Un(s),_=Hn(c),v=Un(c),y={a:ie,A:ae,b:oe,B:se,c:null,d:ur,e:ur,f:hr,g:Er,G:Or,H:dr,I:fr,j:pr,L:mr,m:gr,M:_r,p:ce,q:le,Q:Zr,s:Qr,S:vr,u:yr,U:br,V:Sr,w:Cr,W:wr,x:null,X:null,y:Tr,Y:Dr,Z:kr,"%":Xr},b={a:ue,A:de,b:fe,B:k,c:null,d:Ar,e:Ar,f:Fr,g:Kr,G:Jr,H:jr,I:Mr,j:Nr,L:Pr,m:Ir,M:Lr,p:pe,q:me,Q:Zr,s:Qr,S:Rr,u:zr,U:Br,V:Hr,w:Ur,W:Wr,x:null,X:null,y:Gr,Y:qr,Z:Yr,"%":Xr},ee={a:T,A:E,b:D,B:O,c:te,d:er,e:er,f:or,g:Xn,G:Yn,H:nr,I:nr,j:tr,L:ar,m:$n,M:rr,p:w,q:Qn,Q:cr,s:lr,S:ir,u:Gn,U:Kn,V:qn,w:Wn,W:Jn,x:ne,X:re,y:Xn,Y:Yn,Z:Zn,"%":sr};y.x=x(n,y),y.X=x(r,y),y.c=x(t,y),b.x=x(n,b),b.X=x(r,b),b.c=x(t,b);function x(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=Rn[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function S(e,t){return function(n){var r=In(1900,void 0,1),i=C(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=Fn(In(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?xn.ceil(a):xn(a),a=fn.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Pn(In(r.y,0,1)),o=a.getDay(),a=o>4||o===0?hn.ceil(a):hn(a),a=K.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Fn(In(r.y,0,1)).getUTCDay():Pn(In(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Fn(r)):Pn(r)}}function C(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=ee[s in Rn?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function w(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function T(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function te(e,n,r){return C(e,t,n,r)}function ne(e,t,r){return C(e,n,t,r)}function re(e,t,n){return C(e,r,t,n)}function ie(e){return o[e.getDay()]}function ae(e){return a[e.getDay()]}function oe(e){return c[e.getMonth()]}function se(e){return s[e.getMonth()]}function ce(e){return i[+(e.getHours()>=12)]}function le(e){return 1+~~(e.getMonth()/3)}function ue(e){return o[e.getUTCDay()]}function de(e){return a[e.getUTCDay()]}function fe(e){return c[e.getUTCMonth()]}function k(e){return s[e.getUTCMonth()]}function pe(e){return i[+(e.getUTCHours()>=12)]}function me(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=x(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=S(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=x(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+=``,!0);return t.toString=function(){return e},t}}}var Rn={"-":``,_:` `,0:`0`},Q=/^\s*\d+/,zn=/^%/,Bn=/[\\^$*+?|[\]().{}]/g;function $(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function Vn(e){return e.replace(Bn,`\\$&`)}function Hn(e){return RegExp(`^(?:`+e.map(Vn).join(`|`)+`)`,`i`)}function Un(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Wn(e,t,n){var r=Q.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Gn(e,t,n){var r=Q.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Kn(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function qn(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Jn(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Yn(e,t,n){var r=Q.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Xn(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Zn(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Qn(e,t,n){var r=Q.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function $n(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function er(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function tr(e,t,n){var r=Q.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function nr(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function rr(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ir(e,t,n){var r=Q.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ar(e,t,n){var r=Q.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function or(e,t,n){var r=Q.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function sr(e,t,n){var r=zn.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function cr(e,t,n){var r=Q.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function lr(e,t,n){var r=Q.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ur(e,t){return $(e.getDate(),t,2)}function dr(e,t){return $(e.getHours(),t,2)}function fr(e,t){return $(e.getHours()%12||12,t,2)}function pr(e,t){return $(1+K.count(X(e),e),t,3)}function mr(e,t){return $(e.getMilliseconds(),t,3)}function hr(e,t){return mr(e,t)+`000`}function gr(e,t){return $(e.getMonth()+1,t,2)}function _r(e,t){return $(e.getMinutes(),t,2)}function vr(e,t){return $(e.getSeconds(),t,2)}function yr(e){var t=e.getDay();return t===0?7:t}function br(e,t){return $(mn.count(X(e)-1,e),t,2)}function xr(e){var t=e.getDay();return t>=4||t===0?J(e):J.ceil(e)}function Sr(e,t){return e=xr(e),$(J.count(X(e),e)+(X(e).getDay()===4),t,2)}function Cr(e){return e.getDay()}function wr(e,t){return $(hn.count(X(e)-1,e),t,2)}function Tr(e,t){return $(e.getFullYear()%100,t,2)}function Er(e,t){return e=xr(e),$(e.getFullYear()%100,t,2)}function Dr(e,t){return $(e.getFullYear()%1e4,t,4)}function Or(e,t){var n=e.getDay();return e=n>=4||n===0?J(e):J.ceil(e),$(e.getFullYear()%1e4,t,4)}function kr(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+$(t/60|0,`0`,2)+$(t%60,`0`,2)}function Ar(e,t){return $(e.getUTCDate(),t,2)}function jr(e,t){return $(e.getUTCHours(),t,2)}function Mr(e,t){return $(e.getUTCHours()%12||12,t,2)}function Nr(e,t){return $(1+fn.count(Z(e),e),t,3)}function Pr(e,t){return $(e.getUTCMilliseconds(),t,3)}function Fr(e,t){return Pr(e,t)+`000`}function Ir(e,t){return $(e.getUTCMonth()+1,t,2)}function Lr(e,t){return $(e.getUTCMinutes(),t,2)}function Rr(e,t){return $(e.getUTCSeconds(),t,2)}function zr(e){var t=e.getUTCDay();return t===0?7:t}function Br(e,t){return $(bn.count(Z(e)-1,e),t,2)}function Vr(e){var t=e.getUTCDay();return t>=4||t===0?wn(e):wn.ceil(e)}function Hr(e,t){return e=Vr(e),$(wn.count(Z(e),e)+(Z(e).getUTCDay()===4),t,2)}function Ur(e){return e.getUTCDay()}function Wr(e,t){return $(xn.count(Z(e)-1,e),t,2)}function Gr(e,t){return $(e.getUTCFullYear()%100,t,2)}function Kr(e,t){return e=Vr(e),$(e.getUTCFullYear()%100,t,2)}function qr(e,t){return $(e.getUTCFullYear()%1e4,t,4)}function Jr(e,t){var n=e.getUTCDay();return e=n>=4||n===0?wn(e):wn.ceil(e),$(e.getUTCFullYear()%1e4,t,4)}function Yr(){return`+0000`}function Xr(){return`%`}function Zr(e){return+e}function Qr(e){return Math.floor(e/1e3)}var $r,ei,ti,ni;ri({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function ri(e){return $r=Ln(e),ei=$r.format,$r.parse,ti=$r.utcFormat,ni=$r.utcParse,$r}var ii=`%Y-%m-%dT%H:%M:%S.%LZ`;Date.prototype.toISOString||ti(ii),+new Date(`2000-01-01T00:00:00.000Z`)||ni(ii);function ai(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var oi=Symbol(`implicit`);function si(){var e=new s,t=[],n=[],r=oi;function i(i){let a=e.get(i);if(a===void 0){if(r!==oi)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new s;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return si(t,n).unknown(r)},ai.apply(i,arguments),i}function ci(){var e=si().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=ee(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return ci(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},ai.apply(d(),arguments)}function li(e){return function(){return e}}function ui(e){return+e}var di=[0,1];function fi(e){return e}function pi(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:li(isNaN(t)?NaN:.5)}function mi(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function hi(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=pi(i,r),a=n(o,a)):(r=pi(r,i),a=n(a,o)),function(e){return a(r(e))}}function gi(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=pi(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(t){var n=o(e,t,1,r)-1;return a[n](i[n](t))}}function _i(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function vi(){var e=di,t=di,n=St,r,i,a,o=fi,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==fi&&(o=mi(e[0],e[n-1])),s=n>2?gi:hi,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),ht))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,ui),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Ct,u()},d.clamp=function(e){return arguments.length?(o=e?!0:fi,u()):o!==fi},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function yi(){return vi()(fi,fi)}function bi(e,t,n,r){var i=v(e,t,n),a;switch(r=Lt(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=$t(i,o))&&(r.precision=a),Xt(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=en(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Qt(i))&&(r.precision=a-(r.type===`%`)*2)}return Yt(r)}function xi(e){var t=e.domain;return e.ticks=function(e){var n=t();return g(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return bi(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=_(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Si(){var e=yi();return e.copy=function(){return _i(e,Si())},ai.apply(e,arguments),xi(e)}function Ci(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function wi(e){return new Date(e)}function Ti(e){return e instanceof Date?+e:Math.round(e)}function Ei(e,t,n,r,i,a,o,s,c,l){var u=yi(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function ee(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(Math.round(d(e)))},u.domain=function(e){return arguments.length?f(Array.from(e,Ti)):f().map(wi)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?ee:l(t)},u.nice=function(e){var n=f();return e&&typeof e.range==`function`||(e=t(n[0],n[n.length-1],e??10)),e?f(Ci(n,e)):u},u.copy=function(){return _i(u,Ei(e,t,n,r,i,a,o,s,c,l))},u}function Di(){return ai.apply(Ei(Mn,Nn,X,Dn,mn,K,un,cn,G,ei).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{et as C,b as E,ut as S,y as T,gn as _,ei as a,jt as b,K as c,cn as d,hn as f,J as g,mn as h,Di as i,vn as l,yn as m,Si as n,rn as o,Dn as p,si as r,G as s,ci as t,un as u,_n as v,ge as w,kt as x,Yt as y};
@@ -0,0 +1 @@
1
+ import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as ee,S as te,T as ne,U as re,V as ie,W as ae,X as oe,Y as se,Z as v,_ as y,at as ce,b as le,ct as ue,dt as b,et as x,ft as S,g as C,gt as de,h as w,ht as fe,it as pe,j as me,k as T,lt as E,m as D,mt as he,nt as ge,ot as _e,p as O,pt as k,q as ve,rt as ye,st as be,tt as xe,ut as A,v as j,w as M,x as Se,y as Ce,z as we}from"./mermaid.core-DTGmDhfV.js";var Te=/\s/;function Ee(e){for(var t=e.length;t--&&Te.test(e.charAt(t)););return t}var De=/^\s+/;function Oe(e){return e&&e.slice(0,Ee(e)+1).replace(De,``)}var ke=NaN,Ae=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,Me=/^0o[0-7]+$/i,Ne=parseInt;function Pe(e){if(typeof e==`number`)return e;if(S(e))return ke;if(E(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=E(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Oe(e);var n=je.test(e);return n||Me.test(e)?Ne(e.slice(2),n?2:8):Ae.test(e)?ke:+e}var Fe=1/0,Ie=17976931348623157e292;function N(e){return e?(e=Pe(e),e===Fe||e===-Fe?(e<0?-1:1)*Ie:e===e?e:0):e===0?e:0}function Le(e){var t=N(e),n=t%1;return t===t?n?t-n:t:0}var Re=Object.create,ze=function(){function e(){}return function(t){if(!E(t))return{};if(Re)return Re(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Be(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function P(e,t,n){t==`__proto__`&&ce?ce(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Ve=Object.prototype.hasOwnProperty;function He(e,t,n){var r=e[t];(!(Ve.call(e,t)&&x(r,n))||n===void 0&&!(t in e))&&P(e,t,n)}function F(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?P(n,s,c):He(n,s,c)}return n}function I(e,t,n){if(!E(n))return!1;var r=typeof t;return(r==`number`?v(n)&&xe(t,n.length):r==`string`&&t in n)?x(n[t],e):!1}function Ue(e){return _(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&I(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function We(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ge=Object.prototype.hasOwnProperty;function Ke(e){if(!E(e))return We(e);var t=oe(e),n=[];for(var r in e)(r!=`constructor`||!t&&Ge.call(e,r))&&n.push(r);return n}function L(e){return v(e)?ae(e,!0):Ke(e)}function R(e){return e!=null&&e.length?o(e,1):[]}function qe(t){return pe(e(t,void 0,R),t+``)}var Je=re(Object.getPrototypeOf,Object),Ye=`[object Object]`,Xe=Function.prototype,Ze=Object.prototype,Qe=Xe.toString,$e=Ze.hasOwnProperty,et=Qe.call(Object);function tt(e){if(!k(e)||he(e)!=Ye)return!1;var t=Je(e);if(t===null)return!0;var n=$e.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Qe.call(n)==et}var nt=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function rt(e){return nt.test(e)}function it(e,t){return e&&F(t,ie(t),e)}function at(e,t){return e&&F(t,L(t),e)}var ot=typeof exports==`object`&&exports&&!exports.nodeType&&exports,st=ot&&typeof module==`object`&&module&&!module.nodeType&&module,ct=st&&st.exports===ot?de.Buffer:void 0,lt=ct?ct.allocUnsafe:void 0;function ut(e,t){if(t)return e.slice();var n=e.length,r=lt?lt(n):new e.constructor(n);return e.copy(r),r}function dt(e,t){return F(e,p(e),t)}var ft=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)l(t,p(e)),e=Je(e);return t}:m;function pt(e,t){return F(e,ft(e),t)}function mt(e){return me(e,L,ft)}var ht=Object.prototype.hasOwnProperty;function gt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&ht.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function _t(e){var t=new e.constructor(e.byteLength);return new h(t).set(new h(e)),t}function vt(e,t){var n=t?_t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var yt=/\w*$/;function bt(e){var t=new e.constructor(e.source,yt.exec(e));return t.lastIndex=e.lastIndex,t}var xt=fe?fe.prototype:void 0,St=xt?xt.valueOf:void 0;function Ct(e){return St?Object(St.call(e)):{}}function wt(e,t){var n=t?_t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Tt=`[object Boolean]`,Et=`[object Date]`,Dt=`[object Map]`,Ot=`[object Number]`,kt=`[object RegExp]`,At=`[object Set]`,jt=`[object String]`,Mt=`[object Symbol]`,Nt=`[object ArrayBuffer]`,Pt=`[object DataView]`,Ft=`[object Float32Array]`,It=`[object Float64Array]`,Lt=`[object Int8Array]`,Rt=`[object Int16Array]`,zt=`[object Int32Array]`,Bt=`[object Uint8Array]`,Vt=`[object Uint8ClampedArray]`,Ht=`[object Uint16Array]`,Ut=`[object Uint32Array]`;function Wt(e,t,n){var r=e.constructor;switch(t){case Nt:return _t(e);case Tt:case Et:return new r(+e);case Pt:return vt(e,n);case Ft:case It:case Lt:case Rt:case zt:case Bt:case Vt:case Ht:case Ut:return wt(e,n);case Dt:return new r;case Ot:case jt:return new r(e);case kt:return bt(e);case At:return new r;case Mt:return Ct(e)}}function Gt(e){return typeof e.constructor==`function`&&!oe(e)?ze(Je(e)):{}}var Kt=`[object Map]`;function qt(e){return k(e)&&T(e)==Kt}var Jt=d&&d.isMap,Yt=Jt?ve(Jt):qt,Xt=`[object Set]`;function Zt(e){return k(e)&&T(e)==Xt}var Qt=d&&d.isSet,$t=Qt?ve(Qt):Zt,en=1,tn=2,nn=4,rn=`[object Arguments]`,an=`[object Array]`,on=`[object Boolean]`,sn=`[object Date]`,cn=`[object Error]`,ln=`[object Function]`,un=`[object GeneratorFunction]`,dn=`[object Map]`,fn=`[object Number]`,pn=`[object Object]`,mn=`[object RegExp]`,hn=`[object Set]`,gn=`[object String]`,_n=`[object Symbol]`,vn=`[object WeakMap]`,yn=`[object ArrayBuffer]`,bn=`[object DataView]`,xn=`[object Float32Array]`,Sn=`[object Float64Array]`,Cn=`[object Int8Array]`,wn=`[object Int16Array]`,Tn=`[object Int32Array]`,En=`[object Uint8Array]`,Dn=`[object Uint8ClampedArray]`,On=`[object Uint16Array]`,kn=`[object Uint32Array]`,z={};z[rn]=z[an]=z[yn]=z[bn]=z[on]=z[sn]=z[xn]=z[Sn]=z[Cn]=z[wn]=z[Tn]=z[dn]=z[fn]=z[pn]=z[mn]=z[hn]=z[gn]=z[_n]=z[En]=z[Dn]=z[On]=z[kn]=!0,z[cn]=z[ln]=z[vn]=!1;function B(e,n,r,i,a,o){var s,c=n&en,l=n&tn,d=n&nn;if(r&&(s=a?r(e,i,a,o):r(e)),s!==void 0)return s;if(!E(e))return e;var f=A(e);if(f){if(s=gt(e),!c)return Be(e,s)}else{var p=T(e),m=p==ln||p==un;if(u(e))return ut(e,c);if(p==pn||p==rn||m&&!a){if(s=l||m?{}:Gt(e),!c)return l?pt(e,at(s,e)):dt(e,it(s,e))}else{if(!z[p])return a?e:{};s=Wt(e,p,c)}}o||=new g;var h=o.get(e);if(h)return h;o.set(e,s),$t(e)?e.forEach(function(t){s.add(B(t,n,r,t,e,o))}):Yt(e)&&e.forEach(function(t,i){s.set(i,B(t,n,r,i,e,o))});var _=f?void 0:(d?l?mt:t:l?L:ie)(e);return ye(_||e,function(t,i){_&&(i=t,t=e[i]),He(s,i,B(t,n,r,i,e,o))}),s}var An=1,jn=4;function Mn(e){return B(e,An|jn)}var Nn=function(){return de.Date.now()},Pn=Object.prototype,Fn=Pn.hasOwnProperty,In=_(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&I(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=L(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||x(u,Pn[l])&&!Fn.call(e,l))&&(e[l]=a[l])}return e});function Ln(e,t,n){(n!==void 0&&!x(e[t],n)||n===void 0&&!(t in e))&&P(e,t,n)}function Rn(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function zn(e){return F(e,L(e))}function Bn(e,t,n,r,i,a,o){var c=Rn(e,n),l=Rn(t,n),d=o.get(l);if(d)Ln(e,n,d);else{var f=a?a(c,l,n+``,e,t,o):void 0,p=f===void 0;if(p){var m=A(l),h=!m&&u(l),g=!m&&!h&&s(l);f=l,m||h||g?A(c)?f=c:le(c)?f=Be(c):h?(p=!1,f=ut(l,!0)):g?(p=!1,f=wt(l,!0)):f=[]:tt(l)||se(l)?(f=c,se(c)?f=zn(c):(!E(c)||be(c))&&(f=Gt(l))):p=!1}p&&(o.set(l,f),i(f,l,r,a,o),o.delete(l)),Ln(e,n,f)}}function Vn(e,t,n,i,a){e!==t&&r(t,function(r,o){if(a||=new g,E(r))Bn(e,t,o,n,Vn,i,a);else{var s=i?i(Rn(e,o),r,o+``,e,t,a):void 0;s===void 0&&(s=r),Ln(e,o,s)}},L)}function V(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Hn(e){return function(t,n,r){var i=Object(t);if(!v(t)){var a=M(n,3);t=ie(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var Un=Math.max;function Wn(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Le(n);return i<0&&(i=Un(r+i,0)),ge(e,M(t,3),i)}var Gn=Hn(Wn);function Kn(e,t){var n=-1,r=v(e)?Array(e.length):[];return Se(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function H(e,t){return(A(e)?b:Kn)(e,M(t,3))}function qn(e,t){return e==null?e:r(e,Ce(t),L)}function Jn(e,t){return e&&te(e,Ce(t))}function Yn(e,t){return e>t}var Xn=Object.prototype.hasOwnProperty;function Zn(e,t){return e!=null&&Xn.call(e,t)}function Qn(e,t){return e!=null&&i(e,t,Zn)}var $n=`[object String]`;function er(e){return typeof e==`string`||!A(e)&&k(e)&&he(e)==$n}function tr(e,t){return e<t}function U(e,t){var n={};return t=M(t,3),te(e,function(e,r,i){P(n,r,t(e,r,i))}),n}function nr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!S(o):n(o,s)))var s=o,c=a}return c}function W(e){return e&&e.length?nr(e,ue,Yn):void 0}var rr=Ue(function(e,t,n){Vn(e,t,n)});function G(e){return e&&e.length?nr(e,ue,tr):void 0}function ir(e,t){return e&&e.length?nr(e,M(t,2),tr):void 0}function ar(e,t,n,r){if(!E(e))return e;t=we(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=ee(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=E(u)?u:xe(t[i+1])?[]:{})}He(s,c,l),s=s[c]}return e}function or(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=f(e,o);n(s,o)&&ar(a,we(o,e),s)}return a}function sr(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function cr(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=S(e),o=t!==void 0,s=t===null,c=t===t,l=S(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function lr(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=cr(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function ur(e,t,n){t=t.length?b(t,function(e){return A(e)?function(t){return f(t,e.length===1?e[0]:e)}:e}):[ue];var r=-1;return t=b(t,ve(M)),sr(Kn(e,function(e,n,i){return{criteria:b(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return lr(e,t,n)})}var dr=ne(`length`),fr=`\\ud800-\\udfff`,pr=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,mr=`\\ufe0e\\ufe0f`,hr=`[`+fr+`]`,gr=`[`+pr+`]`,_r=`\\ud83c[\\udffb-\\udfff]`,vr=`(?:`+gr+`|`+_r+`)`,yr=`[^`+fr+`]`,br=`(?:\\ud83c[\\udde6-\\uddff]){2}`,xr=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Sr=`\\u200d`,Cr=vr+`?`,wr=`[`+mr+`]?`,Tr=`(?:`+Sr+`(?:`+[yr,br,xr].join(`|`)+`)`+wr+Cr+`)*`,Er=wr+Cr+Tr,Dr=`(?:`+[yr+gr+`?`,gr,br,xr,hr].join(`|`)+`)`,Or=RegExp(_r+`(?=`+_r+`)|`+Dr+Er,`g`);function kr(e){for(var t=Or.lastIndex=0;Or.test(e);)++t;return t}function Ar(e){return rt(e)?kr(e):dr(e)}function jr(e,t){return or(e,t,function(t,n){return a(e,n)})}var K=qe(function(e,t){return e==null?{}:jr(e,t)}),Mr=Math.ceil,Nr=Math.max;function Pr(e,t,n,r){for(var i=-1,a=Nr(Mr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Fr(e){return function(t,n,r){return r&&typeof r!=`number`&&I(t,n,r)&&(n=r=void 0),t=N(t),n===void 0?(n=t,t=0):n=N(n),r=r===void 0?t<n?1:-1:N(r),Pr(t,n,r,e)}}var q=Fr(),Ir=`[object Map]`,Lr=`[object Set]`;function Rr(e){if(e==null)return 0;if(v(e))return er(e)?Ar(e):e.length;var t=T(e);return t==Ir||t==Lr?e.size:c(e).length}var J=_(function(e,t){if(e==null)return[];var n=t.length;return n>1&&I(e,t[0],t[1])?t=[]:n>2&&I(t[0],t[1],t[2])&&(t=[t[0]]),ur(e,o(t,1),[])}),zr=0;function Br(e){var t=++zr;return n(e)+t}function Vr(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function Hr(e,t){return Vr(e||[],t||[],He)}var Ur=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return Wr(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&Wr(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,Gr)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Wr(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Gr(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Kr=_e(1);function qr(e,t){if(e.nodeCount()<=1)return[];var n=Xr(e,t||Kr);return R(H(Jr(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function Jr(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)Yr(e,t,n,o);for(;o=i.dequeue();)Yr(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(Yr(e,t,n,o,!0));break}}}return r}function Yr(e,t,n,r,i){var a=i?[]:void 0;return j(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Zr(t,n,s)}),j(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Zr(t,n,o)}),e.removeNode(r.v),a}function Xr(e,t){var n=new O,r=0,i=0;j(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),j(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=q(i+r+3).map(function(){return new Ur}),o=r+1;return j(n.nodes(),function(e){Zr(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function Zr(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Qr(e){var t=e.graph().acyclicer===`greedy`?qr(e,n(e)):$r(e);j(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Br(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function $r(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,j(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return j(e.nodes(),i),t}function ei(e){j(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Y(e,t,n,r){var i;do i=Br(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function ti(e){var t=new O().setGraph(e.graph());return j(e.nodes(),function(n){t.setNode(n,e.node(n))}),j(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function ni(e){var t=new O({multigraph:e.isMultigraph()}).setGraph(e.graph());return j(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),j(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function ri(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function X(e){var t=H(q(si(e)+1),function(){return[]});return j(e.nodes(),function(n){var r=e.node(n),i=r.rank;w(i)||(t[i][r.order]=n)}),t}function ii(e){var t=G(H(e.nodes(),function(t){return e.node(t).rank}));j(e.nodes(),function(n){var r=e.node(n);Qn(r,`rank`)&&(r.rank-=t)})}function ai(e){var t=G(H(e.nodes(),function(t){return e.node(t).rank})),n=[];j(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;j(n,function(t,n){w(t)&&n%i!==0?--r:r&&j(t,function(t){e.node(t).rank+=r})})}function oi(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Y(e,`border`,i,t)}function si(e){return W(H(e.nodes(),function(t){var n=e.node(t).rank;if(!w(n))return n}))}function ci(e,t){var n={lhs:[],rhs:[]};return j(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function li(e,t){var n=Nn();try{return t()}finally{console.log(e+` time: `+(Nn()-n)+`ms`)}}function ui(e,t){return t()}function di(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&j(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)fi(e,`borderLeft`,`_bl`,n,i,a),fi(e,`borderRight`,`_br`,n,i,a)}}j(e.children(),t)}function fi(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Y(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function pi(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&hi(e)}function mi(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&_i(e),(t===`lr`||t===`rl`)&&(yi(e),hi(e))}function hi(e){j(e.nodes(),function(t){gi(e.node(t))}),j(e.edges(),function(t){gi(e.edge(t))})}function gi(e){var t=e.width;e.width=e.height,e.height=t}function _i(e){j(e.nodes(),function(t){vi(e.node(t))}),j(e.edges(),function(t){var n=e.edge(t);j(n.points,vi),Object.prototype.hasOwnProperty.call(n,`y`)&&vi(n)})}function vi(e){e.y=-e.y}function yi(e){j(e.nodes(),function(t){bi(e.node(t))}),j(e.edges(),function(t){var n=e.edge(t);j(n.points,bi),Object.prototype.hasOwnProperty.call(n,`x`)&&bi(n)})}function bi(e){var t=e.x;e.x=e.y,e.y=t}function xi(e){e.graph().dummyChains=[],j(e.edges(),function(t){Si(e,t)})}function Si(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d=0;for(++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=Y(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Ci(e){j(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function wi(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=G(H(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}j(e.sources(),n)}function Z(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function Ti(e){var t=new O({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Ei(t,e)<r;)i=Di(t,e),a=t.hasNode(i.v)?Z(e,i):-Z(e,i),Oi(t,e,a);return t}function Ei(e,t){function n(r){j(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Z(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return j(e.nodes(),n),e.nodeCount()}function Di(e,t){return ir(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return Z(t,n)})}function Oi(e,t,n){j(e.nodes(),function(e){t.node(e).rank+=n})}_e(1),_e(1),ki.CycleException=Q;function ki(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new Q;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,j(e.predecessors(a),i),delete n[a],r.push(a))}if(j(e.sinks(),i),Rr(t)!==e.nodeCount())throw new Q;return r}function Q(){}Q.prototype=Error();function Ai(e,t,n){A(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return j(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);ji(e,t,n===`post`,a,r,i)}),i}function ji(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),j(i(t),function(t){ji(e,t,n,r,i,a)}),n&&a.push(t))}function Mi(e,t){return Ai(e,t,`post`)}function Ni(e,t){return Ai(e,t,`pre`)}$.initLowLimValues=Li,$.initCutValues=Pi,$.calcCutValue=Ii,$.leaveEdge=zi,$.enterEdge=Bi,$.exchangeEdges=Vi;function $(e){e=ti(e),wi(e);var t=Ti(e);Li(t),Pi(t,e);for(var n,r;n=zi(t);)r=Bi(t,e,n),Vi(t,e,n,r)}function Pi(e,t){var n=Mi(e,e.nodes());n=n.slice(0,n.length-1),j(n,function(n){Fi(e,t,n)})}function Fi(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=Ii(e,t,n)}function Ii(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,j(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,Ui(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function Li(e,t){arguments.length<2&&(t=e.nodes()[0]),Ri(e,{},1,t)}function Ri(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,j(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=Ri(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function zi(e){return Gn(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Bi(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),ir(y(t.edges(),function(t){return c===Wi(e,e.node(t.v),s)&&c!==Wi(e,e.node(t.w),s)}),function(e){return Z(t,e)})}function Vi(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Li(e),Pi(e,t),Hi(e,t)}function Hi(e,t){var n=Ni(e,Gn(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),j(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Ui(e,t,n){return e.hasEdge(t,n)}function Wi(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Gi(e){switch(e.graph().ranker){case`network-simplex`:Ji(e);break;case`tight-tree`:qi(e);break;case`longest-path`:Ki(e);break;default:Ji(e)}}var Ki=wi;function qi(e){wi(e),Ti(e)}function Ji(e){$(e)}function Yi(e){var t=Y(e,`root`,{},`_root`),n=Zi(e),r=W(C(n))-1,i=2*r+1;e.graph().nestingRoot=t,j(e.edges(),function(t){e.edge(t).minlen*=i});var a=Qi(e)+1;j(e.children(),function(o){Xi(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function Xi(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length)o!==t&&e.setEdge(t,o,{weight:0,minlen:n});else{var c=oi(e,`_bt`),l=oi(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,j(s,function(s){Xi(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}}function Zi(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&j(a,function(e){n(e,i+1)}),t[r]=i}return j(e.children(),function(e){n(e,1)}),t}function Qi(e){return D(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function $i(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,j(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function ea(e,t,n){var r={},i;j(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ta(e,t,n){var r=na(e),i=new O({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return j(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),j(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=w(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function na(e){for(var t;e.hasNode(t=Br(`_root`)););return t}function ra(e,t){for(var n=0,r=1;r<t.length;++r)n+=ia(e,t[r-1],t[r]);return n}function ia(e,t,n){for(var r=Hr(n,H(n,function(e,t){return t})),i=R(H(t,function(t){return J(H(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=H(Array(o),function(){return 0}),c=0;return j(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function aa(e){var t={},n=y(e.nodes(),function(t){return!e.children(t).length}),r=H(q(W(H(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){Qn(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),j(e.successors(n),i))}var a=J(n,function(t){return e.node(t).rank});return j(a,i),r}function oa(e,t){return H(t,function(t){var n=e.inEdges(t);if(n.length){var r=D(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function sa(e,t){var n={};return j(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};w(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),j(t.edges(),function(e){var t=n[e.v],r=n[e.w];!w(t)&&!w(r)&&(r.indegree++,t.out.push(n[e.w]))}),ca(y(n,function(e){return!e.indegree}))}function ca(e){var t=[];function n(e){return function(t){t.merged||(w(t.barycenter)||w(e.barycenter)||t.barycenter>=e.barycenter)&&la(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),j(i.in.reverse(),n(i)),j(i.out,r(i))}return H(y(t,function(e){return!e.merged}),function(e){return K(e,[`vs`,`i`,`barycenter`,`weight`])})}function la(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function ua(e,t){var n=ci(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=J(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(fa(!!t)),c=da(a,i,c),j(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=da(a,i,c)});var l={vs:R(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function da(e,t,n){for(var r;t.length&&(r=V(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function fa(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function pa(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=y(i,function(e){return e!==o&&e!==s}));var l=oa(e,i);j(l,function(t){if(e.children(t.v).length){var i=pa(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&ha(t,i)}});var u=sa(l,n);ma(u,c);var d=ua(u,r);if(o&&(d.vs=R([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function ma(e,t){j(e,function(e){e.vs=R(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function ha(e,t){w(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function ga(e){var t=si(e),n=_a(e,q(1,t+1),`inEdges`),r=_a(e,q(t-1,-1,-1),`outEdges`),i=aa(e);ya(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){va(s%2?n:r,s%4>=2),i=X(e);var l=ra(e,i);l<a&&(c=0,o=Mn(i),a=l)}ya(e,o)}function _a(e,t,n){return H(t,function(t){return ta(e,t,n)})}function va(e,t){var n=new O;j(e,function(e){var r=pa(e,e.graph().root,n,t);j(r.vs,function(t,n){e.node(t).order=n}),ea(e,n,r.vs)})}function ya(e,t){j(t,function(t){j(t,function(t,n){e.node(t).order=n})})}function ba(e){var t=Sa(e);j(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=xa(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function xa(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Sa(e){var t={},n=0;function r(i){var a=n;j(e.children(i),r),t[i]={low:a,lim:n++}}return j(e.children(),r),t}function Ca(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=V(r);return j(r,function(t,c){var l=Ta(e,t),u=l?e.node(l).order:o;(l||t===s)&&(j(r.slice(a,c+1),function(t){j(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Ea(n,r,t)})}),a=c+1,i=u)}),r}return D(t,r),n}function wa(e,t){var n={};function r(t,r,i,a,o){var s;j(q(r,i),function(r){s=t[r],e.node(s).dummy&&j(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Ea(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return j(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return D(t,i),n}function Ta(e,t){if(e.node(t).dummy)return Gn(e.predecessors(t),function(t){return e.node(t).dummy})}function Ea(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Da(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Oa(e,t,n,r){var i={},a={},o={};return j(t,function(e){j(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),j(t,function(e){var t=-1;j(e,function(e){var s=r(e);if(s.length){s=J(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Da(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function ka(e,t,n,r,i){var a={},o=Aa(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),j(r,function(e){a[e]=a[n[e]]}),a}function Aa(e,t,n,r){var i=new O,a=e.graph(),o=Fa(a.nodesep,a.edgesep,r);return j(t,function(t){var r;j(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function ja(e,t){return ir(C(t),function(t){var n=-1/0,r=1/0;return qn(t,function(t,i){var a=Ia(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Ma(e,t){var n=C(t),r=G(n),i=W(n);j([`u`,`d`],function(n){j([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=C(s);c=a===`l`?r-G(l):i-W(l),c&&(e[o]=U(s,function(e){return e+c}))}})})}function Na(e,t){return U(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=J(H(e,r));return(i[1]+i[2])/2})}function Pa(e){var t=X(e),n=rr(Ca(e,t),wa(e,t)),r={},i;return j([`u`,`d`],function(a){i=a===`u`?t:C(t).reverse(),j([`l`,`r`],function(t){t===`r`&&(i=H(i,function(e){return C(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Oa(e,i,n,o),c=ka(e,i,s.root,s.align,t===`r`);t===`r`&&(c=U(c,function(e){return-e})),r[a+t]=c})}),Ma(r,ja(e,r)),Na(r,e.graph().align)}function Fa(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function Ia(e,t){return e.node(t).width}function La(e){e=ni(e),Ra(e),Jn(Pa(e),function(t,n){e.node(n).x=t})}function Ra(e){var t=X(e),n=e.graph().ranksep,r=0;j(t,function(t){var i=W(H(t,function(t){return e.node(t).height}));j(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function za(e,t){var n=t&&t.debugTiming?li:ui;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>Xa(e));n(` runLayout`,()=>Ba(t,n)),n(` updateInputGraph`,()=>Va(e,t))})}function Ba(e,t){t(` makeSpaceForEdgeLabels`,()=>Za(e)),t(` removeSelfEdges`,()=>oo(e)),t(` acyclic`,()=>Qr(e)),t(` nestingGraph.run`,()=>Yi(e)),t(` rank`,()=>Gi(ni(e))),t(` injectEdgeLabelProxies`,()=>Qa(e)),t(` removeEmptyRanks`,()=>ai(e)),t(` nestingGraph.cleanup`,()=>$i(e)),t(` normalizeRanks`,()=>ii(e)),t(` assignRankMinMax`,()=>$a(e)),t(` removeEdgeLabelProxies`,()=>eo(e)),t(` normalize.run`,()=>xi(e)),t(` parentDummyChains`,()=>ba(e)),t(` addBorderSegments`,()=>di(e)),t(` order`,()=>ga(e)),t(` insertSelfEdges`,()=>so(e)),t(` adjustCoordinateSystem`,()=>pi(e)),t(` position`,()=>La(e)),t(` positionSelfEdges`,()=>co(e)),t(` removeBorderNodes`,()=>ao(e)),t(` normalize.undo`,()=>Ci(e)),t(` fixupEdgeLabelCoords`,()=>ro(e)),t(` undoCoordinateSystem`,()=>mi(e)),t(` translateGraph`,()=>to(e)),t(` assignNodeIntersects`,()=>no(e)),t(` reversePoints`,()=>io(e)),t(` acyclic.undo`,()=>ei(e))}function Va(e,t){j(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),j(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Ha=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Ua={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Wa=[`acyclicer`,`ranker`,`rankdir`,`align`],Ga=[`width`,`height`],Ka={width:0,height:0},qa=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Ja={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Ya=[`labelpos`];function Xa(e){var t=new O({multigraph:!0,compound:!0}),n=uo(e.graph());return t.setGraph(rr({},Ua,lo(n,Ha),K(n,Wa))),j(e.nodes(),function(n){var r=uo(e.node(n));t.setNode(n,In(lo(r,Ga),Ka)),t.setParent(n,e.parent(n))}),j(e.edges(),function(n){var r=uo(e.edge(n));t.setEdge(n,rr({},Ja,lo(r,qa),K(r,Ya)))}),t}function Za(e){var t=e.graph();t.ranksep/=2,j(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Qa(e){j(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);Y(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function $a(e){var t=0;j(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=W(t,r.maxRank))}),e.graph().maxRank=t}function eo(e){j(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function to(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}j(e.nodes(),function(t){c(e.node(t))}),j(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,j(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),j(e.edges(),function(n){var i=e.edge(n);j(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function no(e){j(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(ri(r,a)),n.points.push(ri(i,o))})}function ro(e){j(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function io(e){j(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function ao(e){j(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(V(n.borderLeft)),o=e.node(V(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),j(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function oo(e){j(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function so(e){var t=X(e);j(t,function(t){var n=0;j(t,function(t,r){var i=e.node(t);i.order=r+n,j(i.selfEdges,function(t){Y(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function co(e){j(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function lo(e,t){return U(K(e,t),Number)}function uo(e){var t={};return j(e,function(e,n){t[n.toLowerCase()]=e}),t}export{za as t};
@@ -0,0 +1,4 @@
1
+ import{Ot as e,Rn as t,St as n,Tt as r,_t as i,a,c as o,cr as s,dr as c,f as l,i as u,l as d,o as f,p,r as m,s as h,vt as g,wt as _,xt as v}from"./mermaid.core-DTGmDhfV.js";import{t as y}from"./dagre-CHqJHIuQ.js";var b=c((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),x=c((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),S=c(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),C=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],w=c((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return x(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:x(i)},`getSelfLoopSide`),T=c((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=b(Math.max(r,e.width*.35),36,c),u=b(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),E=c((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),D=c((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=w(e,l,n,c.start,a),f=T(l,d,t,u.width??0),p=E(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),O=c(async({element:t,graph:i,diagramType:a,id:l,parentCluster:d,siteConfig:p})=>{let m=i.graph().rankdir;s.trace(`Dir in recursive render - dir:`,m);let{clusters:_,edgePaths:v,edgeLabels:y,nodes:b,rootGroups:x}=f(t,{edgePathsClass:`edgePaths`});i.nodes()?s.info(`Recursive render XXX`,i.nodes()):s.info(`No nodes found for`,i),i.edges().length>0&&s.info(`Recursive edges`,i.edge(i.edges()[0]));let C=S(a);await Promise.all(i.nodes().map(async function(t){let n=i.node(t);if(d!==void 0){let e=JSON.parse(JSON.stringify(d.clusterData));s.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,t,`
3
+ data=`,e.height,`
4
+ Parent cluster`,d.height),i.setNode(d.id,e),i.parent(t)||(s.trace(`Setting parent`,t,d.id),i.setParent(t,d.id,e))}if(s.info(`(Insert) Node XXX`+t+`: `+JSON.stringify(i.node(t))),n?.clusterNode){s.info(`Cluster identified XBX`,t,n.width,i.node(t));let{ranksep:o,nodesep:c}=i.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:c});let u=await F({element:b,graph:n.graph,diagramType:a,id:l,parentCluster:i.node(t),siteConfig:p}),d=u.elem;e(n,d),n.diff=u.diff||0,s.info(`New compound node after recursive render XAX`,t,`width`,n.width,`height`,n.height),r(d,n)}else i.children(t).length>0?(s.trace(`Cluster - the non recursive path XBX`,t,n.id,n,n.width,`Graph:`,i),s.trace(h(n.id,i)),u.set(n.id,{id:h(n.id,i),node:n})):(s.trace(`Node - the non recursive path XAX`,t,b,i.node(t),m),await o(b,i.node(t),{config:p,dir:m}))})),await c(async()=>{let e=i.edges().map(async function(e){let t=i.edge(e.v,e.w,e.name);if(s.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),s.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(i.edge(e))),s.info(`Fix`,u,`ids:`,e.v,e.w,`Translating: `,u.get(e.v),u.get(e.w)),C&&t.selfLoop){if(t.selfLoop.order!==1)return;let e={...t.originalEdge,...t,id:t.selfLoop.id,startLabelLeft:t.originalEdge?.startLabelLeft??t.startLabelLeft,startLabelRight:t.originalEdge?.startLabelRight??t.startLabelRight,endLabelLeft:t.originalEdge?.endLabelLeft??t.endLabelLeft,endLabelRight:t.originalEdge?.endLabelRight??t.endLabelRight};await g(y,e),t.width=e.width,t.height=e.height,t.labelStyle=e.labelStyle}else await g(y,t)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:w}=n(p);return{elem:x,graph:i,groups:{clusters:_,edgePaths:v,edgeLabels:y,nodes:b,rootGroups:x},diagramType:a,id:l,mergeSelfLoops:C,subGraphTitleTotalMargin:w}},`measureDagreGraph`),k=c(e=>{s.info(`############################################# XXX`),s.info(`### Layout ### XXX`),s.info(`############################################# XXX`),y(e)},`runDagreGraphLayout`),A=c((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),j=c((e,t)=>{C.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),M=c((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),N=c((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));d(n).forEach(e=>{let t=A(n,e,i);if(!t)return;j(n.node(e),t);let r=a.get(e);r&&j(r,t)});let o=i/2;return e.edges=D(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>M(e,t,n,o)),e},`applyDagreLayoutResult`),P=c(async({elem:e,graph:t,groups:{clusters:n,edgePaths:r},diagramType:a,id:o,mergeSelfLoops:c,subGraphTitleTotalMargin:f})=>{let p=0;await Promise.all(d(t).map(async function(e){let r=t.node(e);if(s.info(`Position XBX => `+e+`: (`+r.x,`,`+r.y,`) width: `,r.width,` height: `,r.height),r?.clusterNode)r.y+=f,s.info(`A tainted cluster node XBX1`,e,r.id,r.width,r.height,r.x,r.y,t.parent(e)),u.get(r.id).node=r,_(r);else if(t.children(e).length>0){s.info(`A pure cluster node XBX1`,e,r.id,r.x,r.y,r.width,r.height,t.parent(e)),r.height+=f,t.node(r.parentId);let i=r?.padding/2||0,a=r?.labelBBox?.height||0,o=a-i||0;s.debug(`OffsetY`,o,`labelHeight`,a,`halfPadding`,i),await l(n,r),u.get(r.id).node=r}else{let e=t.node(r.parentId);r.y+=f/2,s.info(`A regular node XBX1 - using the padding`,r.id,`parent`,r.parentId,r.width,r.height,r.x,r.y,`offsetY`,r.offsetY,`parent`,e,e?.offsetY,r),_(r)}}));let m=f/2;return D(t,m,{mergeSelfLoops:c}).forEach(function({edge:e,start:n,end:c}){s.info(`Edge `+n+` -> `+c+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=m);let l=t.node(n),d=t.node(c),f=i(r,e,u,a,l,d,o);v(e,f)}),t.nodes().forEach(function(e){let n=t.node(e);s.info(e,n.type,n.diff),n.isGroup&&(p=n.diff)}),s.warn(`Returning from recursive render XAX`,e,p),{elem:e,diff:p}},`paintDagreLayoutCore`),F=c(async e=>{let t=await O(e);return k(t.graph),await P(t)},`renderDagreSubgraph`),I=c(e=>{let t=new p({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{t.setNode(e.id,{...e}),e.parentId&&t.setParent(e.id,e.parentId)}),s.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let n=e.start,r=n+`---`+n+`---1`,i=n+`---`+n+`---2`,a=t.node(n);t.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),t.setParent(r,a.parentId),t.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),t.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=n+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=n+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=n,l.toCluster=n),l.id=n+`-cyclic-special-2`,l.arrowTypeStart=`none`,t.setEdge(n,r,s,n+`-cyclic-special-0`),t.setEdge(r,i,c,n+`-cyclic-special-1`),t.setEdge(i,n,l,n+`-cyclic-special-2`)}else t.setEdge(e.start,e.end,{...e},e.id)}),m(t),{graph:t}},`prepareLayoutForDagre`),L=c(async(e,{element:n,preparedLayout:r})=>{let i=r??I(e),a=t(),o=await O({element:n,graph:i.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=o,o},`measureDagreLayout`),R=c((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return k(n.graph),N(e,n),n},`runDagreLayoutCore`),z=a({prepareLayout:I,measureLayout:L,runLayoutCore:R,paintOptions:{clusterDb:u,getNodes:c((e,{measure:t})=>d(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:c((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:c((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:c((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{N as applyDagreLayoutResult,D as getEdgesToRender,L as measureDagreLayout,I as prepareLayoutForDagre,z as render,R as runDagreLayoutCore};
@@ -0,0 +1,30 @@
1
+ import{t as e}from"./chunk-2Q5K7J3B-Cmy5RQpP.js";import{t}from"./chunk-JWPE2WC7-DL2sZ8xq.js";import{Fn as n,In as r,Jn as i,Ln as a,Lt as o,Mn as s,Pn as c,Yn as l,Zn as u,cr as d,dr as f,kn as p,qn as m,vn as h,xn as g,yn as _,zn as v}from"./mermaid.core-DTGmDhfV.js";import{n as y}from"./mermaid-parser.core-BX15ctWm.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}f(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}f(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}f(k,`remapErrorLines`);function A(e){let t=e.split(`
2
+ `),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e<t.length;e++){let n=t[e];n.trim()===``||T.test(n)||w.test(n)||C.test(n)||i.push(n.replace(/\t/g,` `))}if(!D(i))return{text:e,lineMap:n};let a=O(i),o=[],s=0;for(let e=0;e<=r;e++)o.push(t[e]),s++,n.set(s,e+1);for(let e=r+1;e<t.length;e++){let r=t[e],i=r.trim(),c=e+1;if(i===``||T.test(r)||w.test(r)){o.push(r),s++,n.set(s,c);continue}if(C.test(r))continue;let l=r.replace(/\t/g,` `),u=x.exec(l);if(u?.index!==void 0){let e=u.index,t=Math.round(e/a)+1,r=e+1;for(;r<l.length&&S.test(l[r]);)r++;for(;r<l.length&&l[r]===` `;)r++;let i=l.slice(r).trimEnd();if(!i)throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let d=E.repeat(t);o.push(d+i),s++,n.set(s,c)}else if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;else if(b.test(l))o.push(r),s++,n.set(s,c);else if(/^\s+/.test(l))throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);else o.push(r),s++,n.set(s,c)}return{text:o.join(`
3
+ `),lineMap:n}}f(A,`preprocessBoxDrawing`);var j=new e(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=f(()=>{j.reset(),p()},`clear`),N=f(()=>j.records.stack[0],`getRoot`),P=f(()=>j.records.cnt,`getCount`),F=c.treeView,I={clear:M,addNode:f((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:f(()=>o(F,a().treeView),`getConfig`),getAccTitle:r,getAccDescription:n,getDiagramTitle:v,setAccDescription:i,setAccTitle:l,setDiagramTitle:u},L=f(e=>{t(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,o=t.classAnnotation||void 0,s=t.iconAnnotation,c=s===void 0?void 0:s||`none`,l=t.descAnnotation||void 0,u=l?m(l,a()):void 0;I.addNode(e,n,i,o,c,u)}},`populate`),R={parse:f(async e=>{let{text:t,lineMap:n}=A(e);try{let e=await y(`treeView`,t);d.debug(e),L(e)}catch(e){throw n.size>0&&e instanceof Error&&(e.message=k(e.message,n)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:`<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>`},file:{body:`<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>`}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}f(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}f(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}f(H,`getNodeIcon`),_([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=f(async(e,t)=>{let n=[],r=f(e=>{let i=H(e,t);i&&n.push({icon:i,node:e}),e.children.forEach(r)},`collect`);r(e);let i=await Promise.all(n.map(async({icon:e,node:t})=>({id:t.id,svg:await h(e,{height:U,width:U})})));return new Map(i.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=f((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=f((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=f((e,t,n,r)=>{let i=0,a=0,o=[],s=f((e,t,n,s)=>{let c=s*(n.rowIndent+n.paddingX),l=q(c,i,t,e,n,r);o.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,i+u/2,c,i+u/2,n.lineThickness),a=Math.max(a,c+d),i+=u},`drawNode`),c=f((t,r=0)=>{s(e,t,n,r),t.children.forEach(e=>{c(e,r+1)});let{x:i,y:a,height:o}=t.BBox;if(t.children.length){let{y:r,height:s}=t.children[t.children.length-1].BBox;J(e,i+n.paddingX,a+o,i+n.paddingX,r+s/2+n.lineThickness/2,n.lineThickness)}},`processNode`);c(t);let l=o.filter(e=>e.node.description);if(l.length>0){let e=Math.max(...o.map(e=>e.labelRightEdge))+G;for(let t of l){let r=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();a=Math.max(a,e+r.width+n.paddingX)}}for(let e of o)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=a-e.node.BBox.x+8;t.attr(`width`,n),a=Math.max(a,e.node.BBox.x+n+2)}}return{totalHeight:i,totalWidth:a}},`drawTree`),X={draw:f(async(e,t,n,r)=>{d.debug(`Rendering treeView diagram
4
+ `+e);let i=r.db,a=i.getRoot(),o=i.getConfig(),c=g(t),l=c.append(`g`);l.attr(`class`,`tree-view`);let{totalHeight:u,totalWidth:f}=Y(l,a,o,await K(a,o));c.attr(`viewBox`,`-${o.lineThickness/2} 0 ${f} ${u}`),s(c,u,f,o.useMaxWidth)},`draw`)},Z={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},Q={db:I,renderer:X,parser:R,styles:f(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:c}=o(Z,e);return`
5
+ .treeView-node-label {
6
+ font-size: ${t};
7
+ fill: ${n};
8
+ white-space: pre;
9
+ }
10
+ .treeView-node-dir {
11
+ font-weight: bold;
12
+ }
13
+ .treeView-node-line {
14
+ stroke: ${r};
15
+ }
16
+ .treeView-node-icon {
17
+ color: ${i};
18
+ }
19
+ .treeView-node-description {
20
+ font-size: ${t};
21
+ fill: ${a};
22
+ font-style: italic;
23
+ white-space: pre;
24
+ }
25
+ .treeView-highlight-bg {
26
+ fill: ${s};
27
+ stroke: ${c};
28
+ stroke-width: 1;
29
+ }
30
+ `},`styles`)};export{Q as diagram};
@@ -0,0 +1,41 @@
1
+ import{t as e}from"./chunk-JWPE2WC7-DL2sZ8xq.js";import{Bn as t,Fn as n,In as r,Jn as i,Ln as a,Lt as o,Mn as s,Pn as c,Yn as l,Zn as u,cr as d,dr as f,kn as p,xn as m,zn as h}from"./mermaid.core-DTGmDhfV.js";import{n as g}from"./mermaid-parser.core-BX15ctWm.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v=32,y={axes:[],curves:[],options:_},b=structuredClone(y),x=c.radar,S=f(()=>o({...x,...a().radar}),`getConfig`),C=f(()=>b.axes,`getAxes`),w=f(()=>b.curves,`getCurves`),T=f(()=>b.options,`getOptions`),E=f(e=>{b.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),D=f(e=>{b.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:O(e.entries)}))},`setCurves`),O=f(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=C();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),k={getAxes:C,getCurves:w,getOptions:T,setAxes:E,setCurves:D,setOptions:f(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});b.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule},b.options.ticks>v&&(d.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`),b.options.ticks=v)},`setOptions`),getConfig:S,clear:f(()=>{p(),b=structuredClone(y)},`clear`),setAccTitle:l,getAccTitle:r,setDiagramTitle:u,getDiagramTitle:h,getAccDescription:n,setAccDescription:i},A=f(t=>{e(t,k);let{axes:n,curves:r,options:i}=t;k.setAxes(n),k.setCurves(r),k.setOptions(i)},`populate`),j={parse:f(async e=>{let t=await g(`radar`,e);d.debug(t),A(t)},`parse`)},M=f((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=N(m(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;P(u,a,p,s.ticks,s.graticule),F(u,a,p,c),I(u,a,o,f,d,s.graticule,c),z(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),N=f((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return s(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`).attr(`overflow`,`visible`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),P=f((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),F=f((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2,c=Math.cos(s),l=Math.sin(s);e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*c).attr(`y2`,n*r.axisScaleFactor*l).attr(`class`,`radarAxisLine`);let u=c>.01?`start`:c<-.01?`end`:`middle`,d=l>.01?`hanging`:l<-.01?`auto`:`central`;e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*c+4*c).attr(`y`,n*r.axisLabelFactor*l+4*l).attr(`text-anchor`,u).attr(`dominant-baseline`,d).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function I(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=L(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,R(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}f(I,`drawCurves`);function L(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}f(L,`relativeRadius`);function R(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}f(R,`closedRoundCurve`);function z(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}f(z,`drawLegend`);var B={draw:M},V=f((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
2
+ .radarCurve-${r} {
3
+ color: ${i};
4
+ fill: ${i};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${i};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${i};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${i};
13
+ }
14
+ `}return n},`genIndexStyles`),H=f(e=>{let n=t(),r=a(),i=o(n,r.themeVariables);return{themeVariables:i,radarOptions:o(i.radar,e)}},`buildRadarStyleOptions`),U={parser:j,db:k,renderer:B,styles:f(({radar:e}={})=>{let{themeVariables:t,radarOptions:n}=H(e);return`
15
+ .radarTitle {
16
+ font-size: ${t.fontSize};
17
+ color: ${t.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${n.axisColor};
23
+ stroke-width: ${n.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ font-size: ${n.axisLabelFontSize}px;
27
+ color: ${n.axisColor};
28
+ }
29
+ .radarGraticule {
30
+ fill: ${n.graticuleColor};
31
+ fill-opacity: ${n.graticuleOpacity};
32
+ stroke: ${n.graticuleColor};
33
+ stroke-width: ${n.graticuleStrokeWidth};
34
+ }
35
+ .radarLegendText {
36
+ text-anchor: start;
37
+ font-size: ${n.legendFontSize}px;
38
+ dominant-baseline: hanging;
39
+ }
40
+ ${V(t,n)}
41
+ `},`styles`)};export{U as diagram};
@@ -0,0 +1,3 @@
1
+ import{t as e}from"./chunk-JWPE2WC7-DL2sZ8xq.js";import{$n as t,En as n,Fn as r,In as i,Jn as a,Ln as o,Lt as s,Pn as c,Pt as l,Rn as u,Wt as d,Yn as f,Zn as p,cr as m,dr as h,kn as g,qn as _,zn as ee}from"./mermaid.core-DTGmDhfV.js";import{N as te,n as ne}from"./mermaid-parser.core-BX15ctWm.js";var v=`position frame`,y=`frame positioned`,b=`position relation`,x=`relation positioned`,re=h(function(e){m.debug(`options str`,e)},`setOptions`),ie=h(function(){return{}},`getOptions`),ae=h(function(){S(),g()},`clear`);function S(){C={}}h(S,`reset`);var oe=c.eventmodeling,se=h(()=>s({...oe,...o().eventmodeling}),`getConfig`),C={};function w(){let e=ce,{ast:t}=C,n=D();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((r,i)=>{let a=P(r,t.dataEntities,n);e=J(e,{$kind:v,index:i,frame:r,textProps:a});let o;V(r)?(m.debug(`source frame`,r.sourceFrames),o=t.frames.filter(e=>r.sourceFrames.some(t=>t.$refText===e.name)),o.forEach(t=>{e=J(e,{$kind:b,index:i,frame:r,sourceFrame:t})})):e=J(e,{$kind:b,index:i,frame:r})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}h(w,`getState`);function T(e){C.ast=e}h(T,`setAst`);var E={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function D(){return E}h(D,`getDiagramProps`);var ce={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function O(e){let t=e.split(`.`);if(t.length===2)return t[0]}h(O,`extractNamespace`);function k(e){let t=e.split(`.`);return t.length===2?t[1]:e}h(k,`extractName`);function A(e,t){if(t&&t.length!==0)return Object.values(e).find(e=>e.namespace===t)}h(A,`findSwimlaneByNamespace`);function j(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&r<n}).map(e=>Number.parseInt(e)))+1}h(j,`findNextAvailableIndex`);function M(e,t){let n=O(e.entityIdentifier),r=A(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||E.labelUiAutomation}:n?{index:j(t,0,100),label:E.labelUiAutomationPrefix+n}:{index:0,label:E.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||E.labelCommandReadModel}:n?{index:j(t,100,200),label:E.labelCommandReadModelPrefix+n}:{index:100,label:E.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||E.labelEvents}:n?{index:j(t,200,300),label:E.labelEventsPrefix+n}:{index:200,label:E.labelEvents}}}h(M,`calculateSwimlaneProps`);function N(e){let{themeVariables:t}=o();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}h(N,`calculateEntityVisualProps`);function P(e,t,n){let r=o(),i=_(k(e.entityIdentifier)??``,r),a,s={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},c=`<b>${d(i,n.textMaxWidth,s)}</b>`;if(e.dataInlineValue&&(a=e.dataInlineValue,a=a.substring(a.indexOf(`{`)+1),a=a.substring(0,a.lastIndexOf(`}`)-1),a=_(a,r),a=d(a,n.textMaxWidth,s),a=a.replaceAll(` `,`&nbsp;`)),e.dataReference){let i=t.find(t=>t.name===e.dataReference?.$refText);i&&(a=i.dataBlockValue,a=a.substring(a.indexOf(`{
2
+ `)+2),a=a.substring(0,a.lastIndexOf(`}`)-1),a=_(a,r),a=d(a,n.textMaxWidth,s),a=a.replaceAll(` `,`&nbsp;`),a+=`<br/>`)}let u=a!==void 0;u&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${a}</code>`);let f={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},p=l(c,f),h=u?p.width/3:p.width,g={content:c,width:h,height:p.height};return m.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}h(P,`calculateTextProps`);function F(e,t){let n=t,r=N(n.frame),i={width:n.textProps.width+2*E.boxTextPadding,height:n.textProps.height+2*E.boxTextPadding};return[{$kind:y,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}h(F,`decidePositionFrame`);function I(e,t,n){return t===void 0?E.contentStartX:t.index===e.index&&e.r?e.r+E.boxPadding:n===void 0?E.contentStartX:n.r-E.boxOverlap+E.boxPadding}h(I,`calculateX`);function L(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}h(L,`calculateMaxRight`);function R(e){return Object.values(e).sort((e,t)=>e.index-t.index)}h(R,`sortedSwimlanesArray`);function z(e,t){let n=t,r=M(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*E.swimlaneMinHeight+E.swimlaneGap,height:E.swimlaneMinHeight,maxHeight:E.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(E.boxMinWidth,Math.min(E.boxMaxWidth,n.dimension.width))+2*E.boxPadding,height:Math.max(E.boxMinHeight,Math.min(E.boxMaxHeight,n.dimension.height))+2*E.boxPadding},c=I(i,o,a),l=c+s.width+E.boxPadding,u=L(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(E.swimlaneMinHeight,i.maxHeight)+2*E.swimlanePadding;let d={x:c,y:E.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=R(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e<p.length;e++){let t=p[e],n=p[e-1];t.y=n.y+n.height+E.swimlaneGap}return f}h(z,`evolveFramePositioned`);function B(e,t){return e===0&&t.sourceFrames.length===0}h(B,`isFirstFrame`);function V(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}h(V,`hasSourceFrame`);function H(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}h(H,`findBoxByFrame`);function U(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}h(U,`findBoxByLineIndex`);function W(e,t){let n=t;if(te(n.frame)||B(n.index,n.frame))return[];let r=H(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let i;return i=n.sourceFrame?H(e.boxes,n.sourceFrame):U(e.boxes,r.swimlane.index,n.index-1),i===void 0?[]:[{$kind:x,frame:n.frame,index:n.index,sourceBox:i,targetBox:r}]}h(W,`decidePositionRelation`);function G(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}h(G,`evolveRelationPositioned`);var le={[v]:F,[b]:W},ue={[y]:z,[x]:G};function K(e,t){let n=le[t.$kind];if(n==null)return[];let r=n(e,t);return m.debug(`decided events`,r),r}h(K,`decide`);function q(e,t){let n=t.reduce((e,t)=>{let n=ue[t.$kind];return n==null?e:n(e,t)},e);return m.debug(`evolve events`,{state:e,newState:n,events:t}),n}h(q,`evolve`);function J(e,t){return q(e,K(e,t))}h(J,`dispatch`);var Y={getConfig:se,setOptions:re,getOptions:ie,clear:ae,setAccTitle:f,getAccTitle:i,getAccDescription:r,setAccDescription:a,setDiagramTitle:p,getDiagramTitle:ee,setAst:T,getDiagramProps:D,getState:w},de={parse:h(async t=>{let n=await ne(`eventmodeling`,t);m.debug(n),Y.setAst(n),e(n,Y)},`parse`)},fe=u()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}h(X,`renderD3Box`);function Z(e,t){return e>t}h(Z,`dirUpwards`);function Q(e,t,n,r){return i=>{let a=i.sourceBox.swimlane.y+t.swimlanePadding,o=i.targetBox.swimlane.y+t.swimlanePadding,s=Z(a,o),c=i.sourceBox.x+i.sourceBox.dimension.width*2/3,l=i.targetBox.x+i.targetBox.dimension.width/3,u,d;m.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(u=a,d=o+i.targetBox.dimension.height):(u=a+i.sourceBox.dimension.height,d=o);let f=r.emRelationStroke??i.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,i.visual.fill).attr(`stroke`,f).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${n})`).attr(`d`,`M${c} ${u} L${l} ${d}`)}}h(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}h($,`renderD3Swimlane`);var pe={parser:de,db:Y,renderer:{draw:h(function(e,r,i,a){if(m.debug(`in eventmodeling renderer`,e+`
3
+ `,`id:`,r,i),!fe)throw Error(`EventModeling config not found`);let o=a.db,{themeVariables:s,eventmodeling:c}=u(),l=n(`[id="${r}"]`),d=o.getDiagramProps(),f=o.getState(),p=`em-arrowhead-${r}`,h=s.emArrowhead??`#000000`;f.sortedSwimlanesArray.forEach($(l,f.maxR,d,s)),f.boxes.forEach(X(l,d)),f.relations.forEach(Q(l,d,p,s)),l.append(`defs`).append(`marker`).attr(`id`,p).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),t(void 0,l,c?.padding??30,c?.useMaxWidth)},`draw`)},styles:h(e=>``,`getStyles`)};export{pe as diagram};
@@ -0,0 +1,24 @@
1
+ import{t as e}from"./chunk-JWPE2WC7-DL2sZ8xq.js";import{At as t,Bn as n,En as r,Fn as i,In as a,Jn as o,Ln as s,Lt as c,Mn as l,Pn as u,Yn as d,Zn as f,cr as p,dr as m,jt as h,kn as g,xn as _,zn as v}from"./mermaid.core-DTGmDhfV.js";import{t as y}from"./chunk-POPQ4Y6H-BBYxqD_7.js";import{n as b}from"./mermaid-parser.core-BX15ctWm.js";import{r as x,y as S}from"./d3-scale-okpWUcMn.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function ee(e){for(var t=this,n=j(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function j(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function M(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function N(){return Array.from(this)}function P(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function F(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*I(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function L(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=B)):t===void 0&&(t=z);for(var n=new U(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new U(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(H)}function R(){return L(this).eachBefore(V)}function z(e){return e.children}function B(e){return Array.isArray(e)?e[1]:null}function V(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function H(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=L.prototype={constructor:U,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:ee,ancestors:M,descendants:N,leaves:P,links:F,copy:R,[Symbol.iterator]:I};function W(e){if(typeof e!=`function`)throw Error();return e}function G(){return 0}function K(e){return function(){return e}}function te(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function q(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}Object.create(U.prototype);function J(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var Y=(1+Math.sqrt(5))/2;function X(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?q(c,n,r,i,h?r+=m*g/h:a):J(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var ne=(function e(t){function n(e,n,r,i,a){X(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(Y);function re(){var e=ne,t=!1,n=1,r=1,i=[0],a=G,o=G,s=G,c=G,l=G;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(te),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=W(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:K(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:K(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:K(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:K(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:K(+e),u):l},u}(function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u<f;){for(s=o[u],c=s.children,l=s.value=0,d=c.length;l<d;++l)s.value+=c[l].value;s.dice?q(s,n,r,i,p?r+=(a-r)*s.value/p:a):J(s,n,r,p?n+=(i-n)*s.value/p:i,a),p-=s.value}else e._squarify=o=X(t,e,n,r,i,a),o.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(Y);var Z=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=d,this.getAccTitle=a,this.setDiagramTitle=f,this.getDiagramTitle=v,this.getAccDescription=i,this.setAccDescription=o}static{m(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=u,t=s();return c({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,n){let r=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=n.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);i&&i.forEach(e=>{t(e)&&(r?.textStyles?r.textStyles.push(e):r.textStyles=[e]),r?.styles?r.styles.push(e):r.styles=[e]}),this.classes.set(e,r)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){g(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function ie(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}m(ie,`buildHierarchy`);var ae=m((t,n)=>{e(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=oe(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=ie(r),a=m((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),oe=m(e=>e.name?String(e.name):``,`getItemName`),se={parser:{yy:void 0},parse:m(async e=>{try{let t=await b(`treemap`,e);p.debug(`Treemap AST:`,t);let n=se.parser?.yy;if(!(n instanceof Z))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);ae(t,n)}catch(e){throw p.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:m((e,t,n,i)=>{let a=i.db,o=a.getConfig(),c=o.padding??ce,u=a.getDiagramTitle(),d=a.getRoot(),{themeVariables:f}=s();if(!d)return;let g=u?30:0,v=_(t),b=o.nodeWidth?o.nodeWidth*Q:960,C=o.nodeHeight?o.nodeHeight*Q:500,w=b,T=C+g;v.attr(`viewBox`,`0 0 ${w} ${T}`),l(v,T,w,o.useMaxWidth);let E;try{let e=o.valueFormat||`,`;if(e===`$0,0`)E=m(e=>`$`+S(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let t=/\.\d+/.exec(e),n=t?t[0]:``;E=m(e=>`$`+S(`,`+n)(e),`valueFormat`)}else if(e.startsWith(`$`)){let t=e.substring(1);E=m(e=>`$`+S(t||``)(e),`valueFormat`)}else E=S(e)}catch(e){p.error(`Error creating format function:`,e),E=S(`,`)}let D=x().range([`transparent`,f.cScale0,f.cScale1,f.cScale2,f.cScale3,f.cScale4,f.cScale5,f.cScale6,f.cScale7,f.cScale8,f.cScale9,f.cScale10,f.cScale11]),O=x().range([`transparent`,f.cScalePeer0,f.cScalePeer1,f.cScalePeer2,f.cScalePeer3,f.cScalePeer4,f.cScalePeer5,f.cScalePeer6,f.cScalePeer7,f.cScalePeer8,f.cScalePeer9,f.cScalePeer10,f.cScalePeer11]),k=x().range([f.cScaleLabel0,f.cScaleLabel1,f.cScaleLabel2,f.cScaleLabel3,f.cScaleLabel4,f.cScaleLabel5,f.cScaleLabel6,f.cScaleLabel7,f.cScaleLabel8,f.cScaleLabel9,f.cScaleLabel10,f.cScaleLabel11]);u&&v.append(`text`).attr(`x`,w/2).attr(`y`,g/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(u);let A=v.append(`g`).attr(`transform`,`translate(0, ${g})`).attr(`class`,`treemapContainer`),ee=L(d).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),j=re().size([b,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(c).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(ee),M=j.descendants().filter(e=>e.children&&e.children.length>0),N=A.selectAll(`.treemapSection`).data(M).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);N.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),N.append(`clipPath`).attr(`id`,(e,n)=>`clip-section-${t}-${n}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),N.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=h({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),N.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,n)=>`url(#clip-section-${t}-${n})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+h({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=r(this),n=e.data.name;t.text(n);let i=e.x1-e.x0,a;a=o.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let s=Math.max(15,a),c=t.node();if(c.getComputedTextLength()>s){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),c.getComputedTextLength()>s&&t.text(``);break}if(t.text(e+`...`),c.getComputedTextLength()<=s)break}}}),o.showValues!==!1&&N.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+h({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let P=j.leaves(),F=P.length>20,I=F?16:38,R=F?14:28,z=F?4:8,B=F?4:6,V=F?2:4,H=F?8:10,U=F?1:2,W=A.selectAll(`.treemapLeafGroup`).data(P).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);W.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>h({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),W.append(`clipPath`).attr(`id`,(e,n)=>`clip-${t}-${n}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),W.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${I}px;fill:`+k(e.data.name)+`;`+h({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,n)=>`url(#clip-${t}-${n})`).text(e=>e.data.name).each(function(e){let t=r(this),n=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=n-2*V,s=i-2*V;if(o<H||s<H){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>z;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(B,Math.min(R,Math.round(c*l))),d=c+U+u;for(;d>s&&c>z&&(c--,u=Math.max(B,Math.min(R,Math.round(c*l))),!(u<B&&c===z));)t.style(`font-size`,`${c}px`),d=c+U+u;t.style(`font-size`,`${c}px`),F?(c<z||s<z)&&t.style(`display`,`none`):(a.getComputedTextLength()>o||c<z||s<c)&&t.style(`display`,`none`)}),o.showValues!==!1&&W.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${R}px;fill:`+k(e.data.name)+`;`+h({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,n)=>`url(#clip-${t}-${n})`).text(e=>e.value?E(e.value):``).each(function(e){let t=r(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let i=r(n).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(B,Math.min(R,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+U;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*V;t.node().getComputedTextLength()>u||s+o>l||o<B?t.style(`display`,`none`):t.style(`display`,null)});let G=o.diagramPadding??8;y(v,G,`flowchart`,o?.useMaxWidth||!1)},`draw`),getClasses:m(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:se,get db(){return new Z},renderer:le,styles:m(({treemap:e}={})=>{let t=n(),r=s(),i=c(t,r.themeVariables),a=c(ue,e),o=a.titleColor??i.titleColor,l=a.labelColor??i.textColor,u=a.valueColor??i.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${a.sectionStrokeColor};
4
+ stroke-width: ${a.sectionStrokeWidth};
5
+ fill: ${a.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${a.leafStrokeColor};
9
+ stroke-width: ${a.leafStrokeWidth};
10
+ fill: ${a.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${l};
14
+ font-size: ${a.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${u};
18
+ font-size: ${a.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${o};
22
+ font-size: ${a.titleFontSize};
23
+ }
24
+ `},`getStyles`)};export{de as diagram};
@@ -0,0 +1,24 @@
1
+ import{t as e}from"./chunk-JWPE2WC7-DL2sZ8xq.js";import{Fn as t,In as n,Jn as r,Ln as i,Lt as a,Mn as o,Pn as s,Yn as c,Zn as l,cr as u,dr as d,kn as f,xn as p,zn as m}from"./mermaid.core-DTGmDhfV.js";import{n as h}from"./mermaid-parser.core-BX15ctWm.js";var g=s.packet,_=class{constructor(){this.packet=[],this.setAccTitle=c,this.getAccTitle=n,this.setDiagramTitle=l,this.getDiagramTitle=m,this.getAccDescription=t,this.setAccDescription=r}static{d(this,`PacketDB`)}getConfig(){let e=a({...g,...i().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){f(),this.packet=[]}},v=1e4,y=d((t,n)=>{e(t,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:e,end:s,bits:c,label:l}of t.blocks){if(e!==void 0&&s!==void 0&&s<e)throw Error(`Packet block ${e} - ${s} is invalid. End must be greater than start.`);if(e??=r+1,e!==r+1)throw Error(`Packet block ${e} - ${s??e} is not contiguous. It should start from ${r+1}.`);if(c===0)throw Error(`Packet block ${e} is invalid. Cannot have a zero bit field.`);for(s??=e+(c??1)-1,c??=s-e+1,r=s,u.debug(`Packet block ${e} - ${r} with label ${l}`);i.length<=o+1&&n.getPacket().length<v;){let[t,r]=b({start:e,end:s,bits:c,label:l},a,o);if(i.push(t),t.end+1===a*o&&(n.pushWord(i),i=[],a++),!r)break;({start:e,end:s,bits:c,label:l}=r)}}n.pushWord(i)},`populate`),b=d((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:d(async e=>{let t=await h(`packet`,e),n=x.parser?.yy;if(!(n instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);u.debug(t),y(t,n)},`parse`)},S=d((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:s,paddingY:c,bitWidth:l,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),m=s+c,h=m*(d.length+1)-(f?0:s),g=l*u+2,_=p(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),o(_,h,g,a.useMaxWidth);for(let[e,t]of d.entries())C(_,t,e,a);_.append(`text`).text(f).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=d((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:d(({packet:e}={})=>{let t=a(T,e);return`
2
+ .packetByte {
3
+ font-size: ${t.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${t.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${t.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${t.labelColor};
13
+ font-size: ${t.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${t.titleColor};
17
+ font-size: ${t.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${t.blockStrokeColor};
21
+ stroke-width: ${t.blockStrokeWidth};
22
+ fill: ${t.blockFillColor};
23
+ }
24
+ `},`styles`)};export{E as diagram};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./chunk-SVP7TREG-CykZJApb.js";import{t as r}from"./chunk-JWPE2WC7-DL2sZ8xq.js";import{cr as i,dr as a}from"./mermaid.core-DTGmDhfV.js";import{f as o,t as s}from"./mermaid-parser.core-BX15ctWm.js";var c=o().RailroadEbnf.parser.LangiumParser,l=a(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformChoice`),u=a(e=>{let t=e.elements.map(p);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=a(e=>{switch(e.$type){case`EbnfTerminal`:return{type:`terminal`,value:e.value};case`EbnfNonTerminal`:return{type:`nonterminal`,name:e.name};case`EbnfSpecial`:return{type:`special`,text:e.text};case`EbnfGroup`:return l(e.element);case`EbnfOptional`:return{type:`optional`,element:l(e.element)};case`EbnfRepetition`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${e.$type}`)}},`transformPrimary`),f=a((e,t)=>{switch(t.$type){case`EbnfOptionalPostfix`:return{type:`optional`,element:e};case`EbnfZeroOrMorePostfix`:return{type:`repetition`,element:e,min:0,max:1/0};case`EbnfOneOrMorePostfix`:return{type:`repetition`,element:e,min:1,max:1/0};case`EbnfExceptionPostfix`:return{type:`sequence`,elements:[e,{type:`terminal`,value:`-`},d(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},`transformPostfix`),p=a(e=>e.postfixes.reduce((e,t)=>f(e,t),d(e.base)),`transformTerm`),m=a(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=a(e=>{r(e,n),e.title&&n.setTitle(e.title),e.rules.map(e=>n.addRule(m(e)))},`populateDb`),g={parser:{parse:a(e=>{n.clear(),i.debug(`[EBNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;i.debug(`[EBNF Parser] Parsed rules:`,r.rules.length),h(r),i.debug(`[EBNF Parser] Parse complete`)},`parse`),parser:{yy:n}},db:n,renderer:t,styles:e};export{g as diagram};
@@ -0,0 +1,99 @@
1
+ import{t as e}from"./chunk-XXDRQBXY-D1ybtwL8.js";import{t}from"./channel-BaeyAqOu.js";import{t as n}from"./chunk-POPQ4Y6H-BBYxqD_7.js";import{En as r,Fn as i,In as a,Jn as o,Rn as s,Ut as c,Yn as l,Zn as u,ar as d,cr as f,d as p,dr as m,jn as h,kn as g,u as _,ur as v,zn as y,zt as b}from"./mermaid.core-DTGmDhfV.js";var x=(function(){var e=m(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],n=[2,2],r=[1,7],i=[1,9],a=[1,10],o=[1,11],s=[1,12],c=[1,30],l=[1,23],u=[1,24],d=[1,25],f=[1,26],p=[1,27],h=[1,19],g=[1,28],_=[1,29],v=[1,20],y=[1,18],b=[1,21],x=[1,22],S=[2,6],C=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],w=[1,36],T=[1,37],E=[1,38],D=[1,39],O=[1,40],k=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],A=[1,46],j=[1,47],M=[1,57],N=[43,51,53,54,55,74,75],P=[1,70],F=[1,68],I=[1,65],L=[1,69],R=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],B=[1,78],V=[1,77],H=[1,76],U=[69,70,71,72,73],W=[1,91],G=[6,9,45,50],K=[6,9,12,44,45,50,51,52],q=[1,101],J=[1,100],Y=[1,99],X=[18,61],ee=[1,110],te=[1,109],ne=[20,43,51,53,54,55],Z=[18,61,64,66],Q={trace:m(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,9:`NEWLINE`,12:`COLON`,14:`STYLE_SEPARATOR`,16:`BLOCK_START`,18:`BLOCK_STOP`,19:`SQS`,20:`SQE`,21:`title`,22:`title_value`,23:`acc_title`,24:`acc_title_value`,25:`acc_descr`,26:`acc_descr_value`,27:`acc_descr_multiline_value`,33:`END`,34:`SUBGRAPH`,37:`direction_tb`,38:`direction_bt`,39:`direction_rl`,40:`direction_lr`,41:`CLASSDEF`,43:`UNICODE_TEXT`,44:`STYLE_TEXT`,45:`COMMA`,46:`CLASS`,47:`STYLE`,50:`SEMI`,51:`NUM`,52:`BRKT`,53:`ENTITY_NAME`,54:`DECIMAL_NUM`,55:`ENTITY_ONE`,61:`ATTRIBUTE_WORD`,62:`?`,64:`,`,65:`ATTRIBUTE_KEY`,66:`COMMENT`,69:`ZERO_OR_ONE`,70:`ZERO_OR_MORE`,71:`ONE_OR_MORE`,72:`ONLY_ONE`,73:`MD_PARENT`,74:`NON_IDENTIFYING`,75:`IDENTIFYING`,76:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:m(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:this.$=a[s-1].concat(a[s]);break;case 4:this.$=a[s];break;case 5:case 6:this.$=[];break;case 7:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]),this.$=[a[s-4],a[s-2]];break;case 8:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-8],a[s-4]];break;case 9:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]),this.$=[a[s-6],a[s-2]];break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-6],a[s-4]];break;case 11:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]),this.$=[a[s-3]];break;case 12:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]),this.$=[a[s-5]];break;case 13:r.addEntity(a[s-2]),this.$=[a[s-2]];break;case 14:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-4]];break;case 15:r.addEntity(a[s]),this.$=[a[s]];break;case 16:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]),this.$=[a[s-2]];break;case 17:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]),this.$=[a[s-6]];break;case 18:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]),this.$=[a[s-8]];break;case 19:r.addEntity(a[s-5],a[s-3]),this.$=[a[s-5]];break;case 20:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]),this.$=[a[s-7]];break;case 21:r.addEntity(a[s-3],a[s-1]);break;case 22:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 23:case 24:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 25:case 26:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 27:r.subgraphDepth?this.$=a[s]:(r.setDirection(a[s].value),this.$=[]);break;case 31:r.subgraphDepth=(r.subgraphDepth||1)-1,this.$=r.addSubGraph({text:a[s-2].id},a[s-1],{text:a[s-2].text});break;case 32:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-1],text:a[s-1]};break;case 33:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-4],text:a[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=a[s];break;case 35:this.$=a[s-1]+` `+a[s];break;case 36:this.$={stmt:`dir`,value:`TB`};break;case 37:this.$={stmt:`dir`,value:`BT`};break;case 38:this.$={stmt:`dir`,value:`RL`};break;case 39:this.$={stmt:`dir`,value:`LR`};break;case 40:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 41:case 42:case 63:case 72:this.$=[a[s]];break;case 43:case 44:this.$=a[s-2].concat([a[s]]);break;case 45:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 46:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 47:this.$=[a[s]];break;case 48:a[s-2].push(a[s]),this.$=a[s-2];break;case 50:this.$=a[s-1]+a[s];break;case 58:case 84:case 85:this.$=a[s].replace(/"/g,``);break;case 64:a[s].push(a[s-1]),this.$=a[s];break;case 65:this.$={type:a[s-1],name:a[s]};break;case 66:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 67:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 68:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 69:case 71:case 74:this.$=a[s];break;case 70:this.$=a[s-1]+a[s];break;case 73:a[s-2].push(a[s]),this.$=a[s-2];break;case 75:this.$=a[s].replace(/"/g,``);break;case 76:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 77:this.$=r.Cardinality.ZERO_OR_ONE;break;case 78:this.$=r.Cardinality.ZERO_OR_MORE;break;case 79:this.$=r.Cardinality.ONE_OR_MORE;break;case 80:this.$=r.Cardinality.ONLY_ONE;break;case 81:this.$=r.Cardinality.MD_PARENT;break;case 82:this.$=r.Identification.NON_IDENTIFYING;break;case 83:this.$=r.Identification.IDENTIFYING}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,n,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:i,23:a,25:o,27:s,28:13,29:14,30:15,31:16,32:17,34:c,37:l,38:u,39:d,40:f,41:p,43:h,46:g,47:_,51:v,53:y,54:b,55:x},e(t,S,{1:[2,1]}),e(C,[2,3]),e(C,[2,4]),e(C,[2,5]),e(C,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:w,70:T,71:E,72:D,73:O}),{22:[1,41]},{24:[1,42]},{26:[1,43]},e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,30]),e(C,n,{5:44}),e(k,[2,58]),e(k,[2,59]),e(k,[2,60]),e(k,[2,61]),e(k,[2,62]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),e(C,[2,39]),{15:45,43:A,44:j},{15:48,43:A,44:j},{15:49,43:A,44:j},{10:50,43:h,51:v,53:y,54:b,55:x},{10:51,43:h,51:v,53:y,54:b,55:x},{15:52,43:A,44:j},{17:53,18:[1,54],56:55,57:56,61:M},{10:58,43:h,51:v,53:y,54:b,55:x},{68:59,74:[1,60],75:[1,61]},e(N,[2,77]),e(N,[2,78]),e(N,[2,79]),e(N,[2,80]),e(N,[2,81]),e(C,[2,23]),e(C,[2,24]),e(C,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:i,23:a,25:o,27:s,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:c,37:l,38:u,39:d,40:f,41:p,43:h,46:g,47:_,51:v,53:y,54:b,55:x},{12:P,42:64,44:F,45:I,48:66,49:67,51:L,52:R},e(z,[2,41]),e(z,[2,42]),{15:72,43:A,44:j,45:I},{12:P,42:73,44:F,45:I,48:66,49:67,51:L,52:R},{6:B,9:V,19:[1,75],35:74,50:H},{12:[1,79],14:[1,80]},e(C,[2,16],{67:35,11:81,16:[1,82],45:I,69:w,70:T,71:E,72:D,73:O}),{18:[1,83]},e(C,[2,13]),{17:84,18:[2,63],56:55,57:56,61:M},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:w,70:T,71:E,72:D,73:O},e(U,[2,82]),e(U,[2,83]),e(C,[2,31]),e(C,S),{6:B,9:V,35:90,45:W,50:H},{43:[1,92],44:[1,93]},e(G,[2,47],{49:94,12:P,44:F,51:L,52:R}),e(K,[2,49]),e(K,[2,54]),e(K,[2,55]),e(K,[2,56]),e(K,[2,57]),e(C,[2,45],{45:I}),{6:B,9:V,35:95,45:W,50:H},e(C,[2,32]),{10:97,36:96,43:h,51:v,53:y,54:b,55:x},e(C,[2,51]),e(C,[2,52]),e(C,[2,53]),{13:98,43:q,53:J,76:Y},{15:102,43:A,44:j},{10:103,43:h,51:v,53:y,54:b,55:x},{17:104,18:[1,105],56:55,57:56,61:M},e(C,[2,11]),{18:[2,64]},e(X,[2,65],{59:106,60:107,63:108,65:ee,66:te}),e([18,61,65,66],[2,71]),{61:[2,70]},e(C,[2,21],{14:[1,112],16:[1,111]}),e([43,51,53,54,55],[2,76]),e(C,[2,40]),{12:P,44:F,48:113,49:67,51:L,52:R},e(z,[2,43]),e(z,[2,44]),e(K,[2,50]),e(C,[2,46]),{10:115,20:[1,114],43:h,51:v,53:y,54:b,55:x},e(ne,[2,34]),e(C,[2,7]),e(C,[2,84]),e(C,[2,85]),e(C,[2,86]),{12:[1,116],45:I},{12:[1,118],14:[1,117]},{18:[1,119]},e(C,[2,14]),e(X,[2,66],{60:120,64:[1,121],66:te}),e(X,[2,67]),e(Z,[2,72]),e(X,[2,75]),e(Z,[2,74]),{17:122,18:[1,123],56:55,57:56,61:M},{15:124,43:A,44:j},e(G,[2,48],{49:94,12:P,44:F,51:L,52:R}),{6:B,9:V,35:125,50:H},e(ne,[2,35]),{13:126,43:q,53:J,76:Y},{15:127,43:A,44:j},{13:128,43:q,53:J,76:Y},e(C,[2,12]),e(X,[2,68]),{63:129,65:ee},{18:[1,130]},e(C,[2,19]),e(C,[2,22],{16:[1,131],45:I}),e(C,[2,33]),e(C,[2,10]),{12:[1,132],45:I},e(C,[2,9]),e(Z,[2,73]),e(C,[2,17]),{17:133,18:[1,134],56:55,57:56,61:M},{13:135,43:q,53:J,76:Y},{18:[1,136]},e(C,[2,20]),e(C,[2,8]),e(C,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:m(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:m(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,d=2,f=1,p=a.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;a.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}m(b,`popStack`);function x(){var e=r.pop()||h.lex()||f;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}m(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=o[w]&&o[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],o[w])this.terminals_[O]&&O>d&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(c+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(S==f?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(h.yytext),a.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(l=h.yyleng,s=h.yytext,c=h.yylineno,v=h.yylloc,u>0&&u--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,l,c,g.yy,T[1],i,a].concat(p)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};Q.lexer=(function(){return{EOF:1,parseError:m(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:m(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:m(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:m(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:m(function(){return this._more=!0,this},`more`),reject:m(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:m(function(e){this.unput(this.match.slice(e))},`less`),pastInput:m(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:m(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:m(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:m(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:m(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:m(function(){return this.next()||this.lex()},`lex`),begin:m(function(e){this.conditionStack.push(e)},`begin`),popState:m(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:m(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:m(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:m(function(e){this.begin(e)},`pushState`),stateStackSize:m(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:m(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),23;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),25;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin(`block`),16;case 17:case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:case 25:return 61;case 26:this.begin(`block_bq`);break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return t.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin(`style`),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin(`style`),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:case 47:case 48:return 71;case 49:case 50:return 69;case 51:case 52:case 53:case 54:case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:case 60:return 72;case 61:return 54;case 62:case 63:case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:case 74:return 75;case 75:case 76:case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return t.yytext[0];case 82:return 6}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}})();function $(){this.yy={}}return m($,`Parser`),$.prototype=Q,Q.Parser=$,new $})();x.parser=x;var S=x,C=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction=`TB`,this.Cardinality={ZERO_OR_ONE:`ZERO_OR_ONE`,ZERO_OR_MORE:`ZERO_OR_MORE`,ONE_OR_MORE:`ONE_OR_MORE`,ONLY_ONE:`ONLY_ONE`,MD_PARENT:`MD_PARENT`},this.Identification={NON_IDENTIFYING:`NON_IDENTIFYING`,IDENTIFYING:`IDENTIFYING`},this.setAccTitle=l,this.getAccTitle=a,this.setAccDescription=o,this.getAccDescription=i,this.setDiagramTitle=u,this.getDiagramTitle=y,this.getConfig=m(()=>s().er,`getConfig`),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{m(this,`ErDB`)}addEntity(e,t=``){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,f.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:`erBox`,look:s().look??`default`,cssClasses:`default`,cssStyles:[],labelType:`markdown`}),f.info(`Added new entity :`,e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){let n=this.addEntity(e),r;for(r=t.length-1;r>=0;r--)t[r].keys||(t[r].keys=[]),t[r].comment||(t[r].comment=``),n.attributes.push(t[r]),f.debug(`Added attribute `,t[r].name)}addRelationship(e,t,n,r){let i;if(this.subGraphLookup.has(e))i=e;else{let t=this.addEntity(e);if(!t)return;i=t.id}let a;if(this.subGraphLookup.has(n))a=n;else{let e=this.addEntity(n);if(!e)return;a=e.id}let o={entityA:i,roleA:t,entityB:a,relSpec:r};this.relationships.push(o),f.debug(`Added new relationship :`,o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(let n of e){let e=this.entities.get(n),r=this.subGraphLookup.get(n);if(t){if(e)for(let n of t)e.cssStyles.push(n);if(r){r.cssStyles||=[];for(let e of t)r.cssStyles.push(e)}}}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);n===void 0&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){let t=e.replace(`fill`,`bgFill`);n.textStyles.push(t)}n.styles.push(e)})})}addSubGraph(e,t,n){let r=e.text.trim(),i=n.text,a=m(e=>{let t=new Set,n;return{nodeList:e.filter(e=>{if(e?.stmt)return e.stmt===`dir`&&(n=e.value),!1;if(typeof e!=`string`)return!1;let r=e.trim();return!r||t.has(r)?!1:(t.add(r),!0)}),dir:n}},`uniq`)(t.flat()),o=a.nodeList,s=a.dir;r??=`subGraph`+this.subCount,i||=``,i=this.sanitizeText(i),this.subCount+=1;let c={id:r,nodes:o,title:i.trim(),classes:[],cssStyles:[],dir:s,labelType:this.sanitizeNodeLabelType(n?.type)};return f.info(`Adding`,c.id,c.nodes,c.dir),c.nodes=this.makeUniq(c,this.subGraphs).nodes,this.subGraphs.push(c),this.subGraphLookup.set(r,c),r}getSubGraphs(){return this.subGraphs}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subGraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}subgraphNodeCache(e){let t=new Set;for(let n of e)for(let e of n.nodes)t.add(e);return t}makeUniq(e,t){let n=this.subgraphNodeCache(t),r=[];return e.nodes.forEach((t,i)=>{n.has(t)?f.warn(`Entity '${t}' already belongs to another subgraph and will be ignored`):r.push(e.nodes[i])}),{nodes:r}}sanitizeText(e){return h.sanitizeText(e,s())}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,g()}getData(){let e=[],t=[],n=s(),r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){let t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)i.set(e,t.id)}for(let t=r.length-1;t>=0;t--){let a=r[t];e.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssStyles:a.cssStyles,cssClasses:a.classes.join(` `),shape:`rect`,dir:a.dir,isGroup:!0,look:n.look})}let o=new Set(r.map(e=>e.id)),c=0;for(let t of this.entities.keys()){if(o.has(t))continue;let n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(` `)),n.colorIndex=c++,e.push({...n,parentId:i.get(t),isGroup:!1}))}let l=0;for(let e of this.relationships){let r={id:b(e.entityA,e.entityB,{prefix:`id`,counter:l++}),type:`normal`,curve:`basis`,start:e.entityA,end:e.entityB,label:e.roleA,labelpos:`c`,thickness:`normal`,classes:`relationshipLine`,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType==`IDENTIFYING`?`solid`:`dashed`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.direction}}},w={};v(w,{draw:()=>T});var T=m(async function(t,i,a,o){f.info(`REF0:`),f.info(`Drawing er diagram (unified)`,i);let{securityLevel:l,er:u,layout:d}=s(),m=o.db.getData(),h=e(i,l);m.type=o.type,m.layoutAlgorithm=_(d),m.config.flowchart.nodeSpacing=u?.nodeSpacing||140,m.config.flowchart.rankSpacing=u?.rankSpacing||80,m.direction=o.db.getDirection();let{config:g}=m,{look:v}=g;m.markers=v===`neo`?[`only_one_neo`,`zero_or_one_neo`,`one_or_more_neo`,`zero_or_more_neo`]:[`only_one`,`zero_or_one`,`one_or_more`,`zero_or_more`],m.diagramId=i,await p(m,h),m.layoutAlgorithm===`elk`&&h.select(`.edges`).lower();let y=h.selectAll(`[id*="-background"]`);Array.from(y).length>0&&y.each(function(){let e=r(this),t=e.attr(`id`).replace(`-background`,``),n=h.select(`#${CSS.escape(t)}`);if(!n.empty()){let t=n.attr(`transform`);e.attr(`transform`,t)}}),c.insertTitle(h,`erDiagramTitleText`,u?.titleTopMargin??25,o.db.getDiagramTitle()),n(h,8,`erDiagram`,u?.useMaxWidth??!0)},`draw`),E=m((e,n)=>{let r=t,i=r(e,`r`),a=r(e,`g`),o=r(e,`b`);return d(i,a,o,n)},`fade`),D=new Set([`redux-color`,`redux-dark-color`]),O=m(e=>{let{theme:t,look:n,bkgColorArray:r,borderColorArray:i}=e;if(!D.has(t))return``;let a=r?.length>0,o=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)o+=`
7
+
8
+ [data-look="${n}"][data-color-id="color-${t}"].node path {
9
+ stroke: ${i[t]};
10
+ ${a?`fill: ${r[t]};`:``}
11
+ }
12
+
13
+ [data-look="${n}"][data-color-id="color-${t}"].node rect {
14
+ stroke: ${i[t]};
15
+ ${a?`fill: ${r[t]};`:``}
16
+ }
17
+ `;return o},`genColor`),k={parser:S,get db(){return new C},renderer:w,styles:m(e=>{let{look:t,theme:n,erEdgeLabelBackground:r,strokeWidth:i}=e;return`
18
+ ${O(e)}
19
+ .entityBox {
20
+ fill: ${e.mainBkg};
21
+ stroke: ${e.nodeBorder};
22
+ }
23
+
24
+ .relationshipLabelBox {
25
+ fill: ${e.tertiaryColor};
26
+ opacity: 0.7;
27
+ background-color: ${e.tertiaryColor};
28
+ rect {
29
+ opacity: 0.5;
30
+ }
31
+ }
32
+
33
+ .labelBkg {
34
+ background-color: ${D.has(n)&&r?r:E(e.tertiaryColor,.5)};
35
+ }
36
+
37
+ .edgeLabel {
38
+ background-color: ${D.has(n)&&r?r:e.edgeLabelBackground};
39
+ }
40
+ .edgeLabel .label rect {
41
+ fill: ${D.has(n)&&r?r:e.edgeLabelBackground};
42
+ }
43
+ .edgeLabel .label text {
44
+ fill: ${e.textColor};
45
+ }
46
+
47
+ .edgeLabel .label {
48
+ fill: ${e.nodeBorder};
49
+ font-size: 14px;
50
+ }
51
+
52
+ .label {
53
+ font-family: ${e.fontFamily};
54
+ color: ${e.nodeTextColor||e.textColor};
55
+ }
56
+
57
+ .edge-pattern-dashed {
58
+ stroke-dasharray: 8,8;
59
+ }
60
+
61
+ .node rect,
62
+ .node circle,
63
+ .node ellipse,
64
+ .node polygon
65
+ {
66
+ fill: ${e.mainBkg};
67
+ stroke: ${e.nodeBorder};
68
+ stroke-width: ${t===`neo`?i:`1px`};
69
+ }
70
+
71
+ .relationshipLine {
72
+ stroke: ${e.lineColor};
73
+ stroke-width: ${t===`neo`?i:`1px`};
74
+ fill: none;
75
+ }
76
+
77
+ .marker {
78
+ fill: none !important;
79
+ stroke: ${e.lineColor} !important;
80
+ stroke-width: 1;
81
+ }
82
+ [data-look=neo].labelBkg {
83
+ background-color: ${E(e.tertiaryColor,.5)};
84
+ }
85
+
86
+ .cluster rect {
87
+ fill: ${e.clusterBkg??e.mainBkg};
88
+ stroke: ${e.clusterBorder??e.nodeBorder};
89
+ stroke-width: 1px;
90
+ }
91
+
92
+ .cluster text {
93
+ fill: ${e.titleColor??e.textColor};
94
+ }
95
+
96
+ .cluster-label text {
97
+ fill: ${e.titleColor??e.textColor};
98
+ }
99
+ `},`getStyles`)};export{k as diagram};
@@ -0,0 +1 @@
1
+ export{O as createEventModelingServices}from"./mermaid-parser.core-BX15ctWm.js";