@zombie-mermaid/svg-renderer 5.14.4 → 5.15.0
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.
- package/README.md +2 -2
- package/dist/index.cjs +131 -67
- package/dist/index.js +137 -73
- package/dist/shared/index.d.ts +85 -6
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -5,25 +5,25 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
|
|
|
5
5
|
font-display: swap;
|
|
6
6
|
src: url(data:font/woff2;base64,d09GMgABAAAAABZoAAwAAAAAMiwAABYWAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGjQGYACCfhEICtBIv3MLgmIAATYCJAOFNgQgBYREByAboCdFBDYOABG0i4mo4AwURYmYtNn/ZQI3hkD/MDOMAipCbeSAiA/e0E7k5P52NehVqIa1Ws5wnlXDxHfybGfD5bMhLn7xIYDX23j/Rz5CY5/kwkd/mG/3/6sFK7YCklopc4CZmEawA6YLdIro3fC0zX8HFmsX7m9GgjYleXDcEQeS59FHSSpYlHP+r/7NWDn/XLX7We5Hh/zcflRIYLtfFFHgaQRdxolEHFjGyf5+bqOug4dK5jpHFM9JLar//W2oPbmphNegKjf6hSubuicHd6XOxFTSwetPRm4TfrdSCA2AYZje1KaqotJySXs/aDjvWFNNY64WjJjzP5fan2JuSKqb2ptR+PyMnJA//yfZT3J3zcG6XMtJiXI3Kv9y2iHosZoE+jcCUkRqc3NErkLJGaEGz9fS2XtXZk5GIks1Mp9kfJRGbeib8Gmud13rHnRVHZZBeAZlqsIoJIOwipc5DyJWp2JEaq8NYpKrDGTj3jo1VvT022N4TQ/5qiHx95wgkAcAliRdkD41yC4zyDkbyIUYyKUsSCyLmCMf3l4AHE32rYkX64CRMZkgoM/hwHrSsUT/dwmozlotHaDzx3DzJ+goAC6l1EFTt29eXB04L82iCYlx85Y6bA9xSFnsozV3gNWvoFviuv853gNcm7TfDoedMe+A3faYdsQ2+1xup+0mnHTcCVPOgmRk5RXVrLdBiVJlylWoVK1Bk2YtWrXhaycgJDZrlyucNucGEhglNZyBkYmZjYOTi5tHSERUTI+4AYOSUrJmnLPXKfksSImS0nKqVisrttlGl9hkpQ6mGrXq1TmKhYeNg0ukUTc5KZiCDAKloqel08GK0ImkQQnw8gnyO6ZLv4RefdLCMiDKJSUAjwBoAdwA2YtiB/hDDwA4FV+0osA5WQmaaByUu1TZ7oKozVvRvimvwYFHN3aWx63vcmq+Kx0dIRNrY9cg08wcCxqIZZ3B0HmijHjBDgceRM2UYyWTaUzz2XIxn+3k82XEkroE2jQVAtVw9M5K23rHs/xJGrw7aINDe6oWNAzDrTE60YTmZv361HJAsIPKsOjcKq2qyGsUQhTd67852KOyvD2yzJjXNNMUqLPNZrsl6FKfuBmBklR4x+2lDhW1UQtK5JrkAvk+gXBqcwCCgCbYOTqEV6jTC6FBNbxG9oUb8jBLwiid8LObmCdblBBhTwBreN2c6CkvGOiu4g2Xp1PIKqn+y9fPoNgWVMQUPNTFN9Ubz5YHqdmPIRDe51TYgcCoW8sYulQGBQuok8lVwsNEdcEKLAKJW0jw1lPmti0ZTjSVELsq/GtNVJh8FmWUhF9CC/9+QjxB+A8vX6jWEcUeORZZSC9RO5+L41XEt3/BxhbhbTZ9ENQWWMpqW+n5GOZyFlIFRhwkYv2zdGexrYXUi5GkUiGLRaCIZEHRvZErT6U/mXySxKxm5AgsWTloiKRCF1EP5JzHgEmO0uQ6dWuZni+s7XyKLmydocAXEOwibZJ42fd5PgxS6mTIiYHvk54/J69SH+fLWp9GkN6zjfiws4p+Bwg3PbXFVN2PYDwTzgrGpyTU1gfaF4IrosGwHWAGQmaBhUBYYnVLOyun0CnQKMQoIGKg80bHHiIRsBM4LZIgg434M+YPAPGtsVFL4AK9wTJYIYqOrbyFADqnmtlIBElGhRt/0khQoEPSxSk8A+jZJFVypiRVKODi+wRDJQPRbOWeAOztcWGTTcd3HD5YPQRaUwJc+F8k2rpLnAOkRZAoxPFcph4HgOevdtmm/GKNEdUEwYKRTE8IDwNF3aYiOFxSjbeWIIL16u+38z9DjlJdYODsnRGg6ZZk7mStNGIsvUAd5JHhKuL7CvhSWLmy7Hrjp7YGFniM9XSt+Dcy9ooClHk3JC4SeNGJrZplh7Ka0BvNfAGQWWWrPQnIO0nPyD/WCm+TInDihZEPaCFxoshODj8Uc9XfFYSU4ICjxLenSJaox9rE8sUpx6NIh87YO/nplqsThu5iXoIguRCwjznR7t/0N/inpR4VP/5ZeSJFby5UK+mX3IVHdxMJrqlBJeXesPEtmGuwVuk1Z8YUyXzi9oh+yZvhtxU4d6RdkU912UGAn+jhgzo45YW6gSgDlXmFfa4vyWfsWZoMn8o903SYmPSwQyTz9MP8immCVnfsidOEd3DiFm59sxf81gh9xXTDyxOJJoHctABrJzQZfY9O4yZ9Egc+dL0q72olF1/G9DsorYtULawavt9xqSb3SSunWKnE8jVmos2YYDX9V+9xSvClQ/S6ESC4nDADX+j+pJDtuhPvDsijUnS2trhOVzqu0dWOFGYp+AUOH3FSI9gZqzr/VLITOVtKLWp05cpIeRpZ9vwIEfPATzCcTz0pLez2HSoXuO4PRanZFyL6EZgTM9cuwn+MXhfAPleGW1u/ZQ4IOlqfSUYHOyVJ1rfGK1ZbuyOcoMDxXy4IJlE5tFqYw159Wv7+VUGur2I+8X5QTUo2C9XIRYPUg8oti37ktNJOl6NY1+rS79kitpN1wFgn64L2pZn303lMhwr2mtfPd+vksTFFB/P25X4jmR5Aa3KiOVH3fVL1N7TuH8UWhAd2Y4j6tUcC0LidLnru4hgHTvm5zwvRQYcTFWX4awD1N19HMD37xoKGgPhVqnSk3hv8wO6ofqGIC5Tln0B6gkqmp3XFReoPgjvxNsagXZIYVMTJECgd7mXFcM1o8sjWIyzR6t5sqICgB/+U9bp8FudzrYXtcU2SuKaIX6t1/K4xMj9bVz9ZOs34YGBgjneBf0uFCPapx+6/ijnLc2iRd386TZ4Gd5MrXpitf16w4fK0GPhyr0SSYbcYd++hX41y64xt/nRfZPrKLVKlXCDA5NJh8ahCp5TKdHrFKOAzIpnBkD6kSAQOkgxSCKqEYaUS0SPKFaA6Fcx9R8Brz4vwkmtXFsd5G1HdajJOgi8gRId2HchYN9dgHCHw5h7SxgTioKpWJQ5hFG3IElbqO5S12LhNw8BrIQ0k+vMv/7HP0AciuatJw8UGoiHPQIJA7lbS8bOMlKoBm/Y+GGLgVOEqJHKI/P5u+tm+HCX+WkzlKOJrAuiSw8LD5I4DG6xkxIeHYpQK16GofpxURVRRbOsQ8OYoad85Seh84OGR7huIeCeYyJm79CTQ5aa9cBc8nVNuLm08fzt/aKs5OVjYkX9b2A2o3NYPk5fk6WhE3QnnMfSD5EY6i3kCNDNCqVRCmAhKqHHFRWaQgBGVAcQvVeRQnBKoN0z3yfWh1GDIm1xm04wWCQx30eyJBp1UIv9o78d1z/wjRVjsxsXtfwBv7pvY1mwoRA8mtr9lbD+M6+QIroX3AypHHTmu7OIK3DLPUF/4+Pm841IMFYmVCslxcM1C7Ma8ufzolqCjoaBFzyegkoR12Ucv/AXjHXIUwXUwLAwElbM3FvhyF7Bgu8Cn0Bvinx5CwlcIRoQ7d4lVuBRWacS7AJuRGBsMUXKTGkU6tNKWNvSBgQr1OnMMl/KdPo4c8XMEDgnFUyECAYbwGq5PpCp164gBY9dICiztujR9TT67CzQzYr3J4FpqrUyqkctgjczewFBiEHz/wKJr9Mcn1jiFwrWuJ4Z/8D24CL2ORau4lEPH89YX4BxtaRAzSYX4+vV5D15aanEtpjAml44WF9NRDGeChtdST3f3JN/ZxqL0rG3pd8JPB18b7h79YhvLYGBuG/sSLBW/92zXbPO9r/ttvHhvQ3yiajGwU7pWNXm2+udaSfAPwx72m/iths4mwY3NvUPtvxVTeeiAzRtJBByXuiO0tF3KMShNCpFpviXS0vYkuIOBdfoMeiul6jQ0yqoqHVUWTE/IuCqOVoty2jCLSzv34WCDsapKW2XDLJ1YM8odHtZws6Y9xnpTVaWv/qi5ur8+Yam0tjRPAgMDsciiUJzKUfPQKJQl5Ig12B845w/2J02Sf1Tz6r8lIlSDHEFQTTiD4T5HQsPMQDZKc1J1mFgM4+qjjyK4ChZjklqK5sxGwasDYG8dfLkAnba41OUMMtTvPxcI9lsRQp6FoNF5KkfFoahFVmkSKyiB44MWS/5Wz6v+AU0MdbdIHFWp2kN+oaLlmnOrJL+eR6krDcSwSBvqeeSgmohzTMlH2mdRXNITk2gsqNGCYTKIIqeZQTMjuCXbPdGNT3sQ6+ILfGjI1S7X4FIeyuqiitQZ4m0DKMOUuFyuxDHwzu55cj6Ddep158hzqDRzgbywG8wvkCfZtlYe5KYnTe2wPdjrz/qD/XbYJErSAm6WNdblXlNHd2y8EMHEY2JAaeCNLIdiBlhhDUZdaSqMIEqhGNWgfmAnn5i4jWS8eR8J3AvkKKJWye/KI/2FweFUFARz1NH48Yt9t+ffXxk/+2vvb2C0w2HDv3uYvERR46i6kQQylrmDpl7Jqtt0FRRmsASIWXGl7arq38tKf6u+Wr+6SsvWBV4WFe+6d0jBbC4MZzM94/FMOhIhIz7ew2YKWWAlhh5AQyosVZ0hhINWInW76kgSqW7kfuSxDl3QHr27SsK+m/1ZcesLlb9zZEoVMr5RplTLj2zgvVL3N/AsmLEUsQb7AgYeapFH6Asd/sPZVu64YcolNauzrnTd8HdA37kFPZAeseQHQn2kZc/32h8u89r+hd6I/gWSLCpOixjkqMMbC7Ap9tYhWK5C/WBDoTdCGikWxW3h9TZo0aKjG4blRoUu1OlsISJmhaeM2djSJqmTamfXzaybM0VsXuAtkbd7/XyFwtfW3imCUbeMnjN162QiT4ivlJIcxKiVSrU0qoRoEygxwc0VKjXiEhBWd5qVqjPkmZPUyQtNF1RltNJ5EjQxAqlk0E/5ZQpcJEZx2Y56GeZP9zODw6n5fzno+3MNCbADghE30yyaZNrAGrVAPUkNuiDSXLKNKZnU+5hh5DJ4YA0YN2CXAd7jm+9elui7IfGcqP65kn338sc2JYYWEi/qxN9eunQN4I4F4q0X6cHt1sx7bPZ74a3WQPEioCj+SAu5n5KMaEjQzEjoDEzQFWpXGmU6o9TlOpQHVeCfS1eWla4oHR552Upgkk9LnzrYffWll+26kgQO6890bbOzSabGYTmuQyhaaDgTjm5JhdrFGbX2yZeMJKhiRIeSQUqm0cgGKq/oEizmOx9qIQ/YbrvfXdA94OEFtyTB3Lx+lnFzbMOj9T/eSV0NmDin0CpTaaTPhKdJLvTwlmj/QLR1fKNaGHhCCvdoOLWRz69viyyIqx/lVmJdYmFYicOJHhi3YIRdoxEe7HSrwMP0nSVbqGdftUHToJmhiQukXQqNOYwto+9VuaQSgaOLo0ADPRCRcn0vvQTLukZxP3OPQHObWIUJBBQSi9QLhJGFftSil8kVFHi57BOBJxbE1WfJKoVfLAgrtXA8Dmu0cdo69bNRpZnBfKGW+RJzOJ3aF8BrZ4XcPg0XNJ9sPFpTc7RxMn/DNXchUH28z6m6sWq9EbZgjwS5kPb2clpiGC56b3PxZqOi/OP5j1u7Gbz09o08VI/DsB7HxuxjeKxdHFBK2JRNkA7I0G7C7TE1B/U+9gR/4SPfRH2pubc+f6S/A183Zhtb5+gYi2/ozcBslZKPFvhv3o56H56I7/bS++7bfAewsl5zYqHqhSDWtxHcqfOHpp8N7tp5XmUe6PtL+DcHaAq45TLzp8NXVJ56YeL8iQA9y/m/38obtZw388bWmf8H6WEnuspnPRnm85YcRIjJTuCJwAv9rm5HgXnVVepxLENksHF1Bc8wruxqJVrZUmlVqMdwfUFvYKYODzlh50LA359nJhKXXLVLYm6ol2h2bZAJ2cqtsIvV0pGFKtlbsTFiDH3YGpkWfeYwMHix/+bfiJMrThLgcP/yHfntZjBTTaAEgMOGjw0A3BU2xwqawdqZSV9hogeyU9xbHAXX6UuI3g4i1G0tnJJNkoXhbtBJsZc9/eeorsTSryd7ep1Fk8fuamVjL312d/6xFYUeTksb+tACWPK/PkI88oQxLISTO2v3dpVna2b3zs3VGjgT/okFml9gvltT8y6T9azf5LPfXW2YMzzzw0sVYDtO3Erc8oM/OWBDnYKjDStS28sLBceoW97uBjQUoZXe8WVFJwA0/+OwFpcyN5Vcu+jNFuH2IwvXwpMLAhbrndO226c7B6HMk42SNyfTEHixD9XrVmIrRw09A6TwhX0/Leqr2tgbFbWVWGVtxdyHvXtHkEexhhjEVKgrahauynL0P7aqBqgX7GO4esJl27nvxHh6YiK92myn9B0Opzar1xBoY2CGhtttboIKZ3pskUTaN2CoaWXNNQ+1nGGxzrZkm+fA20WuaMwlIdwBA31BgIu0AadJRLLbbBIXz9zC/I5V/+Tj/1CpyBW3zT0Y7rr8mk1kA5OQpPnY6NkKdoIv4d8I/u+/mboZPLirvLq8oqa8vKZiPf7PZAY076ruNCVkdTX5Rp1AOZWeifTPgMGp+ExwYAZ8PLVnxjozE+40WUygOSDEED6fVHhabisFZWVQaSmkfw/A/+4K28lscUVtBVbRWtxw9yQI0BvcrgfW85vaG9hIbxrcqljXNMj6vwcWw+zBz2wsAAEgBbZoIaAdyN2mueRG7ibN7O4k6y66qr6gL1p1PITcMBC43JLLkCWyRJa4lc5udQ2yWlbLalkt22SbbJNtrpBAcnOZ1h3IXaH55ELuEs3qribrGorXF4Qi/LgLuWAgMAcWXbwMtdQQpCLLjmR3IaBLqnYNrnfdFyU90iM90qMeApeMy7iMy7ibKnMsZfKIDxxpS07tCavnmlmDLnz8UGXcKxf/ZKMyDgCsD3qYl7yOfvc26Y5g58UkIhTtlO148ev1A513AGX/56Wupd8NdpPkO/CoWP/vwvaksloALEB117+hmCQGkTq1AvDYebvRyWDGDoCbeZO0sKeOLhn1BBRct9RYZ/Tnjm0SQ3WFJhVLJ0OWhEtG15AvfeV96FboOVoOXEmbhrL0YgABwKY3lrUQ+wOrZb8VraZ/CQD8fRkb4YXMPf9M/J+k/Re7oCwJbAAGBKAtR5ddN/GSvg0EZo2/S5aibHlU4Ev3sixThIC6rCfF0dayTKBTikwuatWlUBDqKxOJdhV4rKchqsWerYpKvJELJ3gm23HR5ZzFDkEqkEXeTDZq1ZalTkiqPQp7z9tESKXyji3a8pigMCoOBlBIVSo5XmeRl7jABHXUqgHu0wwasHGEvcjYx18KBB0YcSLpdnAIVtHKprIlYMlkFj1zVOK17VC4MssUjTbaaKP/CEAAeITuBQPAAvI+aA3/1QVzvyGPAYAPqK5bxUAkRKuyKazyaxUd6nxVHp6Jqnw2bbYAvg9wKCpLKS0obkCGyaABg8yMWpGiug3pE5TmEJWWEc8eV4XXKslyjIWZzfYbY4KGZA22OFqZVaXBFtxXKbG2PNUWaSUQeUxIo3tnVbdY1a2jaqfjc+opwTewM3BQb6uC3qSR2/m4bj2308YTjUsjrC0heuBb6CWkYT4hKlxDEXtMRpcPSss01myETbJeKXbf1y2emX8zG9ImbO7rx/Y5C/v2xxvRzeq3iuIBCAAA) format('woff2');
|
|
7
7
|
unicode-range: U+0020-007E, U+00A0, U+00C0-00FF;
|
|
8
|
-
}`;function k(t,n,r){return(0,e.measureTextWidth)(t,n,r)}function A(e,t){return e.length*t*.6}var j=`'JetBrains Mono'`,ee=`${j}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,M={nodeLabel:13,edgeLabel:11,groupHeader:12};function N(e){return{nodeLabel:e?.nodeLabel??M.nodeLabel,edgeLabel:e?.edgeLabel??M.edgeLabel,groupHeader:e?.groupHeader??M.groupHeader}}var P={nodeLabel:500,edgeLabel:400,groupHeader:600},te=12,ne=12,F={horizontal:20,vertical:10,diamondExtra:24},I={outerBox:1,innerBox:.75,connector:1},L=`0.35em`,re={width:8,height:5};function ie(t,n,r,i){return(0,e.buildStyleBlock)(t,n?{family:D,faceCss:O}:!1,r,i)}var R={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!1,thoroughness:3,fontSizes:M},ae=`#087ebf`,oe={blank:``,database:`<path d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><ellipse cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line>`,disk:`<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></rect><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"></path>`,server:`<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></rect><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g>`,cloud:`<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path>`,internet:`<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></circle><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line>`},se={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,c4:`DOWN`};function ce(e,t){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`BT`:return`UP`;case`TD`:case`TB`:return`DOWN`;default:return t}}function le(e){let t=typeof e==`number`?{top:e,left:e,bottom:e,right:e}:e;return`[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`}function ue(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":le(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function de(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var fe={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function z(t,n){let r=(0,e.measureMultilineText)(t,n.fontSize,P.edgeLabel),i={text:t,width:r.width+8,height:r.height+6};return n.layoutOptions&&(i.layoutOptions={...n.layoutOptions}),i}function B(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[z(e.label,e.labelStyle)]),t}var pe={"state-start":`FIRST`},me={"elk.layered.cycleBreaking.strategy":`MODEL_ORDER`,"elk.layered.compaction.postCompaction.strategy":`NONE`};function he(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var ge={top:51,left:24,bottom:24,right:24},_e={top:51,left:24,bottom:24,right:24},V={top:44,left:16,bottom:16,right:16},ve={top:16,left:16,bottom:16,right:16};function ye(e){let t=new Map;for(let n of e.edges){if(!n.label)continue;let e=`${n.source}\0${n.target}`,r=(t.get(e)??0)+1;if(r>=3)return!0;t.set(e,r)}return!1}function H(e){return e.subgraphs.length>0&&!he(e)}function be(e,t,n){if(!(!H(e)||t.nodeSpacing!==R.nodeSpacing||t.layerSpacing!==R.layerSpacing))return n===`root`?{"spacing.baseValue":`40`}:{"spacing.baseValue":`24`,"elk.spacing.nodeNode":`50`,"elk.layered.spacing.edgeNodeBetweenLayers":`30`,"elk.spacing.edgeEdge":`20`}}var xe=[`elk.spacing.nodeNode`,`elk.layered.spacing.nodeNodeBetweenLayers`,`elk.spacing.edgeEdge`,`elk.layered.spacing.edgeEdgeBetweenLayers`,`elk.layered.spacing.edgeNodeBetweenLayers`,`elk.contentAlignment`];function Se(e,t){if(!t)return e;let n={...e};for(let e of xe)delete n[e];return{...n,...t}}function Ce(e){let t=new Map,n=(e,r)=>{for(let i of e){r&&t.set(i.id,r);for(let e of i.nodeIds)t.set(e,i.id);n(i.children,i.id)}};n(e.subgraphs);let r=(e,n)=>{for(let r=t.get(e);r!==void 0;r=t.get(r))if(r===n)return!0;return!1},i=e.edges,a=i.map((e,t)=>t);return i.forEach(({source:e,target:t},n)=>{let o=a.indexOf(n),s=a.findIndex((n,a)=>{let s=i[n];return a<o&&(s.target===t&&r(e,s.source)||s.source===e&&r(t,s.target))});s!==-1&&(a.splice(o,1),a.splice(s,0,n))}),a}var we=`[top=12,left=12,bottom=12,right=12]`,Te=new WeakMap;function Ee(t){let n=Te.get(t);return n||(n=Fe(t.subgraphs)?new Set:H(t)?(0,e.subgraphFeedbackEdges)(t):(0,e.findBackEdgeIndexes)(t,void 0,(0,e.subgraphFeedbackEdges)(t)),Te.set(t,n)),n}function De(e,t){for(let n=0;n<e.edges.length;n++){let r=e.edges[n];if(t.has(r.source)||t.has(r.target))return n}return 1/0}function Oe(e){return ce(e,se.flowchart)}function ke(e){return{...ue(e),"elk.spacing.edgeEdge":`12`,"elk.layered.spacing.edgeEdgeBetweenLayers":`12`,"elk.layered.spacing.edgeNodeBetweenLayers":`12`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.contentAlignment":`H_CENTER V_CENTER`}}function Ae(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:fe}}var je=136,Me=40;function Ne(t,n,r,i,a,o,s=!1){if(a!==void 0)return{width:80,height:80};let c=(0,e.measureMultilineText)(n,i,P.nodeLabel),l=c.width+F.horizontal*2,u=c.height+F.vertical*2;if(r===`diamond`){let e=Math.max(l,u)+F.diamondExtra;l=e,u=e}if(r===`circle`||r===`doublecircle`){let e=Math.ceil(Math.sqrt(l*l+u*u))+8;l=r===`doublecircle`?e+12:e,u=l}if(r===`hexagon`&&(l+=F.horizontal),(r===`trapezoid`||r===`trapezoid-alt`||r===`parallelogram`||r===`parallelogram-alt`)&&(l+=F.horizontal),r===`asymmetric`&&(l+=12),r===`cylinder`&&(u+=14),r===`cloud`){let e=Math.max(l,u*2.5);return{width:e*1.25,height:u+e*.48}}return r===`small-circle`?{width:14,height:14}:r===`fork-bar`?o===`LR`||o===`RL`?{width:10,height:70}:{width:70,height:10}:r===`state-start`||r===`state-end`?{width:14,height:14}:r===`junction`?{width:2,height:2}:n===``&&r===`diamond`?{width:28,height:28}:n===``&&r===`fork-join`?{width:70,height:10}:(l=Math.max(l,s?je:60),u=Math.max(u,s?Me:36),{width:l,height:u})}var Pe=` root`;function Fe(e){for(let t of e)if(t.direction!==void 0||Fe(t.children))return!0;return!1}function Ie(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)Ie(n,t)}function Le(e){let t=new Map;function n(e,r){let i=[...r,e.id];t.set(e.id,i);for(let t of e.children)n(t,i)}for(let t of e)n(t,[]);return t}function Re(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function ze(e,t){let n=t,r=new Set,i=new Set;for(let t of e.subgraphs)i.add(t.id),Ve(t,r,i);let a=He(e.subgraphs),o=Le(e.subgraphs),s=e=>e?o.get(e)??[]:[],c=new Map;c.set(null,[]);let l=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=a.get(n.source),i=a.get(n.target);if(r&&r===i){let e=c.get(r)??[];c.set(r,e),e.push({index:t,edge:n})}else!r&&!i?c.get(null).push({index:t,edge:n}):l.push({index:t,edge:n,srcChain:s(r),tgtChain:s(i)})}let u=Fe(e.subgraphs),d=[],f=[],p={...Se(ke({direction:Oe(e.direction),nodeSpacing:n.nodeSpacing,layerSpacing:he(e)&&n.layerSpacing===R.layerSpacing?40:n.layerSpacing,padding:n.padding}),be(e,n,`root`)),...H(e)?{}:{"elk.layered.thoroughness":String(R.thoroughness)},"elk.layered.highDegreeNodes.treatment":`false`,"elk.layered.compaction.postCompaction.strategy":e.subgraphs.length===0||ye(e)||H(e)?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...H(e)?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{},...ye(e)?{"elk.spacing.edgeEdge":H(e)?`50`:`40`}:{},...he(e)?me:{},"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":u?`SEPARATE`:`INCLUDE_CHILDREN`},m=new Map,h=new Map;function g(e,t){let n=m.get(e)??new Set;m.set(e,n),n.add(t)}function _(e,t){let n=h.get(e)??[];h.set(e,n),n.push(t)}if(u)for(let{index:e,edge:t,srcChain:r,tgtChain:i}of l){let a=Re(r,i),o=t.source;if(r.length>a){for(let n=r.length-1;n>=a;n--){let i=r[n],a=`${i}_out_${e}`;g(i,a);let o=n===r.length-1?t.source:`${r[n+1]}_out_${e}`;_(i,{id:`e${e}_s${n}`,sources:[o],targets:[a]})}o=`${r[a]}_out_${e}`}let s=t.target;if(i.length>a){for(let n=a;n<=i.length-1;n++){let r=i[n],a=`${r}_in_${e}`;g(r,a);let o=n===i.length-1?t.target:`${i[n+1]}_in_${e}`;_(r,{id:`e${e}_t${n}`,sources:[a],targets:[o]})}s=`${i[a]}_in_${e}`}_(a>0?r[a-1]:Pe,B({id:`e${e}`,source:o,target:s,label:t.label,labelStyle:Ae(n)}))}for(let[t,a]of e.nodes)if(!r.has(t)&&!i.has(t)){let r=de(t,Ne(t,a.label,a.shape,n.fontSizes.nodeLabel,a.icon,e.direction,he(e)),a.label),i=he(e)?pe[a.shape]:void 0;i!==void 0&&(r.layoutOptions={"elk.layered.layering.layerConstraint":i}),d.push(r)}let v=he(e),y=d.length,b=v?e.subgraphs:[...e.subgraphs].reverse();for(let t of b)d.push(Be(t,e,n,c,m,h,e.direction));if(H(e)&&d.unshift(...d.splice(y)),v&&e.subgraphs.length>0){let t=d.map((t,n)=>{if(n<y)return De(e,new Set([t.id]));let r=e.subgraphs[n-y],i=De(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return Ie(r,a),De(e,a)}),n=d.map((e,t)=>t).sort((e,n)=>t[e]-t[n]||e-n).map(e=>d[e]);d.splice(0,d.length,...n)}let x=Ee(e),S=H(e)&&!u,C=c.get(null);if(S)for(let t of Ce(e)){let r=e.edges[t];f.push(B({id:`e${t}`,source:x.has(t)?r.target:r.source,target:x.has(t)?r.source:r.target,label:r.label,labelStyle:Ae(n)}))}for(let{index:e,edge:t}of S?[]:C)t.source!==t.target&&f.push(B({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:Ae(n)}));if(u)for(let e of h.get(Pe)??[])f.push(e);else for(let{index:e,edge:t}of S?[]:l)f.push(B({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:Ae(n)}));return{id:`root`,layoutOptions:p,children:d,edges:f}}function Be(t,n,r,i,a,o,s){let c=t.direction!==void 0&&(0,e.subgraphDirectionIsHonored)(t,n)?t.direction:s,l=Se(ke({direction:Oe(c),nodeSpacing:r.nodeSpacing,layerSpacing:he(n)&&r.layerSpacing===R.layerSpacing?24:r.layerSpacing,padding:t.region?ve:he(n)?ge:H(n)?_e:V}),be(n,r,`subgraph`));if(H(n)&&!t.region){let n=(0,e.measureMultilineText)(t.label,r.fontSizes.groupHeader,P.groupHeader).width+24;l[`elk.nodeSize.constraints`]=`[MINIMUM_SIZE]`,l[`elk.nodeSize.minimum`]=c===`TD`||c===`TB`||c===`BT`?`(0, ${n})`:`(${n}, 0)`}H(n)&&(l[`elk.layered.cycleBreaking.strategy`]=`DEPTH_FIRST`,l[`elk.spacing.portsSurrounding`]=we);let u,d=a.get(t.id);d&&d.size>0&&(u=[...d].map(e=>({id:e})));let f=[],p=H(n),m=p?[...n.nodes.keys()].filter(e=>t.nodeIds.includes(e)):t.nodeIds;for(let e of m){let t=n.nodes.get(e);if(t){let i=de(e,Ne(e,t.label,t.shape,r.fontSizes.nodeLabel,t.icon,n.direction,he(n)),t.label);f.push(i)}}let h=t.children.some(e=>e.region)?t.children:[...t.children].reverse(),g=f.length;for(let e of h)f.push(Be(e,n,r,i,a,o,c));p&&f.unshift(...f.splice(g));let _=[],v=i.get(t.id)??[],y=Ee(n);for(let{index:e,edge:t}of H(n)&&!Fe(n.subgraphs)?[]:v)t.source!==t.target&&_.push(B({id:`e${e}`,source:y.has(e)?t.target:t.source,target:y.has(e)?t.source:t.target,label:t.label,labelStyle:Ae(r)}));for(let e of o.get(t.id)??[])_.push(e);return{id:t.id,layoutOptions:l,labels:t.label?[{text:t.label}]:void 0,ports:u,children:f,edges:_}}function Ve(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),Ve(r,t,n)}function He(e){let t=new Map;function n(e){for(let n of e.nodeIds)t.set(n,e.id);for(let t of e.children)n(t)}for(let t of e)n(t);return t}function Ue(e,t,n){if(e.length<2||t.shape===`rectangle`||t.shape===`rounded`||t.shape===`stadium`)return e;let r=[...e];if(t.shape===`diamond`){if(n)r[0]=We(e[0],e[1],t);else{let n=e.length-1;r[n]=We(e[n],e[n-1],t)}}if(t.shape===`asymmetric`){let i=n?0:e.length-1,a=e[i],o=t.height/2,s=Math.abs(a.y-(t.y+o));Math.abs(a.x-t.x)<.5&&s<o&&(r[i]={x:t.x+12*(1-s/o),y:a.y})}return r}function We(e,t,n){let r=n.x+n.width/2,i=n.y+n.height/2,a={x:r,y:n.y},o={x:n.x+n.width,y:i},s={x:r,y:n.y+n.height},c={x:n.x,y:i},l=e.x-t.x,u=e.y-t.y;if(Math.abs(l)<Math.abs(u)){let t=e.x;return u>0?t<=r?Ke(t,c,a)??a:Ke(t,a,o)??a:t<=r?Ke(t,s,c)??s:Ke(t,o,s)??s}{let t=e.y;return l>0?t<=i?Ge(t,a,c)??c:Ge(t,c,s)??c:t<=i?Ge(t,a,o)??o:Ge(t,o,s)??o}}function Ge(e,t,n){let r=n.y-t.y;if(Math.abs(r)<.001)return null;let i=(e-t.y)/r;return i<0||i>1?null:{x:t.x+i*(n.x-t.x),y:e}}function Ke(e,t,n){let r=n.x-t.x;if(Math.abs(r)<.001)return null;let i=(e-t.x)/r;return i<0||i>1?null:{x:e,y:t.y+i*(n.y-t.y)}}var qe=12;function Je(e,t,n){if(e.length===0)return;let r=n===`LR`||n===`RL`,i=new Set;for(let e of t)i.add(`${e.source}:${e.target}`),i.add(`${e.target}:${e.source}`);let a=R.layerSpacing*.6,o=[...e].sort((e,t)=>r?e.x-t.x:e.y-t.y),s=[],c=[o[0]];for(let e=1;e<o.length;e++){let t=(r?o[e].x:o[e].y)-(r?o[e-1].x:o[e-1].y),n=c.some(t=>i.has(`${t.id}:${o[e].id}`));t<=a&&!n?c.push(o[e]):(s.push(c),c=[o[e]])}s.push(c);let l=new Map;for(let e of s){if(e.length<=1)continue;let t=e.map(e=>r?e.x:e.y),n=Math.min(...t),i=Math.max(...t);if(i-n<=1)continue;let a=(n+i)/2;for(let t of e){let e=a-(r?t.x:t.y);Math.abs(e)>.5&&(r?t.x=a:t.y=a,l.set(t.id,e))}}l.size!==0&&Ye(t,l,r?`x`:`y`)}function Ye(e,t,n){let r=(e,t,r,i)=>{let a=e[t],o=a[n];a[n]+=i;let[s,c,l]=[1,2,3].map(n=>e[t+n*r]);if(s[n]===o)s[n]+=i;else if(c&&l&&c[n]===s[n]){let e=Math.sign(s[n]-o),t=s[n]+e*Math.max(0,qe-e*(s[n]-a[n]));e*(l[n]-t)>0&&(s[n]=c[n]=t)}};for(let n of e){let{points:e}=n;if(e.length<2)continue;let i=t.get(n.source),a=t.get(n.target);i!=null&&r(e,0,1,i),a!=null&&r(e,e.length-1,-1,a)}}var Xe=.5;function Ze(e,t,n){for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=Math.min(i.x,a.x),s=Math.max(i.x,a.x),c=Math.min(i.y,a.y),l=Math.max(i.y,a.y);for(let e of t){if(n.has(e.id))continue;let t=e.x+Xe,r=e.x+e.width-Xe,i=e.y+Xe,a=e.y+e.height-Xe;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function Qe(e,t,n){let r=[];for(let i of n)e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height&&(r.push(i),r.push(...Qe(e,t,i.children)));return r}function $e(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(Qe(t,n,r).map(e=>e.id)),u=Qe(c?e:t,c?n:e,r).find(e=>!l.has(e.id));return u?a?u.x-12:o?u.x+u.width+12:s?u.y+u.height+12:u.y-12:e}var et=2;function tt(e,t,n,r,i){for(let a of e){if(t.has(a)||a.source===a.target)continue;let e=a.source===n?a.points[0]:a.target===n?a.points[a.points.length-1]:void 0;if(e&&Math.abs((i?e.x:e.y)-r)<=et)return!0}return!1}function nt(e,t,n,r){let i=new Map(t.map(e=>[e.id,e])),a=new Set,o=new Map,s=e=>`${e.source}\0${e.target}`;for(let t of e)o.set(s(t),(o.get(s(t))??0)+1);let c=e=>o.get(s(e))>1,l=r===`LR`,u=r===`RL`,d=r===`BT`,f=l||u,p=new Map;for(let t of e){if(t.source===t.target||c(t))continue;let e=p.get(t.source)??[];p.set(t.source,e),e.push(t)}for(let[o,s]of p){if(s.length<2)continue;let c=s[0].style;if(s.some(e=>e.label||e.style!==c))continue;let p=i.get(o);if(!p)continue;let m=[];for(let e of s){let t=i.get(e.target);t&&(l?t.x>p.x+p.width:u?t.x+t.width<p.x:d?t.y+t.height<p.y:t.y>p.y+p.height)&&m.push({edge:e,node:t})}if(m.length<2)continue;let h=p.x+p.width/2,g=p.y+p.height/2;if(f){let i=l?p.x+p.width:p.x,s=g;if(tt(e,new Set(m.map(e=>e.edge)),o,i,!0))continue;let c=i+((l?Math.min(...m.map(e=>e.node.x)):Math.max(...m.map(e=>e.node.x+e.node.width)))-i)/2;c=$e(c,h,g,n,r);let u=[];for(let{edge:e,node:n}of m){let r=l?n.x:n.x+n.width,a=n.y+n.height/2,d=[{x:i,y:s},{x:c,y:s},{x:c,y:a},{x:r,y:a}];Ze(d,t,new Set([o,n.id]))&&u.push({edge:e,points:d})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t,a.add(e)}else{let i=h,s=d?p.y:p.y+p.height;if(tt(e,new Set(m.map(e=>e.edge)),o,s,!1))continue;let c=s+((d?Math.max(...m.map(e=>e.node.y+e.node.height)):Math.min(...m.map(e=>e.node.y)))-s)/2;c=$e(c,h,g,n,r);let l=[];for(let{edge:e,node:n}of m){let r=n.x+n.width/2,a=d?n.y+n.height:n.y,u=[{x:i,y:s},{x:i,y:c},{x:r,y:c},{x:r,y:a}];Ze(u,t,new Set([o,n.id]))&&l.push({edge:e,points:u})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}}let m=new Map;for(let t of e){if(a.has(t)||t.source===t.target||c(t))continue;let e=m.get(t.target)??[];m.set(t.target,e),e.push(t)}for(let[a,o]of m){if(o.length<2)continue;let s=o[0].style;if(o.some(e=>e.label||e.style!==s))continue;let c=i.get(a);if(!c)continue;let p=[];for(let e of o){let t=i.get(e.source);t&&(l?t.x+t.width<c.x:u?t.x>c.x+c.width:d?t.y>c.y+c.height:t.y+t.height<c.y)&&p.push({edge:e,node:t})}if(p.length<2)continue;let m=c.x+c.width/2,h=c.y+c.height/2;if(f){let i=l?c.x:c.x+c.width,o=h;if(tt(e,new Set(p.map(e=>e.edge)),a,i,!0))continue;let s=l?Math.max(...p.map(e=>e.node.x+e.node.width)):Math.min(...p.map(e=>e.node.x)),u=s+(i-s)/2;u=$e(u,m,h,n,r);let d=[];for(let{edge:e,node:n}of p){let r=l?n.x+n.width:n.x,s=n.y+n.height/2,c=[{x:r,y:s},{x:u,y:s},{x:u,y:o},{x:i,y:o}];Ze(c,t,new Set([n.id,a]))&&d.push({edge:e,points:c})}if(d.length<2)continue;for(let{edge:e,points:t}of d)e.points=t}else{let i=m,o=d?c.y+c.height:c.y;if(tt(e,new Set(p.map(e=>e.edge)),a,o,!1))continue;let s=d?Math.min(...p.map(e=>e.node.y)):Math.max(...p.map(e=>e.node.y+e.node.height)),l=s+(o-s)/2;l=$e(l,m,h,n,r);let u=[];for(let{edge:e,node:n}of p){let r=n.x+n.width/2,s=[{x:r,y:d?n.y:n.y+n.height},{x:r,y:l},{x:i,y:l},{x:i,y:o}];Ze(s,t,new Set([n.id,a]))&&u.push({edge:e,points:s})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t}}}var rt=1.5,it=.01;function at(e){let t=e.map(e=>({...e})),n=0;for(;n+3<t.length;){let[e,r,i,a]=[t[n],t[n+1],t[n+2],t[n+3]],o=Math.abs(e.x-r.x)<it&&Math.abs(i.x-a.x)<it&&Math.abs(r.y-i.y)<it&&Math.abs(r.x-i.x)<=rt&&Math.abs(r.x-i.x)>=it,s=Math.abs(e.y-r.y)<it&&Math.abs(i.y-a.y)<it&&Math.abs(r.x-i.x)<it&&Math.abs(r.y-i.y)<=rt&&Math.abs(r.y-i.y)>=it;if(o){let r=(e.x+a.x)/2;t.splice(n,4,{x:r,y:e.y},{x:r,y:a.y})}else if(s){let r=(e.y+a.y)/2;t.splice(n,4,{x:e.x,y:r},{x:a.x,y:r})}else n++}return t}function ot(e,t=0,n=0){let r=[];if(!e.sections||e.sections.length===0)return r;let i=e.sections[0];if(r.push({x:i.startPoint.x+t,y:i.startPoint.y+n}),i.bendPoints)for(let e of i.bendPoints)r.push({x:e.x+t,y:e.y+n});return r.push({x:i.endPoint.x+t,y:i.endPoint.y+n}),r}function st(e,t=0,n=0){if(!e.labels||e.labels.length===0)return;let r=e.labels[0];if(r.x!=null&&r.y!=null)return{x:r.x+(r.width??0)/2+t,y:r.y+(r.height??0)/2+n}}var ct=16,lt=28,ut=18,dt=28,ft=10;function pt(e,t){let n=e.x+e.width,r=e.y+e.height/2,i=Math.min(dt,e.height*.6)/2,a=lt+t*ut,o=[];for(let e=0;e<=ct;e++){let t=Math.PI*e/ct;o.push({x:n+a*Math.sin(t),y:r-i*Math.cos(t)})}return{points:o,labelPosition:{x:n+a+ft,y:r}}}function mt(e,t,n){let r=new Map;for(let i=0;i<e.edges.length;i++){let a=e.edges[i];if(a.source!==a.target)continue;let o=t.get(a.source);if(!o)continue;let s=r.get(o.id)??0;r.set(o.id,s+1);let{points:c,labelPosition:l}=pt(o,s);n.push({source:a.source,target:a.target,label:a.label,style:a.style,hasArrowStart:a.hasArrowStart,hasArrowEnd:a.hasArrowEnd,points:c,labelPosition:a.label?l:void 0,inlineStyle:Dt(i,e),headColor:Et(e),id:a.id,animate:a.animate,startMarker:a.startMarker,endMarker:a.endMarker})}}function ht(e){let t=[];for(let n of e)t.push({x:n.x,y:n.y,right:n.x+n.width,bottom:n.y+n.height}),t.push(...ht(n.children));return t}function gt(e,t,n=!1){let r=[],i=[],a=[],o=new Set;for(let e of t.subgraphs)Tt(e,o);_t(e,t,o,r,a,0,0);let s=ht(a);bt(e,t,i,0,0,s.length>0?{leftX:Math.min(...s.map(e=>e.x))-20,rightX:Math.max(...s.map(e=>e.right))+20}:void 0),Je(r,i,t.direction);let c=new Map(r.map(e=>[e.id,e]));mt(t,c,i),n&&nt(i,r,a,t.direction);for(let e of i){e.points=at(e.points);let t=c.get(e.source),n=c.get(e.target);t&&(e.points=Ue(e.points,t,!0)),n&&(e.points=Ue(e.points,n,!1))}let l=e.width??800,u=e.height??600,d=re.width,f=R.padding;for(let e of i){for(let t of e.points)l=Math.max(l,t.x+d+f),u=Math.max(u,t.y+d+f);e.labelPosition&&(l=Math.max(l,e.labelPosition.x+60+f),u=Math.max(u,e.labelPosition.y+20+f))}return{width:l,height:u,nodes:r,edges:i,groups:a}}function _t(t,n,r,i,a,o,s){if(t.children)for(let c of t.children){let t=(c.x??0)+o,l=(c.y??0)+s,u=c.width??0,d=c.height??0;if(r.has(c.id)){let o=[];_t(c,n,r,i,o,t,l);let s=wt(n.subgraphs,c.id);a.push({id:c.id,label:s?.label??``,x:t,y:l,width:u,height:d,children:o,...(0,e.groupStyle)(c.id,n),...s?.region?{region:!0}:{},...s?.icon?{icon:s.icon}:{}})}else{let o=n.nodes.get(c.id);if(o){let r=(0,e.resolveNodeStyle)(c.id,n),a=n.classAssignments.get(c.id);i.push({id:c.id,label:o.label,shape:o.icon===void 0?o.shape:`rectangle`,icon:o.icon,x:t,y:l,width:u,height:d,inlineStyle:r,className:a,interaction:n.interactions.get(c.id)})}c.children&&c.children.length>0&&_t(c,n,r,i,a,t,l)}}}function vt(e){let t=/^e(\d+)$/.exec(e);if(t)return{edgeIndex:parseInt(t[1],10),role:`bridge`};let n=/^e(\d+)_([st])(\d+)$/.exec(e);if(n)return{edgeIndex:parseInt(n[1],10),role:n[2]===`s`?`source`:`target`,level:parseInt(n[3],10)}}function yt(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}let n=t/2;for(let t=1;t<e.length;t++){let r=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y,a=Math.sqrt(r*r+i*i);if(n<=a){let o=n/a;return{x:e[t-1].x+o*r,y:e[t-1].y+o*i}}n-=a}return e[e.length-1]}function bt(e,t,n,r,i,a){let o=new Map;xt(e,o,0,0);let s=new Map;Ct(e,s,0,0,o);let c=0;for(let[e,r]of s){let i=t.edges[e];if(!i||i.source===i.target)continue;let o=[],s=e=>{!e||e.points.length===0||(o.length>0?o.push(...e.points.slice(1)):o.push(...e.points))},l=[...r.sourceHops.keys()].sort((e,t)=>t-e);for(let e of l)s(r.sourceHops.get(e));s(r.bridge);let u=[...r.targetHops.keys()].sort((e,t)=>e-t);for(let e of u)s(r.targetHops.get(e));let d;i.label&&o.length>=2&&(d=r.bridge?.labelPosition??yt(o));let f=St(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=yt(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:Ee(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:Dt(e,t),headColor:Et(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})}}function xt(e,t,n,r){t.set(e.id,{x:n,y:r});for(let i of e.children??[]){let e=i.x??0,a=i.y??0;xt(i,t,n+e,r+a)}}function St(e,t,n=0){if(e.length<2)return e;let r=!1;for(let t=1;t<e.length;t++){let n=Math.abs(e[t].x-e[t-1].x),i=Math.abs(e[t].y-e[t-1].y);if(n>1&&i>1){r=!0;break}}if(!r)return e;let i=[e[0]];for(let r=1;r<e.length;r++){let a=i[i.length-1],o=e[r],s=Math.abs(o.x-a.x),c=Math.abs(o.y-a.y);if(s>1&&c>1){if(t){let e=n%2==0,r=Math.floor(n/2)*12,s=e?t.rightX+r:t.leftX-r;i.push({x:s,y:a.y}),i.push({x:s,y:o.y})}else{let e=(a.y+o.y)/2;i.push({x:a.x,y:e}),i.push({x:o.x,y:e})}}i.push(o)}return i}function Ct(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=vt(a.id);if(!e)continue;let{edgeIndex:o}=e,s=a.container,c=s?i.get(s):void 0,l=c?.x??n,u=c?.y??r,d=ot(a,l,u),f=st(a,l,u),p=t.get(o)??{sourceHops:new Map,targetHops:new Map};t.set(o,p);let m={edgeIndex:o,points:d,labelPosition:f};e.role===`bridge`?p.bridge=m:e.role===`source`?p.sourceHops.set(e.level,m):p.targetHops.set(e.level,m)}if(e.children)for(let a of e.children)Ct(a,t,n+(a.x??0),r+(a.y??0),i)}function wt(e,t){for(let n of e){if(n.id===t)return n;let e=wt(n.children,t);if(e)return e}}function Tt(e,t){t.add(e.id);for(let n of e.children)Tt(n,t)}function Et(e){return Dt(-1,e)?.stroke}function Dt(t,n){let r,i=n.linkStyles.get(`default`);i&&(r={...i});let a=n.linkStyles.get(t);return a&&(r=r?{...r,...a}:{...a}),r&&(0,e.dropInvalidColors)(r)}var Ot=e=>e===`TD`||e===`TB`||e===`BT`,kt=8;function At(e,t,n,r){let i=Ot(r)?`y`:`x`,a=i===`x`?`y`:`x`,o=i===`x`?`width`:`height`,s=i===`x`?`height`:`width`;for(let{points:r}of e)for(let e=1;e<r.length-1;){let c=e;for(;c+1<r.length-1&&r[c+1][i]===r[e][i];)c++;let l=r.slice(e,c+1),u=l[0],d=Math.min(...l.map(e=>e[a])),f=Math.max(...l.map(e=>e[a])),p=r[e-1][i],m=r[c+1][i],h=n.flatMap(e=>[e[i],e[i]+e[o]].map(t=>({g:e,s:t}))).find(({g:e,s:t})=>Math.abs(u[i]-t)<kt&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?kt:-8),n=(e-p)*(m-e)>0,r=t.every(t=>t[i]+t[o]<=e||t[i]>=e||t[a]+t[s]<=d||t[a]>=f);if(n&&r)for(let t of l)t[i]=e}e=c+1}}var jt=12,Mt=8,Nt=4;function Pt(t,n,r){let i=t.map(e=>({axis:e.axis,cross:e.cross,after:e.after??0,rank:0,real:!0})),a=t.map(()=>[]),o=t.map(()=>[]),s=n.flatMap((e,t)=>e.from===e.to?[]:[t]),c=(0,e.findBackEdges)(s.map(e=>({source:String(n[e].from),target:String(n[e].to)})),t.map((e,t)=>String(t))),l=s.map((e,t)=>{let r=n[e];return c.has(t)?{index:e,u:r.to,v:r.from,reversed:!0}:{index:e,u:r.from,v:r.to,reversed:!1}}),u=t.map(()=>[]),d=t.map(()=>0);for(let e of l)u[e.u].push(e.v),d[e.v]++;let f=d.flatMap((e,t)=>e===0?[t]:[]);for(let e=0;e<f.length;e++){let t=f[e];for(let e of u[t])i[e].rank=Math.max(i[e].rank,i[t].rank+2),--d[e]===0&&f.push(e)}let p=l.map(e=>{let t=(i[e.v].rank-i[e.u].rank)/2,r=i[e.u].rank+2*Math.floor(t/2)+1,s=n[e.index].label,c=[e.u];for(let t=i[e.u].rank+1;t<i[e.v].rank;t++){let e=i.length,n=t===r&&s!==void 0;i.push({axis:n?s.axis:0,cross:n?s.cross:0,after:0,rank:t,real:!1}),a.push([]),o.push([]),c.push(e)}c.push(e.v);for(let e=1;e<c.length;e++)o[c[e-1]].push(c[e]),a[c[e]].push(c[e-1]);return{chain:c,labelRank:r}}),m=i.map((e,t)=>t),h=e=>{let t=e;for(;m[t]!==t;)t=m[t]=m[m[t]];return t};for(let{chain:e}of p)for(let t of e)m[h(t)]=h(e[0]);let g=new Map;i.forEach((e,t)=>{let n=h(t);g.set(n,[...g.get(n)??[],t])});let _=i.map(()=>0),v=[],y=[];for(let e of g.values()){let t=Ft(e,i,a,o,r),n=1/0,s=-1/0;for(let r of e)_[r]=t.get(r),n=Math.min(n,_[r]-i[r].cross/2),s=Math.max(s,_[r]+i[r].cross/2+i[r].after);v.push({min:n,max:s}),y.push(e)}let b=0;y.forEach((e,t)=>{let n=b-v[t].min;for(let t of e)_[t]=_[t]+n;b+=v[t].max-v[t].min+r.nodeSep});let x=Math.max(0,b-r.nodeSep),S=i.reduce((e,t)=>Math.max(e,t.rank),0),C=Array(S+1).fill(0);for(let e of i)C[e.rank]=Math.max(C[e.rank],e.axis);let w=Array(S+1).fill(0);for(let e=1;e<=S;e++)w[e]=w[e-1]+C[e-1]+r.rankSep/2;let T=e=>w[i[e].rank]+C[i[e].rank]/2,E=n.map(()=>[]),D=n.map(()=>void 0);return l.forEach((e,t)=>{let{chain:r,labelRank:a}=p[t],o=r.slice(1,-1),s=o.map(e=>({axis:T(e),cross:_[e]}));if(E[e.index]=e.reversed?s.reverse():s,n[e.index].label){let t=o.find(e=>i[e].rank===a);D[e.index]={axis:T(t),cross:_[t]}}}),{nodes:t.map((e,t)=>({axis:w[i[t].rank]+(C[i[t].rank]-e.axis)/2,cross:_[t]-e.cross/2})),paths:E,labels:D,axisSize:w[S]+C[S],crossSize:x}}function Ft(e,t,n,r,i){let a=[],o=new Set,s=[...e].sort((e,n)=>t[e].rank-t[n].rank||e-n);for(let e of s){if(o.has(e))continue;let n=[{s:e,next:0}];for(o.add(e),(a[t[e].rank]??=[]).push(e);n.length>0;){let e=n[n.length-1],i=r[e.s][e.next++];i===void 0?n.pop():o.has(i)||(o.add(i),(a[t[i].rank]??=[]).push(i),n.push({s:i,next:0}))}}let c=a.filter(e=>e!==void 0),l=new Map,u=()=>c.forEach(e=>e.forEach((e,t)=>l.set(e,t))),d=()=>{let e=0;for(let t=0;t+1<c.length;t++){let n=c[t].flatMap(e=>r[e].map(t=>[l.get(e),l.get(t)]));for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let[i,a]=n[t],[o,s]=n[r];(i-o)*(a-s)<0&&e++}}return e};u();let f=c.map(e=>[...e]),p=d();for(let e=0;e<Mt&&p>0;e++){let t=e%2==0,i=c.map((e,t)=>t);t||i.reverse();for(let e of i){let i=t?n:r,a=e=>{let t=i[e];return t.length===0?l.get(e):t.reduce((e,t)=>e+l.get(t),0)/t.length},o=new Map(c[e].map(e=>[e,a(e)]));c[e].sort((e,t)=>o.get(e)-o.get(t)||l.get(e)-l.get(t)),c[e].forEach((e,t)=>l.set(e,t))}let a=d();a<p&&(p=a,f=c.map(e=>[...e]))}f.forEach((e,t)=>c[t]=e);let m=new Map,h=(e,n)=>(t[e].cross+t[n].cross)/2+t[e].after+(t[e].real&&t[n].real?i.nodeSep:Math.min(i.nodeSep,jt)),g=(e,t)=>{let n=e.slice(1).map((t,n)=>h(e[n],t)),r=[0];n.forEach((e,t)=>r.push(r[t]+e)),It(e.map((e,n)=>{let i=(t[e]??[]).filter(e=>m.has(e));return(i.length===0?m.get(e)??0:i.reduce((e,t)=>e+m.get(t),0)/i.length)-r[n]})).forEach((t,n)=>m.set(e[n],t+r[n]))};for(let e of c)g(e,[]);for(let e=0;e<Nt;e++){for(let e=1;e<c.length;e++)g(c[e],n);for(let e=c.length-2;e>=0;e--)g(c[e],r)}return m}function It(e){let t=[];for(let n of e)for(t.push({sum:n,count:1});t.length>1;){let e=t[t.length-1],n=t[t.length-2];if(n.sum/n.count<=e.sum/e.count)break;t.splice(-2,2,{sum:n.sum+e.sum,count:n.count+e.count})}return t.flatMap(e=>Array(e.count).fill(e.sum/e.count))}var Lt=28,Rt=18,zt=10,Bt=32;function Vt(t,n={}){let r={...R,...n,fontSizes:N(n.fontSizes)},i=t.direction===`TB`||t.direction===`TD`||t.direction===`BT`,a=t.direction===`BT`||t.direction===`RL`,o=new Map,s=new Map,c=(e,t)=>{o.set(e.id,e),t!==void 0&&s.set(e.id,t);for(let t of e.nodeIds)s.has(t)||s.set(t,e.id);for(let t of e.children)c(t,e.id)};t.subgraphs.forEach(e=>c(e));let l=[...t.nodes.keys()].filter(e=>!o.has(e)),u=new Map(l.map((e,t)=>[e,t])),d=e=>Math.min(...e.nodeIds.map(e=>u.get(e)??1/0),...e.children.map(d)),f=e=>{let t=o.get(e);return t?d(t):u.get(e)??1/0},p=e=>[...l.filter(t=>s.get(t)===e),...(e===void 0?t.subgraphs:o.get(e).children).map(e=>e.id)].map((e,t)=>({id:e,i:t})).sort((e,t)=>f(e.id)-f(t.id)||e.i-t.i).map(e=>e.id),m=e=>{let t=[e];for(let n=s.get(e);n!==void 0;n=s.get(n))t.unshift(n);return t},h=n=>{let a=t.edges[n].label;if(!a)return;let o=(0,e.measureMultilineText)(a,r.fontSizes.edgeLabel,P.edgeLabel),s=o.width+8,c=o.height+6;return i?{axis:c,cross:s}:{axis:s,cross:c}},g=new Map,_=new Map;t.edges.forEach((e,t)=>{if(e.source===e.target){_.set(e.source,[..._.get(e.source)??[],t]);return}let n=m(e.source),r=m(e.target),i=0;for(;n[i]!==void 0&&n[i]===r[i];)i++;if(i>=n.length||i>=r.length)return;let a=i===0?``:n[i-1];g.set(a,[...g.get(a)??[],{index:t,from:n[i],to:r[i]}])});let v=i?a?{axisStart:V.bottom,axisEnd:V.top,crossStart:V.left,crossEnd:V.right}:{axisStart:V.top,axisEnd:V.bottom,crossStart:V.left,crossEnd:V.right}:{axisStart:a?V.right:V.left,axisEnd:a?V.left:V.right,crossStart:V.top,crossEnd:V.bottom},y=(e,t)=>i?{aSize:t,cSize:e}:{aSize:e,cSize:t},b=new Map;for(let e of l){let n=t.nodes.get(e),i=Ne(e,n.label,n.shape,r.fontSizes.nodeLabel,n.icon,t.direction,he(t));b.set(e,y(i.width,i.height))}let x=e=>{let t=_.get(e);if(!i||!t)return 0;let n=Math.max(0,...t.map(e=>(h(e)?.cross??-10)+zt));return Lt+(t.length-1)*Rt+n},S=t=>{let n=p(t),a=new Map,s=new Map,c=new Map;for(let t of n){let n=o.get(t);if(!n){s.set(t,b.get(t));continue}let l=S(t);a.set(t,l);let u=(0,e.measureMultilineText)(n.label,r.fontSizes.groupHeader,P.groupHeader).width,d=l.axisSize+v.axisStart+v.axisEnd,f=l.crossSize+v.crossStart+v.crossEnd,p=i?0:u+Bt,m=i?u+Bt:0,h=Math.max(0,p-d),g=Math.max(0,m-f);d+=h,f+=g,s.set(t,{aSize:d,cSize:f}),c.set(t,{axis:v.axisStart+h/2,cross:v.crossStart+g/2})}let l=new Map(n.map((e,t)=>[e,t])),u=g.get(t??``)??[],d=Pt(n.map(e=>({axis:s.get(e).aSize,cross:s.get(e).cSize,after:x(e)})),u.map(e=>({from:l.get(e.from),to:l.get(e.to),label:h(e.index)})),{nodeSep:r.nodeSpacing,rankSep:r.layerSpacing}),f=new Map;return u.forEach((e,t)=>f.set(e.index,{mids:d.paths[t],label:d.labels[t]})),{members:n,at:new Map(n.map((e,t)=>[e,d.nodes[t]])),sizes:s,inset:{axis:0,cross:0},axisSize:d.axisSize,crossSize:d.crossSize,routes:f,inner:new Map([...a].map(([e,t])=>[e,{...t,inset:c.get(e)}]))}},C=S(void 0),w=new Map,T=new Map,E=(n,r,i)=>{for(let[e,t]of n.routes)T.set(e,{mids:t.mids.map(e=>({axis:e.axis+r,cross:e.cross+i})),label:t.label&&{axis:t.label.axis+r,cross:t.label.cross+i}});let a=[];for(let s of n.members){let c=n.at.get(s),l=n.sizes.get(s),u={axis:r+c.axis,cross:i+c.cross,...l};w.set(s,u);let d=n.inner.get(s);if(d){let n=o.get(s),r=E(d,u.axis+d.inset.axis,u.cross+d.inset.cross);a.push({id:s,label:n.label,x:0,y:0,width:0,height:0,children:r,...(0,e.groupStyle)(s,t),...n.region?{region:!0}:{},...n.icon?{icon:n.icon}:{}})}}return a},D=E(C,0,0),O=r.padding,k=C.axisSize,A=e=>{let t=a?k-e.axis:e.axis;return i?{x:e.cross+O,y:t+O}:{x:t+O,y:e.cross+O}},j=e=>{let t=a?k-e.axis-e.aSize:e.axis;return i?{x:e.cross+O,y:t+O,width:e.cSize,height:e.aSize}:{x:t+O,y:e.cross+O,width:e.aSize,height:e.cSize}},ee=e=>{for(let t of e)Object.assign(t,j(w.get(t.id))),ee(t.children)};ee(D);let M=l.map(n=>{let r=t.nodes.get(n);return{id:n,label:r.label,shape:r.icon===void 0?r.shape:`rectangle`,icon:r.icon,...j(w.get(n)),inlineStyle:(0,e.resolveNodeStyle)(n,t),className:t.classAssignments.get(n),interaction:t.interactions.get(n)}}),te=new Map(M.map(e=>[e.id,e])),ne=[];t.edges.forEach((e,n)=>{let r=T.get(n);if(!r)return;let i=w.get(e.source),a=w.get(e.target),o=i.axis>a.axis,[s,c]=o?[a,i]:[i,a],l=[{axis:s.axis+s.aSize,cross:s.cross+s.cSize/2},...o?[...r.mids].reverse():r.mids,{axis:c.axis,cross:c.cross+c.cSize/2}],u=[l[0]];for(let e of l.slice(1)){let t=u[u.length-1];if(t.cross!==e.cross){let n=(t.axis+e.axis)/2;u.push({axis:n,cross:t.cross},{axis:n,cross:e.cross})}u.push(e)}let d=at(Ht(u.map(A)));o&&d.reverse();let f=te.get(e.source),p=te.get(e.target);f&&(d=Ue(d,f,!0)),p&&(d=Ue(d,p,!1)),ne.push({source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:d,labelPosition:r.label&&A(r.label),inlineStyle:Dt(n,t),headColor:Et(t),id:e.id,animate:e.animate,startMarker:e.startMarker,endMarker:e.endMarker})}),mt(t,te,ne);let F=(i?C.crossSize:C.axisSize)+O*2,I=(i?C.axisSize:C.crossSize)+O*2;for(let e of ne){for(let t of e.points)F=Math.max(F,t.x+re.width+O),I=Math.max(I,t.y+re.width+O);e.labelPosition&&(F=Math.max(F,e.labelPosition.x+60+O),I=Math.max(I,e.labelPosition.y+20+O))}return{width:F,height:I,nodes:M,edges:ne,groups:D}}function Ht(e){return e.filter((t,n)=>{let r=e[n-1],i=e[n+1];return!r||!i||!(r.x===t.x&&t.x===i.x||r.y===t.y&&t.y===i.y)})}function Ut(e,t={}){let n={...R,...t,fontSizes:N(t.fontSizes)};return gt(E(ze(e,n),t.layoutCache),e,n.mergeEdges)}function Wt(e,t={}){let n=Gt(e,t),r=new Set,i=e=>{for(let t of e)t.stateComposite&&r.add(t.id),i(t.children)};i(e.subgraphs);let a=e=>{for(let t of e)!t.region&&!r.has(t.id)&&(t.bandless=!0),a(t.children)};return a(n.groups),e.stateDiagram&&(n.stateDiagram=!0),n}function Gt(t,n){let r=(0,e.withoutOwnClusterEdges)(t);if(n.layout===`simple`&&!he(r))return Vt(r,n);if(n.layout!==void 0&&n.layout!==`elk`&&n.layout!==`simple`)throw Error(`zombie-mermaid: unknown layout ${JSON.stringify(n.layout)}; use 'elk' or 'simple'.`);let i=Ut(r,n);if(H(r)){let e=t=>t.flatMap(t=>[t,...e(t.children)]);At(i.edges,i.nodes,e(i.groups),r.direction)}return i}function Kt(e,t={}){return ze(e,{...R,...t,fontSizes:N(t.fontSizes)})}var qt=2;function Jt(e){return e.flatMap(e=>[e,...Jt(e.children)])}function Yt(t,n){let r=n.groupHeader+16;return Jt(t).filter(e=>e.label!==``).map(t=>{let i=(0,e.measureMultilineText)(t.label,n.groupHeader,400);return{x:t.x+t.width/2-i.width/2-qt,y:t.y+(t.bandless?r:26)/2-i.height/2-qt,width:i.width+4,height:i.height+4}})}function Xt(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=[-r,r,-i,i],o=[e.x-n.x,n.x+n.width-e.x,e.y-n.y,n.y+n.height-e.y],s=0,c=1;for(let e=0;e<4;e++){let t=a[e],n=o[e];if(t===0){if(n<0)return!1}else{let e=n/t;if(t<0?s=Math.max(s,e):c=Math.min(c,e),s>c)return!1}}return!0}function Zt(e){return{x:e.x+qt,y:e.y+qt,width:e.width-4,height:e.height-4}}function Qt(e,t){let n=e.points,r=t.map(Zt);for(let e=0;e+1<n.length;e++)if(r.some(t=>Xt(n[e],n[e+1],t)))return!0;return!1}function $t(e){let t=2166136261;for(let n of e.map(e=>`${e.x},${e.y},${e.width},${e.height}`).join(`;`))t=Math.imul(t^n.charCodeAt(0),16777619);return(t>>>0).toString(36)}function en(e,t,n){let r=`zm-title-gap-${$t(e)}`;return{id:r,markup:` <mask id="${r}" maskUnits="userSpaceOnUse" x="0" y="0" width="${t}" height="${n}">\n <rect x="0" y="0" width="${t}" height="${n}" fill="#fff" />\n${e.map(e=>` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000" />`).join(`
|
|
9
|
-
`)}\n </mask>`}}function
|
|
10
|
-
`)}function
|
|
11
|
-
`)}function
|
|
8
|
+
}`;function k(t,n,r){return(0,e.measureTextWidth)(t,n,r)}function A(e,t){return e.length*t*.6}var ee=`'JetBrains Mono'`,te=`${ee}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,j={nodeLabel:13,edgeLabel:11,groupHeader:12};function ne(e){return{nodeLabel:e?.nodeLabel??j.nodeLabel,edgeLabel:e?.edgeLabel??j.edgeLabel,groupHeader:e?.groupHeader??j.groupHeader}}var M={nodeLabel:500,edgeLabel:400,groupHeader:600},re=12,ie=12,N={horizontal:20,vertical:10,diamondExtra:24},P={outerBox:1,innerBox:.75,connector:1},F=`0.35em`,ae={width:8,height:5};function oe(t,n,r,i){return(0,e.buildStyleBlock)(t,n?{family:D,faceCss:O}:!1,r,i)}var I={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!1,thoroughness:3,fontSizes:j},se=`#087ebf`,ce={blank:``,database:`<path d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><ellipse cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line>`,disk:`<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></rect><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></ellipse><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"></path>`,server:`<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></rect><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"></path><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"></path></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"></circle></g>`,cloud:`<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path>`,internet:`<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></circle><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></path><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"></line>`},le={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,c4:`DOWN`};function ue(e,t){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`BT`:return`UP`;case`TD`:case`TB`:return`DOWN`;default:return t}}function de(e){let t=typeof e==`number`?{top:e,left:e,bottom:e,right:e}:e;return`[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`}function fe(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":de(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function pe(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var me={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function he(t,n){let r=(0,e.measureMultilineText)(t,n.fontSize,M.edgeLabel),i={text:t,width:r.width+8,height:r.height+6};return n.layoutOptions&&(i.layoutOptions={...n.layoutOptions}),i}function ge(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[he(e.label,e.labelStyle)]),t}var _e={"state-start":`FIRST`},ve={"elk.layered.cycleBreaking.strategy":`MODEL_ORDER`,"elk.layered.compaction.postCompaction.strategy":`NONE`};function ye(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var be={top:51,left:24,bottom:24,right:24},xe={top:51,left:24,bottom:24,right:24},L={top:44,left:16,bottom:16,right:16},Se={top:16,left:16,bottom:16,right:16};function Ce(e){let t=new Map;for(let n of e.edges){if(!n.label)continue;let e=`${n.source}\0${n.target}`,r=(t.get(e)??0)+1;if(r>=3)return!0;t.set(e,r)}return!1}function R(e){return e.subgraphs.length>0&&!ye(e)}function we(e,t,n){if(!(!R(e)||t.nodeSpacing!==I.nodeSpacing||t.layerSpacing!==I.layerSpacing))return n===`root`?{"spacing.baseValue":`40`}:{"spacing.baseValue":`24`,"elk.spacing.nodeNode":`50`,"elk.layered.spacing.edgeNodeBetweenLayers":`30`,"elk.spacing.edgeEdge":`20`}}var Te=[`elk.spacing.nodeNode`,`elk.layered.spacing.nodeNodeBetweenLayers`,`elk.spacing.edgeEdge`,`elk.layered.spacing.edgeEdgeBetweenLayers`,`elk.layered.spacing.edgeNodeBetweenLayers`,`elk.contentAlignment`];function Ee(e,t){if(!t)return e;let n={...e};for(let e of Te)delete n[e];return{...n,...t}}function De(e){let t=new Map,n=(e,r)=>{for(let i of e){r&&t.set(i.id,r);for(let e of i.nodeIds)t.set(e,i.id);n(i.children,i.id)}};n(e.subgraphs);let r=(e,n)=>{for(let r=t.get(e);r!==void 0;r=t.get(r))if(r===n)return!0;return!1},i=e.edges,a=i.map((e,t)=>t);return i.forEach(({source:e,target:t},n)=>{let o=a.indexOf(n),s=a.findIndex((n,a)=>{let s=i[n];return a<o&&(s.target===t&&r(e,s.source)||s.source===e&&r(t,s.target))});s!==-1&&(a.splice(o,1),a.splice(s,0,n))}),a}var Oe=`[top=12,left=12,bottom=12,right=12]`,ke=new WeakMap;function Ae(t){let n=ke.get(t);return n||(n=ze(t.subgraphs)?new Set:R(t)?(0,e.subgraphFeedbackEdges)(t):(0,e.findBackEdgeIndexes)(t,void 0,(0,e.subgraphFeedbackEdges)(t)),ke.set(t,n)),n}function je(e,t){for(let n=0;n<e.edges.length;n++){let r=e.edges[n];if(t.has(r.source)||t.has(r.target))return n}return 1/0}function Me(e){return ue(e,le.flowchart)}function Ne(e){return{...fe(e),"elk.spacing.edgeEdge":`12`,"elk.layered.spacing.edgeEdgeBetweenLayers":`12`,"elk.layered.spacing.edgeNodeBetweenLayers":`12`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.contentAlignment":`H_CENTER V_CENTER`}}function Pe(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:me}}var Fe=136,Ie=40;function Le(t,n,r,i,a,o,s=!1){if(a!==void 0)return{width:80,height:80};let c=(0,e.measureMultilineText)(n,i,M.nodeLabel),l=c.width+N.horizontal*2,u=c.height+N.vertical*2;if(r===`diamond`){let e=Math.max(l,u)+N.diamondExtra;l=e,u=e}if(r===`circle`||r===`doublecircle`){let e=Math.ceil(Math.sqrt(l*l+u*u))+8;l=r===`doublecircle`?e+12:e,u=l}if(r===`hexagon`&&(l+=N.horizontal),(r===`trapezoid`||r===`trapezoid-alt`||r===`parallelogram`||r===`parallelogram-alt`)&&(l+=N.horizontal),r===`asymmetric`&&(l+=12),r===`cylinder`&&(u+=14),r===`cloud`){let e=Math.max(l,u*2.5);return{width:e*1.25,height:u+e*.48}}return r===`small-circle`?{width:14,height:14}:r===`fork-bar`?o===`LR`||o===`RL`?{width:10,height:70}:{width:70,height:10}:r===`state-start`||r===`state-end`?{width:14,height:14}:r===`junction`?{width:2,height:2}:n===``&&r===`diamond`?{width:28,height:28}:n===``&&r===`fork-join`?{width:70,height:10}:(l=Math.max(l,s?Fe:60),u=Math.max(u,s?Ie:36),{width:l,height:u})}var Re=` root`;function ze(e){for(let t of e)if(t.direction!==void 0||ze(t.children))return!0;return!1}function Be(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)Be(n,t)}function Ve(e){let t=new Map;function n(e,r){let i=[...r,e.id];t.set(e.id,i);for(let t of e.children)n(t,i)}for(let t of e)n(t,[]);return t}function He(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function Ue(e,t){let n=t,r=new Set,i=new Set;for(let t of e.subgraphs)i.add(t.id),Ge(t,r,i);let a=Ke(e.subgraphs),o=Ve(e.subgraphs),s=e=>e?o.get(e)??[]:[],c=new Map;c.set(null,[]);let l=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=a.get(n.source),i=a.get(n.target);if(r&&r===i){let e=c.get(r)??[];c.set(r,e),e.push({index:t,edge:n})}else!r&&!i?c.get(null).push({index:t,edge:n}):l.push({index:t,edge:n,srcChain:s(r),tgtChain:s(i)})}let u=ze(e.subgraphs),d=[],f=[],p={...Ee(Ne({direction:Me(e.direction),nodeSpacing:n.nodeSpacing,layerSpacing:ye(e)&&n.layerSpacing===I.layerSpacing?40:n.layerSpacing,padding:n.padding}),we(e,n,`root`)),...R(e)?{}:{"elk.layered.thoroughness":String(I.thoroughness)},"elk.layered.highDegreeNodes.treatment":`false`,"elk.layered.compaction.postCompaction.strategy":e.subgraphs.length===0||Ce(e)||R(e)?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...R(e)?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{},...Ce(e)?{"elk.spacing.edgeEdge":R(e)?`50`:`40`}:{},...ye(e)?ve:{},"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":u?`SEPARATE`:`INCLUDE_CHILDREN`},m=new Map,h=new Map;function g(e,t){let n=m.get(e)??new Set;m.set(e,n),n.add(t)}function _(e,t){let n=h.get(e)??[];h.set(e,n),n.push(t)}if(u)for(let{index:e,edge:t,srcChain:r,tgtChain:i}of l){let a=He(r,i),o=t.source;if(r.length>a){for(let n=r.length-1;n>=a;n--){let i=r[n],a=`${i}_out_${e}`;g(i,a);let o=n===r.length-1?t.source:`${r[n+1]}_out_${e}`;_(i,{id:`e${e}_s${n}`,sources:[o],targets:[a]})}o=`${r[a]}_out_${e}`}let s=t.target;if(i.length>a){for(let n=a;n<=i.length-1;n++){let r=i[n],a=`${r}_in_${e}`;g(r,a);let o=n===i.length-1?t.target:`${i[n+1]}_in_${e}`;_(r,{id:`e${e}_t${n}`,sources:[a],targets:[o]})}s=`${i[a]}_in_${e}`}_(a>0?r[a-1]:Re,ge({id:`e${e}`,source:o,target:s,label:t.label,labelStyle:Pe(n)}))}for(let[t,a]of e.nodes)if(!r.has(t)&&!i.has(t)){let r=pe(t,Le(t,a.label,a.shape,n.fontSizes.nodeLabel,a.icon,e.direction,ye(e)),a.label),i=ye(e)?_e[a.shape]:void 0;i!==void 0&&(r.layoutOptions={"elk.layered.layering.layerConstraint":i}),d.push(r)}let v=ye(e),y=d.length,b=v?e.subgraphs:[...e.subgraphs].reverse();for(let t of b)d.push(We(t,e,n,c,m,h,e.direction));if(R(e)&&d.unshift(...d.splice(y)),v&&e.subgraphs.length>0){let t=d.map((t,n)=>{if(n<y)return je(e,new Set([t.id]));let r=e.subgraphs[n-y],i=je(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return Be(r,a),je(e,a)}),n=d.map((e,t)=>t).sort((e,n)=>t[e]-t[n]||e-n).map(e=>d[e]);d.splice(0,d.length,...n)}let x=Ae(e),S=R(e)&&!u,C=c.get(null);if(S)for(let t of De(e)){let r=e.edges[t];f.push(ge({id:`e${t}`,source:x.has(t)?r.target:r.source,target:x.has(t)?r.source:r.target,label:r.label,labelStyle:Pe(n)}))}for(let{index:e,edge:t}of S?[]:C)t.source!==t.target&&f.push(ge({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:Pe(n)}));if(u)for(let e of h.get(Re)??[])f.push(e);else for(let{index:e,edge:t}of S?[]:l)f.push(ge({id:`e${e}`,source:x.has(e)?t.target:t.source,target:x.has(e)?t.source:t.target,label:t.label,labelStyle:Pe(n)}));return{id:`root`,layoutOptions:p,children:d,edges:f}}function We(t,n,r,i,a,o,s){let c=t.direction!==void 0&&(0,e.subgraphDirectionIsHonored)(t,n)?t.direction:s,l=Ee(Ne({direction:Me(c),nodeSpacing:r.nodeSpacing,layerSpacing:ye(n)&&r.layerSpacing===I.layerSpacing?24:r.layerSpacing,padding:t.region?Se:ye(n)?be:R(n)?xe:L}),we(n,r,`subgraph`));if(R(n)&&!t.region){let n=(0,e.measureMultilineText)(t.label,r.fontSizes.groupHeader,M.groupHeader).width+24;l[`elk.nodeSize.constraints`]=`[MINIMUM_SIZE]`,l[`elk.nodeSize.minimum`]=c===`TD`||c===`TB`||c===`BT`?`(0, ${n})`:`(${n}, 0)`}R(n)&&(l[`elk.layered.cycleBreaking.strategy`]=`DEPTH_FIRST`,l[`elk.spacing.portsSurrounding`]=Oe);let u,d=a.get(t.id);d&&d.size>0&&(u=[...d].map(e=>({id:e})));let f=[],p=R(n),m=p?[...n.nodes.keys()].filter(e=>t.nodeIds.includes(e)):t.nodeIds;for(let e of m){let t=n.nodes.get(e);if(t){let i=pe(e,Le(e,t.label,t.shape,r.fontSizes.nodeLabel,t.icon,n.direction,ye(n)),t.label);f.push(i)}}let h=t.children.some(e=>e.region)?t.children:[...t.children].reverse(),g=f.length;for(let e of h)f.push(We(e,n,r,i,a,o,c));p&&f.unshift(...f.splice(g));let _=[],v=i.get(t.id)??[],y=Ae(n);for(let{index:e,edge:t}of R(n)&&!ze(n.subgraphs)?[]:v)t.source!==t.target&&_.push(ge({id:`e${e}`,source:y.has(e)?t.target:t.source,target:y.has(e)?t.source:t.target,label:t.label,labelStyle:Pe(r)}));for(let e of o.get(t.id)??[])_.push(e);return{id:t.id,layoutOptions:l,labels:t.label?[{text:t.label}]:void 0,ports:u,children:f,edges:_}}function Ge(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),Ge(r,t,n)}function Ke(e){let t=new Map;function n(e){for(let n of e.nodeIds)t.set(n,e.id);for(let t of e.children)n(t)}for(let t of e)n(t);return t}function qe(e,t,n){if(e.length<2||t.shape===`rectangle`||t.shape===`rounded`||t.shape===`stadium`)return e;let r=[...e];if(t.shape===`diamond`){if(n)r[0]=Je(e[0],e[1],t);else{let n=e.length-1;r[n]=Je(e[n],e[n-1],t)}}if(t.shape===`asymmetric`){let i=n?0:e.length-1,a=e[i],o=t.height/2,s=Math.abs(a.y-(t.y+o));Math.abs(a.x-t.x)<.5&&s<o&&(r[i]={x:t.x+12*(1-s/o),y:a.y})}return r}function Je(e,t,n){let r=n.x+n.width/2,i=n.y+n.height/2,a={x:r,y:n.y},o={x:n.x+n.width,y:i},s={x:r,y:n.y+n.height},c={x:n.x,y:i},l=e.x-t.x,u=e.y-t.y;if(Math.abs(l)<Math.abs(u)){let t=e.x;return u>0?t<=r?Xe(t,c,a)??a:Xe(t,a,o)??a:t<=r?Xe(t,s,c)??s:Xe(t,o,s)??s}{let t=e.y;return l>0?t<=i?Ye(t,a,c)??c:Ye(t,c,s)??c:t<=i?Ye(t,a,o)??o:Ye(t,o,s)??o}}function Ye(e,t,n){let r=n.y-t.y;if(Math.abs(r)<.001)return null;let i=(e-t.y)/r;return i<0||i>1?null:{x:t.x+i*(n.x-t.x),y:e}}function Xe(e,t,n){let r=n.x-t.x;if(Math.abs(r)<.001)return null;let i=(e-t.x)/r;return i<0||i>1?null:{x:e,y:t.y+i*(n.y-t.y)}}var Ze=12;function Qe(e,t,n){if(e.length===0)return;let r=n===`LR`||n===`RL`,i=new Set;for(let e of t)i.add(`${e.source}:${e.target}`),i.add(`${e.target}:${e.source}`);let a=I.layerSpacing*.6,o=[...e].sort((e,t)=>r?e.x-t.x:e.y-t.y),s=[],c=[o[0]];for(let e=1;e<o.length;e++){let t=(r?o[e].x:o[e].y)-(r?o[e-1].x:o[e-1].y),n=c.some(t=>i.has(`${t.id}:${o[e].id}`));t<=a&&!n?c.push(o[e]):(s.push(c),c=[o[e]])}s.push(c);let l=new Map;for(let e of s){if(e.length<=1)continue;let t=e.map(e=>r?e.x:e.y),n=Math.min(...t),i=Math.max(...t);if(i-n<=1)continue;let a=(n+i)/2;for(let t of e){let e=a-(r?t.x:t.y);Math.abs(e)>.5&&(r?t.x=a:t.y=a,l.set(t.id,e))}}l.size!==0&&$e(t,l,r?`x`:`y`)}function $e(e,t,n){let r=(e,t,r,i)=>{let a=e[t],o=a[n];a[n]+=i;let[s,c,l]=[1,2,3].map(n=>e[t+n*r]);if(s[n]===o)s[n]+=i;else if(c&&l&&c[n]===s[n]){let e=Math.sign(s[n]-o),t=s[n]+e*Math.max(0,Ze-e*(s[n]-a[n]));e*(l[n]-t)>0&&(s[n]=c[n]=t)}};for(let n of e){let{points:e}=n;if(e.length<2)continue;let i=t.get(n.source),a=t.get(n.target);i!=null&&r(e,0,1,i),a!=null&&r(e,e.length-1,-1,a)}}var et=.5;function tt(e,t,n){for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=Math.min(i.x,a.x),s=Math.max(i.x,a.x),c=Math.min(i.y,a.y),l=Math.max(i.y,a.y);for(let e of t){if(n.has(e.id))continue;let t=e.x+et,r=e.x+e.width-et,i=e.y+et,a=e.y+e.height-et;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function nt(e,t,n){let r=[];for(let i of n)e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height&&(r.push(i),r.push(...nt(e,t,i.children)));return r}function rt(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(nt(t,n,r).map(e=>e.id)),u=nt(c?e:t,c?n:e,r).find(e=>!l.has(e.id));return u?a?u.x-12:o?u.x+u.width+12:s?u.y+u.height+12:u.y-12:e}var it=2;function at(e,t,n,r,i){for(let a of e){if(t.has(a)||a.source===a.target)continue;let e=a.source===n?a.points[0]:a.target===n?a.points[a.points.length-1]:void 0;if(e&&Math.abs((i?e.x:e.y)-r)<=it)return!0}return!1}function ot(e,t,n,r){let i=new Map(t.map(e=>[e.id,e])),a=new Set,o=new Map,s=e=>`${e.source}\0${e.target}`;for(let t of e)o.set(s(t),(o.get(s(t))??0)+1);let c=e=>o.get(s(e))>1,l=r===`LR`,u=r===`RL`,d=r===`BT`,f=l||u,p=new Map;for(let t of e){if(t.source===t.target||c(t))continue;let e=p.get(t.source)??[];p.set(t.source,e),e.push(t)}for(let[o,s]of p){if(s.length<2)continue;let c=s[0].style;if(s.some(e=>e.label||e.style!==c))continue;let p=i.get(o);if(!p)continue;let m=[];for(let e of s){let t=i.get(e.target);t&&(l?t.x>p.x+p.width:u?t.x+t.width<p.x:d?t.y+t.height<p.y:t.y>p.y+p.height)&&m.push({edge:e,node:t})}if(m.length<2)continue;let h=p.x+p.width/2,g=p.y+p.height/2;if(f){let i=l?p.x+p.width:p.x,s=g;if(at(e,new Set(m.map(e=>e.edge)),o,i,!0))continue;let c=i+((l?Math.min(...m.map(e=>e.node.x)):Math.max(...m.map(e=>e.node.x+e.node.width)))-i)/2;c=rt(c,h,g,n,r);let u=[];for(let{edge:e,node:n}of m){let r=l?n.x:n.x+n.width,a=n.y+n.height/2,d=[{x:i,y:s},{x:c,y:s},{x:c,y:a},{x:r,y:a}];tt(d,t,new Set([o,n.id]))&&u.push({edge:e,points:d})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t,a.add(e)}else{let i=h,s=d?p.y:p.y+p.height;if(at(e,new Set(m.map(e=>e.edge)),o,s,!1))continue;let c=s+((d?Math.max(...m.map(e=>e.node.y+e.node.height)):Math.min(...m.map(e=>e.node.y)))-s)/2;c=rt(c,h,g,n,r);let l=[];for(let{edge:e,node:n}of m){let r=n.x+n.width/2,a=d?n.y+n.height:n.y,u=[{x:i,y:s},{x:i,y:c},{x:r,y:c},{x:r,y:a}];tt(u,t,new Set([o,n.id]))&&l.push({edge:e,points:u})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}}let m=new Map;for(let t of e){if(a.has(t)||t.source===t.target||c(t))continue;let e=m.get(t.target)??[];m.set(t.target,e),e.push(t)}for(let[a,o]of m){if(o.length<2)continue;let s=o[0].style;if(o.some(e=>e.label||e.style!==s))continue;let c=i.get(a);if(!c)continue;let p=[];for(let e of o){let t=i.get(e.source);t&&(l?t.x+t.width<c.x:u?t.x>c.x+c.width:d?t.y>c.y+c.height:t.y+t.height<c.y)&&p.push({edge:e,node:t})}if(p.length<2)continue;let m=c.x+c.width/2,h=c.y+c.height/2;if(f){let i=l?c.x:c.x+c.width,o=h;if(at(e,new Set(p.map(e=>e.edge)),a,i,!0))continue;let s=l?Math.max(...p.map(e=>e.node.x+e.node.width)):Math.min(...p.map(e=>e.node.x)),u=s+(i-s)/2;u=rt(u,m,h,n,r);let d=[];for(let{edge:e,node:n}of p){let r=l?n.x+n.width:n.x,s=n.y+n.height/2,c=[{x:r,y:s},{x:u,y:s},{x:u,y:o},{x:i,y:o}];tt(c,t,new Set([n.id,a]))&&d.push({edge:e,points:c})}if(d.length<2)continue;for(let{edge:e,points:t}of d)e.points=t}else{let i=m,o=d?c.y+c.height:c.y;if(at(e,new Set(p.map(e=>e.edge)),a,o,!1))continue;let s=d?Math.min(...p.map(e=>e.node.y)):Math.max(...p.map(e=>e.node.y+e.node.height)),l=s+(o-s)/2;l=rt(l,m,h,n,r);let u=[];for(let{edge:e,node:n}of p){let r=n.x+n.width/2,s=[{x:r,y:d?n.y:n.y+n.height},{x:r,y:l},{x:i,y:l},{x:i,y:o}];tt(s,t,new Set([n.id,a]))&&u.push({edge:e,points:s})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t}}}var st=1.5,ct=.01;function lt(e){let t=e.map(e=>({...e})),n=0;for(;n+3<t.length;){let[e,r,i,a]=[t[n],t[n+1],t[n+2],t[n+3]],o=Math.abs(e.x-r.x)<ct&&Math.abs(i.x-a.x)<ct&&Math.abs(r.y-i.y)<ct&&Math.abs(r.x-i.x)<=st&&Math.abs(r.x-i.x)>=ct,s=Math.abs(e.y-r.y)<ct&&Math.abs(i.y-a.y)<ct&&Math.abs(r.x-i.x)<ct&&Math.abs(r.y-i.y)<=st&&Math.abs(r.y-i.y)>=ct;if(o){let r=(e.x+a.x)/2;t.splice(n,4,{x:r,y:e.y},{x:r,y:a.y})}else if(s){let r=(e.y+a.y)/2;t.splice(n,4,{x:e.x,y:r},{x:a.x,y:r})}else n++}return t}function ut(e,t=0,n=0){let r=[];if(!e.sections||e.sections.length===0)return r;let i=e.sections[0];if(r.push({x:i.startPoint.x+t,y:i.startPoint.y+n}),i.bendPoints)for(let e of i.bendPoints)r.push({x:e.x+t,y:e.y+n});return r.push({x:i.endPoint.x+t,y:i.endPoint.y+n}),r}function dt(e,t=0,n=0){if(!e.labels||e.labels.length===0)return;let r=e.labels[0];if(r.x!=null&&r.y!=null)return{x:r.x+(r.width??0)/2+t,y:r.y+(r.height??0)/2+n}}var ft=20,pt=4,mt=24,ht={width:8,height:6};function gt(e,t,n){let r=t===`TD`||t===`TB`||t===`BT`,i=t===`BT`||t===`RL`,a=n.length,o=r?e.height:e.width,s=r?e.y+e.height/2:e.x+e.width/2,c=r?e.x:e.y,l=Math.max(o-mt,8)/(2*a+1),u=0;return n.map((t,n)=>{u+=ft;let a=c-u,o=l*(2*n+1)/2,[d,f]=i?[s+o,s-o]:[s-o,s+o],p=(e,t)=>r?{x:e,y:t}:{x:t,y:e},m=e.shape===`diamond`||e.shape===`asymmetric`?c+(r?e.width:e.height)/2:c,h=[p(m,d),p(a,d),p(a,f),p(m,f)],g=p(a,s),_=a;if(t){let e=r?t.width:t.height;g=p(a-pt-e/2,s),_=a-pt-e,u+=e+pt}let v=t?(r?t.height:t.width)/2:0,y=Math.min(d,f,s-v);return{points:h,labelPosition:g,minX:r?_:y,minY:r?y:_}})}function _t(t,n,r,i=j.edgeLabel){let a=1/0,o=1/0,s=new Map;t.edges.forEach((e,t)=>{e.source!==e.target||!n.has(e.source)||s.set(e.source,[...s.get(e.source)??[],t])});for(let[c,l]of s){let s=gt(n.get(c),t.direction,l.map(n=>{let r=t.edges[n].label;if(!r)return;let a=(0,e.measureMultilineText)(r,i,M.edgeLabel);return{width:a.width+ht.width,height:a.height+ht.height}}));l.forEach((e,n)=>{let i=t.edges[e],{points:c,labelPosition:l,...u}=s[n];a=Math.min(a,u.minX),o=Math.min(o,u.minY),r.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:c,labelPosition:i.label?l:void 0,inlineStyle:jt(e,t),headColor:At(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})})}return{minX:a,minY:o}}function vt(e,t,n,r,i){let a=e=>{e.x+=r,e.y+=i};for(let t of e)a(t);for(let e of t)e.points.forEach(a),e.labelPosition&&a(e.labelPosition);let o=e=>{for(let t of e)a(t),o(t.children)};o(n)}function yt(e){let t=[];for(let n of e)t.push({x:n.x,y:n.y,right:n.x+n.width,bottom:n.y+n.height}),t.push(...yt(n.children));return t}function bt(e,t,n=!1,r){let i=[],a=[],o=[],s=new Set;for(let e of t.subgraphs)kt(e,s);xt(e,t,s,i,o,0,0);let c=yt(o);wt(e,t,a,0,0,c.length>0?{leftX:Math.min(...c.map(e=>e.x))-20,rightX:Math.max(...c.map(e=>e.right))+20}:void 0),Qe(i,a,t.direction);let l=new Map(i.map(e=>[e.id,e])),u=_t(t,l,a,r),d=Math.max(0,I.padding-u.minX),f=Math.max(0,I.padding-u.minY);(d>0||f>0)&&vt(i,a,o,d,f),n&&ot(a,i,o,t.direction);for(let e of a){e.points=lt(e.points);let t=l.get(e.source),n=l.get(e.target);t&&(e.points=qe(e.points,t,!0)),n&&(e.points=qe(e.points,n,!1))}let p=(e.width??800)+d,m=(e.height??600)+f,h=ae.width,g=I.padding;for(let e of a){for(let t of e.points)p=Math.max(p,t.x+h+g),m=Math.max(m,t.y+h+g);e.labelPosition&&(p=Math.max(p,e.labelPosition.x+60+g),m=Math.max(m,e.labelPosition.y+20+g))}return{width:p,height:m,nodes:i,edges:a,groups:o}}function xt(t,n,r,i,a,o,s){if(t.children)for(let c of t.children){let t=(c.x??0)+o,l=(c.y??0)+s,u=c.width??0,d=c.height??0;if(r.has(c.id)){let o=[];xt(c,n,r,i,o,t,l);let s=Ot(n.subgraphs,c.id);a.push({id:c.id,label:s?.label??``,x:t,y:l,width:u,height:d,children:o,...(0,e.groupStyle)(c.id,n),...s?.region?{region:!0}:{},...s?.icon?{icon:s.icon}:{}})}else{let o=n.nodes.get(c.id);if(o){let r=(0,e.resolveNodeStyle)(c.id,n),a=n.classAssignments.get(c.id);i.push({id:c.id,label:o.label,shape:o.icon===void 0?o.shape:`rectangle`,icon:o.icon,x:t,y:l,width:u,height:d,inlineStyle:r,className:a,interaction:n.interactions.get(c.id)})}c.children&&c.children.length>0&&xt(c,n,r,i,a,t,l)}}}function St(e){let t=/^e(\d+)$/.exec(e);if(t)return{edgeIndex:parseInt(t[1],10),role:`bridge`};let n=/^e(\d+)_([st])(\d+)$/.exec(e);if(n)return{edgeIndex:parseInt(n[1],10),role:n[2]===`s`?`source`:`target`,level:parseInt(n[3],10)}}function Ct(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}let n=t/2;for(let t=1;t<e.length;t++){let r=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y,a=Math.sqrt(r*r+i*i);if(n<=a){let o=n/a;return{x:e[t-1].x+o*r,y:e[t-1].y+o*i}}n-=a}return e[e.length-1]}function wt(e,t,n,r,i,a){let o=new Map;Tt(e,o,0,0);let s=new Map;Dt(e,s,0,0,o);let c=0;for(let[e,r]of s){let i=t.edges[e];if(!i||i.source===i.target)continue;let o=[],s=e=>{!e||e.points.length===0||(o.length>0?o.push(...e.points.slice(1)):o.push(...e.points))},l=[...r.sourceHops.keys()].sort((e,t)=>t-e);for(let e of l)s(r.sourceHops.get(e));s(r.bridge);let u=[...r.targetHops.keys()].sort((e,t)=>e-t);for(let e of u)s(r.targetHops.get(e));let d;i.label&&o.length>=2&&(d=r.bridge?.labelPosition??Ct(o));let f=Et(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=Ct(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:Ae(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:jt(e,t),headColor:At(t),id:i.id,animate:i.animate,startMarker:i.startMarker,endMarker:i.endMarker})}}function Tt(e,t,n,r){t.set(e.id,{x:n,y:r});for(let i of e.children??[]){let e=i.x??0,a=i.y??0;Tt(i,t,n+e,r+a)}}function Et(e,t,n=0){if(e.length<2)return e;let r=!1;for(let t=1;t<e.length;t++){let n=Math.abs(e[t].x-e[t-1].x),i=Math.abs(e[t].y-e[t-1].y);if(n>1&&i>1){r=!0;break}}if(!r)return e;let i=[e[0]];for(let r=1;r<e.length;r++){let a=i[i.length-1],o=e[r],s=Math.abs(o.x-a.x),c=Math.abs(o.y-a.y);if(s>1&&c>1){if(t){let e=n%2==0,r=Math.floor(n/2)*12,s=e?t.rightX+r:t.leftX-r;i.push({x:s,y:a.y}),i.push({x:s,y:o.y})}else{let e=(a.y+o.y)/2;i.push({x:a.x,y:e}),i.push({x:o.x,y:e})}}i.push(o)}return i}function Dt(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=St(a.id);if(!e)continue;let{edgeIndex:o}=e,s=a.container,c=s?i.get(s):void 0,l=c?.x??n,u=c?.y??r,d=ut(a,l,u),f=dt(a,l,u),p=t.get(o)??{sourceHops:new Map,targetHops:new Map};t.set(o,p);let m={edgeIndex:o,points:d,labelPosition:f};e.role===`bridge`?p.bridge=m:e.role===`source`?p.sourceHops.set(e.level,m):p.targetHops.set(e.level,m)}if(e.children)for(let a of e.children)Dt(a,t,n+(a.x??0),r+(a.y??0),i)}function Ot(e,t){for(let n of e){if(n.id===t)return n;let e=Ot(n.children,t);if(e)return e}}function kt(e,t){t.add(e.id);for(let n of e.children)kt(n,t)}function At(e){return jt(-1,e)?.stroke}function jt(t,n){let r,i=n.linkStyles.get(`default`);i&&(r={...i});let a=n.linkStyles.get(t);return a&&(r=r?{...r,...a}:{...a}),r&&(0,e.dropInvalidColors)(r)}var Mt=e=>e===`TD`||e===`TB`||e===`BT`,Nt=8;function Pt(e,t,n,r){let i=Mt(r)?`y`:`x`,a=i===`x`?`y`:`x`,o=i===`x`?`width`:`height`,s=i===`x`?`height`:`width`;for(let{points:r}of e)for(let e=1;e<r.length-1;){let c=e;for(;c+1<r.length-1&&r[c+1][i]===r[e][i];)c++;let l=r.slice(e,c+1),u=l[0],d=Math.min(...l.map(e=>e[a])),f=Math.max(...l.map(e=>e[a])),p=r[e-1][i],m=r[c+1][i],h=n.flatMap(e=>[e[i],e[i]+e[o]].map(t=>({g:e,s:t}))).find(({g:e,s:t})=>Math.abs(u[i]-t)<Nt&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?Nt:-8),n=(e-p)*(m-e)>0,r=t.every(t=>t[i]+t[o]<=e||t[i]>=e||t[a]+t[s]<=d||t[a]>=f);if(n&&r)for(let t of l)t[i]=e}e=c+1}}var Ft=12,It=8,Lt=4;function Rt(t,n,r){let i=t.map(e=>({axis:e.axis,cross:e.cross,before:e.before??0,rank:0,real:!0})),a=t.map(()=>[]),o=t.map(()=>[]),s=n.flatMap((e,t)=>e.from===e.to?[]:[t]),c=(0,e.findBackEdges)(s.map(e=>({source:String(n[e].from),target:String(n[e].to)})),t.map((e,t)=>String(t))),l=s.map((e,t)=>{let r=n[e];return c.has(t)?{index:e,u:r.to,v:r.from,reversed:!0}:{index:e,u:r.from,v:r.to,reversed:!1}}),u=t.map(()=>[]),d=t.map(()=>0);for(let e of l)u[e.u].push(e.v),d[e.v]++;let f=d.flatMap((e,t)=>e===0?[t]:[]);for(let e=0;e<f.length;e++){let t=f[e];for(let e of u[t])i[e].rank=Math.max(i[e].rank,i[t].rank+2),--d[e]===0&&f.push(e)}let p=l.map(e=>{let t=(i[e.v].rank-i[e.u].rank)/2,r=i[e.u].rank+2*Math.floor(t/2)+1,s=n[e.index].label,c=[e.u];for(let t=i[e.u].rank+1;t<i[e.v].rank;t++){let e=i.length,n=t===r&&s!==void 0;i.push({axis:n?s.axis:0,cross:n?s.cross:0,before:0,rank:t,real:!1}),a.push([]),o.push([]),c.push(e)}c.push(e.v);for(let e=1;e<c.length;e++)o[c[e-1]].push(c[e]),a[c[e]].push(c[e-1]);return{chain:c,labelRank:r}}),m=i.map((e,t)=>t),h=e=>{let t=e;for(;m[t]!==t;)t=m[t]=m[m[t]];return t};for(let{chain:e}of p)for(let t of e)m[h(t)]=h(e[0]);let g=new Map;i.forEach((e,t)=>{let n=h(t);g.set(n,[...g.get(n)??[],t])});let _=i.map(()=>0),v=[],y=[];for(let e of g.values()){let t=zt(e,i,a,o,r),n=1/0,s=-1/0;for(let r of e)_[r]=t.get(r),n=Math.min(n,_[r]-i[r].cross/2-i[r].before),s=Math.max(s,_[r]+i[r].cross/2);v.push({min:n,max:s}),y.push(e)}let b=0;y.forEach((e,t)=>{let n=b-v[t].min;for(let t of e)_[t]=_[t]+n;b+=v[t].max-v[t].min+r.nodeSep});let x=Math.max(0,b-r.nodeSep),S=i.reduce((e,t)=>Math.max(e,t.rank),0),C=Array(S+1).fill(0);for(let e of i)C[e.rank]=Math.max(C[e.rank],e.axis);let w=Array(S+1).fill(0);for(let e=1;e<=S;e++)w[e]=w[e-1]+C[e-1]+r.rankSep/2;let T=e=>w[i[e].rank]+C[i[e].rank]/2,E=n.map(()=>[]),D=n.map(()=>void 0);return l.forEach((e,t)=>{let{chain:r,labelRank:a}=p[t],o=r.slice(1,-1),s=o.map(e=>({axis:T(e),cross:_[e]}));if(E[e.index]=e.reversed?s.reverse():s,n[e.index].label){let t=o.find(e=>i[e].rank===a);D[e.index]={axis:T(t),cross:_[t]}}}),{nodes:t.map((e,t)=>({axis:w[i[t].rank]+(C[i[t].rank]-e.axis)/2,cross:_[t]-e.cross/2})),paths:E,labels:D,axisSize:w[S]+C[S],crossSize:x}}function zt(e,t,n,r,i){let a=[],o=new Set,s=[...e].sort((e,n)=>t[e].rank-t[n].rank||e-n);for(let e of s){if(o.has(e))continue;let n=[{s:e,next:0}];for(o.add(e),(a[t[e].rank]??=[]).push(e);n.length>0;){let e=n[n.length-1],i=r[e.s][e.next++];i===void 0?n.pop():o.has(i)||(o.add(i),(a[t[i].rank]??=[]).push(i),n.push({s:i,next:0}))}}let c=a.filter(e=>e!==void 0),l=new Map,u=()=>c.forEach(e=>e.forEach((e,t)=>l.set(e,t))),d=()=>{let e=0;for(let t=0;t+1<c.length;t++){let n=c[t].flatMap(e=>r[e].map(t=>[l.get(e),l.get(t)]));for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let[i,a]=n[t],[o,s]=n[r];(i-o)*(a-s)<0&&e++}}return e};u();let f=c.map(e=>[...e]),p=d();for(let e=0;e<It&&p>0;e++){let t=e%2==0,i=c.map((e,t)=>t);t||i.reverse();for(let e of i){let i=t?n:r,a=e=>{let t=i[e];return t.length===0?l.get(e):t.reduce((e,t)=>e+l.get(t),0)/t.length},o=new Map(c[e].map(e=>[e,a(e)]));c[e].sort((e,t)=>o.get(e)-o.get(t)||l.get(e)-l.get(t)),c[e].forEach((e,t)=>l.set(e,t))}let a=d();a<p&&(p=a,f=c.map(e=>[...e]))}f.forEach((e,t)=>c[t]=e);let m=new Map,h=(e,n)=>(t[e].cross+t[n].cross)/2+t[n].before+(t[e].real&&t[n].real?i.nodeSep:Math.min(i.nodeSep,Ft)),g=(e,t)=>{let n=e.slice(1).map((t,n)=>h(e[n],t)),r=[0];n.forEach((e,t)=>r.push(r[t]+e)),Bt(e.map((e,n)=>{let i=(t[e]??[]).filter(e=>m.has(e));return(i.length===0?m.get(e)??0:i.reduce((e,t)=>e+m.get(t),0)/i.length)-r[n]})).forEach((t,n)=>m.set(e[n],t+r[n]))};for(let e of c)g(e,[]);for(let e=0;e<Lt;e++){for(let e=1;e<c.length;e++)g(c[e],n);for(let e=c.length-2;e>=0;e--)g(c[e],r)}return m}function Bt(e){let t=[];for(let n of e)for(t.push({sum:n,count:1});t.length>1;){let e=t[t.length-1],n=t[t.length-2];if(n.sum/n.count<=e.sum/e.count)break;t.splice(-2,2,{sum:n.sum+e.sum,count:n.count+e.count})}return t.flatMap(e=>Array(e.count).fill(e.sum/e.count))}var Vt=20,Ht=4,Ut=32;function Wt(t,n={}){let r={...I,...n,fontSizes:ne(n.fontSizes)},i=t.direction===`TB`||t.direction===`TD`||t.direction===`BT`,a=t.direction===`BT`||t.direction===`RL`,o=new Map,s=new Map,c=(e,t)=>{o.set(e.id,e),t!==void 0&&s.set(e.id,t);for(let t of e.nodeIds)s.has(t)||s.set(t,e.id);for(let t of e.children)c(t,e.id)};t.subgraphs.forEach(e=>c(e));let l=[...t.nodes.keys()].filter(e=>!o.has(e)),u=new Map(l.map((e,t)=>[e,t])),d=e=>Math.min(...e.nodeIds.map(e=>u.get(e)??1/0),...e.children.map(d)),f=e=>{let t=o.get(e);return t?d(t):u.get(e)??1/0},p=e=>[...l.filter(t=>s.get(t)===e),...(e===void 0?t.subgraphs:o.get(e).children).map(e=>e.id)].map((e,t)=>({id:e,i:t})).sort((e,t)=>f(e.id)-f(t.id)||e.i-t.i).map(e=>e.id),m=e=>{let t=[e];for(let n=s.get(e);n!==void 0;n=s.get(n))t.unshift(n);return t},h=n=>{let a=t.edges[n].label;if(!a)return;let o=(0,e.measureMultilineText)(a,r.fontSizes.edgeLabel,M.edgeLabel),s=o.width+8,c=o.height+6;return i?{axis:c,cross:s}:{axis:s,cross:c}},g=new Map,_=new Map;t.edges.forEach((e,t)=>{if(e.source===e.target){_.set(e.source,[..._.get(e.source)??[],t]);return}let n=m(e.source),r=m(e.target),i=0;for(;n[i]!==void 0&&n[i]===r[i];)i++;if(i>=n.length||i>=r.length)return;let a=i===0?``:n[i-1];g.set(a,[...g.get(a)??[],{index:t,from:n[i],to:r[i]}])});let v=i?a?{axisStart:L.bottom,axisEnd:L.top,crossStart:L.left,crossEnd:L.right}:{axisStart:L.top,axisEnd:L.bottom,crossStart:L.left,crossEnd:L.right}:{axisStart:a?L.right:L.left,axisEnd:a?L.left:L.right,crossStart:L.top,crossEnd:L.bottom},y=(e,t)=>i?{aSize:t,cSize:e}:{aSize:e,cSize:t},b=new Map;for(let e of l){let n=t.nodes.get(e),i=Le(e,n.label,n.shape,r.fontSizes.nodeLabel,n.icon,t.direction,ye(t));b.set(e,y(i.width,i.height))}let x=e=>(_.get(e)??[]).reduce((e,t)=>{let n=h(t)?.cross;return e+Vt+(n===void 0?0:n+Ht)},0),S=t=>{let n=p(t),a=new Map,s=new Map,c=new Map;for(let t of n){let n=o.get(t);if(!n){s.set(t,b.get(t));continue}let l=S(t);a.set(t,l);let u=(0,e.measureMultilineText)(n.label,r.fontSizes.groupHeader,M.groupHeader).width,d=l.axisSize+v.axisStart+v.axisEnd,f=l.crossSize+v.crossStart+v.crossEnd,p=i?0:u+Ut,m=i?u+Ut:0,h=Math.max(0,p-d),g=Math.max(0,m-f);d+=h,f+=g,s.set(t,{aSize:d,cSize:f}),c.set(t,{axis:v.axisStart+h/2,cross:v.crossStart+g/2})}let l=new Map(n.map((e,t)=>[e,t])),u=g.get(t??``)??[],d=Rt(n.map(e=>({axis:s.get(e).aSize,cross:s.get(e).cSize,before:x(e)})),u.map(e=>({from:l.get(e.from),to:l.get(e.to),label:h(e.index)})),{nodeSep:r.nodeSpacing,rankSep:r.layerSpacing}),f=new Map;return u.forEach((e,t)=>f.set(e.index,{mids:d.paths[t],label:d.labels[t]})),{members:n,at:new Map(n.map((e,t)=>[e,d.nodes[t]])),sizes:s,inset:{axis:0,cross:0},axisSize:d.axisSize,crossSize:d.crossSize,routes:f,inner:new Map([...a].map(([e,t])=>[e,{...t,inset:c.get(e)}]))}},C=S(void 0),w=new Map,T=new Map,E=(n,r,i)=>{for(let[e,t]of n.routes)T.set(e,{mids:t.mids.map(e=>({axis:e.axis+r,cross:e.cross+i})),label:t.label&&{axis:t.label.axis+r,cross:t.label.cross+i}});let a=[];for(let s of n.members){let c=n.at.get(s),l=n.sizes.get(s),u={axis:r+c.axis,cross:i+c.cross,...l};w.set(s,u);let d=n.inner.get(s);if(d){let n=o.get(s),r=E(d,u.axis+d.inset.axis,u.cross+d.inset.cross);a.push({id:s,label:n.label,x:0,y:0,width:0,height:0,children:r,...(0,e.groupStyle)(s,t),...n.region?{region:!0}:{},...n.icon?{icon:n.icon}:{}})}}return a},D=E(C,0,0),O=r.padding,k=C.axisSize,A=e=>{let t=a?k-e.axis:e.axis;return i?{x:e.cross+O,y:t+O}:{x:t+O,y:e.cross+O}},ee=e=>{let t=a?k-e.axis-e.aSize:e.axis;return i?{x:e.cross+O,y:t+O,width:e.cSize,height:e.aSize}:{x:t+O,y:e.cross+O,width:e.aSize,height:e.cSize}},te=e=>{for(let t of e)Object.assign(t,ee(w.get(t.id))),te(t.children)};te(D);let j=l.map(n=>{let r=t.nodes.get(n);return{id:n,label:r.label,shape:r.icon===void 0?r.shape:`rectangle`,icon:r.icon,...ee(w.get(n)),inlineStyle:(0,e.resolveNodeStyle)(n,t),className:t.classAssignments.get(n),interaction:t.interactions.get(n)}}),re=new Map(j.map(e=>[e.id,e])),ie=[];t.edges.forEach((e,n)=>{let r=T.get(n);if(!r)return;let i=w.get(e.source),a=w.get(e.target),o=i.axis>a.axis,[s,c]=o?[a,i]:[i,a],l=[{axis:s.axis+s.aSize,cross:s.cross+s.cSize/2},...o?[...r.mids].reverse():r.mids,{axis:c.axis,cross:c.cross+c.cSize/2}],u=[l[0]];for(let e of l.slice(1)){let t=u[u.length-1];if(t.cross!==e.cross){let n=(t.axis+e.axis)/2;u.push({axis:n,cross:t.cross},{axis:n,cross:e.cross})}u.push(e)}let d=lt(Gt(u.map(A)));o&&d.reverse();let f=re.get(e.source),p=re.get(e.target);f&&(d=qe(d,f,!0)),p&&(d=qe(d,p,!1)),ie.push({source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:d,labelPosition:r.label&&A(r.label),inlineStyle:jt(n,t),headColor:At(t),id:e.id,animate:e.animate,startMarker:e.startMarker,endMarker:e.endMarker})}),_t(t,re,ie,r.fontSizes.edgeLabel);let N=(i?C.crossSize:C.axisSize)+O*2,P=(i?C.axisSize:C.crossSize)+O*2;for(let e of ie){for(let t of e.points)N=Math.max(N,t.x+ae.width+O),P=Math.max(P,t.y+ae.width+O);e.labelPosition&&(N=Math.max(N,e.labelPosition.x+60+O),P=Math.max(P,e.labelPosition.y+20+O))}return{width:N,height:P,nodes:j,edges:ie,groups:D}}function Gt(e){return e.filter((t,n)=>{let r=e[n-1],i=e[n+1];return!r||!i||!(r.x===t.x&&t.x===i.x||r.y===t.y&&t.y===i.y)})}function Kt(e,t={}){let n={...I,...t,fontSizes:ne(t.fontSizes)};return bt(E(Ue(e,n),t.layoutCache),e,n.mergeEdges,n.fontSizes.edgeLabel)}function qt(e,t={}){let n=Jt(e,t),r=new Set,i=new Set,a=e=>{for(let t of e)t.stateComposite&&r.add(t.id),!t.nodeIds.length&&!t.children.length&&i.add(t.id),a(t.children)};a(e.subgraphs);let o=e=>{for(let t of e)!t.region&&!r.has(t.id)&&(t.bandless=!0),t.bandless&&i.has(t.id)&&!t.architecture&&(t.titleOnly=!0),o(t.children)};return o(n.groups),e.stateDiagram&&(n.stateDiagram=!0),n}function Jt(t,n){let r=(0,e.withoutOwnClusterEdges)(t);if(n.layout===`simple`&&!ye(r))return Wt(r,n);if(n.layout!==void 0&&n.layout!==`elk`&&n.layout!==`simple`)throw Error(`zombie-mermaid: unknown layout ${JSON.stringify(n.layout)}; use 'elk' or 'simple'.`);let i=Kt(r,n);if(R(r)){let e=t=>t.flatMap(t=>[t,...e(t.children)]);Pt(i.edges,i.nodes,e(i.groups),r.direction)}return i}function Yt(e,t={}){return Ue(e,{...I,...t,fontSizes:ne(t.fontSizes)})}var Xt=2;function Zt(e){return e.flatMap(e=>[e,...Zt(e.children)])}function Qt(t,n){let r=n.groupHeader+16;return Zt(t).filter(e=>e.label!==``).map(t=>{let i=(0,e.measureMultilineText)(t.label,n.groupHeader,400);return{x:t.x+t.width/2-i.width/2-Xt,y:t.y+(t.bandless?r:26)/2-i.height/2-Xt,width:i.width+4,height:i.height+4}})}function $t(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=[-r,r,-i,i],o=[e.x-n.x,n.x+n.width-e.x,e.y-n.y,n.y+n.height-e.y],s=0,c=1;for(let e=0;e<4;e++){let t=a[e],n=o[e];if(t===0){if(n<0)return!1}else{let e=n/t;if(t<0?s=Math.max(s,e):c=Math.min(c,e),s>c)return!1}}return!0}function en(e){return{x:e.x+Xt,y:e.y+Xt,width:e.width-4,height:e.height-4}}function tn(e,t){let n=e.points,r=t.map(en);for(let e=0;e+1<n.length;e++)if(r.some(t=>$t(n[e],n[e+1],t)))return!0;return!1}function nn(e){let t=2166136261;for(let n of e.map(e=>`${e.x},${e.y},${e.width},${e.height}`).join(`;`))t=Math.imul(t^n.charCodeAt(0),16777619);return(t>>>0).toString(36)}function rn(e,t,n){let r=`zm-title-gap-${nn(e)}`;return{id:r,markup:` <mask id="${r}" maskUnits="userSpaceOnUse" x="0" y="0" width="${t}" height="${n}">\n <rect x="0" y="0" width="${t}" height="${n}" fill="#fff" />\n${e.map(e=>` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000" />`).join(`
|
|
9
|
+
`)}\n </mask>`}}function an(t,n,r=`Inter`,i=!1,a=j,o=`linear`,s,c=!0,l=!0,u,d,f={}){let p=[],m=l&&t.nodes.some(t=>!!(0,e.safeHref)(t.interaction?.href));p.push(Cr((0,e.svgOpenTag)(t.width,t.height,n,i,u,d,m,f.styleAttribute,f.description),s)),p.push((0,e.buildStyleBlock)(r,!1,f.nonce,f.bodyFont)),c&&t.edges.some(e=>e.animate)&&p.push(on(f.nonce)),p.push(`<defs>`),p.push(sn(t.stateDiagram===!0));let h=new Set;for(let e of t.edges){let t=hn(e);t&&h.add(t)}for(let e of h)p.push(cn(e,t.stateDiagram===!0));let g=new Set;for(let e of t.edges)e.startMarker&&g.add(e.startMarker),e.endMarker&&g.add(e.endMarker);for(let e of g)p.push(fn(e));let _=Qt(t.groups,a),v=new Set(t.edges.filter(e=>tn(e,_))),y;if(v.size>0){let e=rn(_,t.width,t.height);y=e.id,p.push(e.markup)}p.push(`</defs>`);for(let e of t.groups)p.push(bn(e,r,a));for(let e of t.edges)p.push(xn(e,o,c,v.has(e)?y:void 0,t.stateDiagram===!0));for(let e of t.edges)e.label&&p.push(Sn(e,r,a));for(let e of t.nodes)p.push(En(e,r,a,l,t.stateDiagram===!0));return p.push(`</svg>`),p.join(`
|
|
10
|
+
`)}function on(t){return[(0,e.styleOpenTag)(t),` @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }`,` .edge-animated { animation: zm-edge-dash 1s linear infinite; }`,` @media (prefers-reduced-motion: reduce) {`,` .edge-animated { animation: none; }`,` }`,`</style>`].join(`
|
|
11
|
+
`)}function sn(e){return un(`var(--_arrow)`,``,e)}function cn(t,n){return un((0,e.escapeAttr)(t),e.f`-${gn(t)}`,n)}var ln=3.5;function un(t,n,r){if(r)return dn(t,n);let i=10.5,a=12.8,o=e.f`fill="${t}" stroke="${t}" stroke-width="0.75" stroke-linejoin="round"`,s=e.f`<polygon points="0 0, ${i} ${a/2}, 0 ${a}" ${o} />`,c=(t,n)=>e.f` <marker id="${t}" markerWidth="${i}" markerHeight="${a}" refX="${9.5}" refY="${a/2}" markerUnits="userSpaceOnUse" orient="${n}">`+e.f`\n ${s}`+`
|
|
12
12
|
</marker>`;return c(e.f`arrowhead${n}`,`auto`)+`
|
|
13
|
-
`+c(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function
|
|
13
|
+
`+c(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function dn(t,n){let r=(n,r)=>e.f` <marker id="${n}" markerWidth="20" markerHeight="14" refX="17" refY="7" markerUnits="userSpaceOnUse" orient="${r}">`+e.f`\n <path d="M 19,7 L11,14 L13,7 L11,0 Z" fill="${t}" />`+`
|
|
14
14
|
</marker>`;return r(e.f`arrowhead${n}`,`auto`)+`
|
|
15
|
-
`+r(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function
|
|
16
|
-
`)}if(t.architecture){let i=t.icon&&(
|
|
17
|
-
`)}a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`);let o=t.inlineStyle,s=(0,e.escapeAttr)(o?.stroke??`var(--_node-stroke)`),c=(0,e.escapeAttr)(o?.[`stroke-width`]??String(
|
|
18
|
-
`)}a.push(e.f` <rect x="${t.x}" y="${t.y+26}" width="${t.width}" height="${Math.max(0,t.height-26-
|
|
19
|
-
`)}function
|
|
20
|
-
`)}\n`+`</g>`}function
|
|
21
|
-
`)}var
|
|
22
|
-
`)}function
|
|
23
|
-
`)}function
|
|
24
|
-
`).length,o=t.icon===void 0?t.y+t.height/2:t.y+t.height+Cn+(a-1)/2*r.nodeLabel*e.LINE_HEIGHT_RATIO,s=(0,e.escapeAttr)(t.inlineStyle?.color??`var(--_text)`),c=e.f`text-anchor="middle" font-size="${r.nodeLabel}" font-weight="${P.nodeLabel}" fill="${s}"`,l=t.inlineStyle?.[`font-family`];return l&&(c+=e.f` style="font-family: ${(0,e.escapeAttr)(l)};"`),(0,e.renderMultilineText)(t.label,i,o,r.nodeLabel,c)}function _r(t){return(0,e.escapeAttr)(t).replace(/\r/g,` `).replace(/\n/g,` `).replace(/\t/g,`	`)}function vr(t,n){return n===void 0?t:t.replace(`<svg `,e.f`<svg data-src="${_r(n)}" `)}var yr=class{raw=new Map;resolved=new Map;inProgress=new Set;declare(e,t){this.raw.set(e,t),this.resolved.delete(e)}lookup(e){if(this.resolved.has(e))return this.resolved.get(e);let t=this.raw.get(e);if(t===void 0||this.inProgress.has(e))return;this.inProgress.add(e);let n=Er(t,this).trim();this.inProgress.delete(e);let r=!/\bvar\(|\bcolor-mix\(/.test(n);return this.resolved.set(e,r?n:void 0),r?n:void 0}};function br(e,t){let n=0;for(let r=t;r<e.length;r++){let t=e[r];if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r}return-1}function xr(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}var Sr=`(?<![\\w-])(var|color-mix)\\(`;function Cr(e,t){let[n,...r]=xr(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function wr(e){let t=e.trim().split(/\s+/),n,r;for(let e of t)if(/^[\d.]+%$/.test(e)){if(r!==void 0)return null;r=Number(e.slice(0,-1))}else{if(n!==void 0)return null;n=e}return n===void 0?null:{color:n,pct:r}}function Tr(t){let n=xr(t);if(n.length!==3)return null;let[r,i,a]=n;if(r===void 0||i===void 0||a===void 0||!/^\s*in\s+srgb\s*$/i.test(r))return null;let o=wr(i),s=wr(a);if(!o||!s)return null;let c=(0,e.parseCssColor)(o.color),l=(0,e.parseCssColor)(s.color);if(!c||!l)return null;let u=(0,e.mixSrgb)(c,l,o.pct,s.pct);return u?(0,e.formatCssColor)(u):null}function Er(e,t){let n=``,r=0,i=new RegExp(Sr,`g`),a;for(;(a=i.exec(e))!==null;){let o=a[1];if(o===void 0)continue;let s=a.index,c=s+o.length,l=br(e,c);if(l===-1)break;let u=Er(e.slice(c+1,l),t),d=o===`var`?Cr(u,t):Tr(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function Dr(e,t){let n=new yr;for(let[e,r]of Object.entries(t))n.declare(e,r);return Er(e,n)}var Or=/(--[\w-]+)\s*:\s*([^;{}]+)/g,kr=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,Ar=new Set([`data-src`]);function jr(e,t){Or.lastIndex=0;let n;for(;(n=Or.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function Mr(e,t){return e.replace(kr,(e,n,r,i,a)=>{if(Ar.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${Er(a.slice(1,-1),t)}${o}`})}function Nr(e,t){let n=new yr;n.declare(`--bg`,t.bg),n.declare(`--fg`,t.fg),t.line&&n.declare(`--line`,t.line),t.accent&&n.declare(`--accent`,t.accent),t.muted&&n.declare(`--muted`,t.muted),t.surface&&n.declare(`--surface`,t.surface),t.border&&n.declare(`--border`,t.border);for(let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)){let e=t[1];e!==void 0&&jr(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&jr(e.slice(1,-1),n)}let r=``,i=0;for(;i<e.length;){let t=e.indexOf(`<`,i);if(t===-1)break;if(r+=e.slice(i,t),e.startsWith(`<style`,t)){let a=e.indexOf(`>`,t),o=e.indexOf(`</style>`,t);if(a===-1||o===-1)break;r+=e.slice(t,a+1),r+=Er(e.slice(a+1,o),n),r+=`</style>`,i=o+8;continue}let a=-1,o=null;for(let n=t+1;n<e.length;n++){let t=e[n];if(o!==null)t===o&&(o=null);else if(t===`"`||t===`'`)o=t;else if(t===`>`){a=n;break}}if(a===-1)break;let s=e.slice(t,a+1);r+=s.startsWith(`<!`)||s.startsWith(`<?`)||s.startsWith(`</`)?s:Mr(s,n),i=a+1}return r+e.slice(i)}var Pr=[.3013,.3672,.3247,.5244,.5244,.6001,.7061,.1597,.3672,.3672,.3672,.5244,.3672,.3672,.3672,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.3672,.3672,.5244,.5244,.5244,.3672,.7705,.5898,.5659,.5981,.6133,.5356,.5249,.6763,.6543,.2783,.4766,.5757,.5063,.7095,.6382,.6738,.5576,.6758,.582,.481,.5806,.6484,.5874,.8521,.5566,.5703,.5503,.3672,.3555,.3672,.5244,.5244,.5244,.5254,.5571,.4951,.5571,.5454,.3696,.502,.5464,.2852,.3667,.5044,.2949,.8301,.5464,.5366,.5571,.5571,.3887,.4048,.3965,.5464,.4897,.7441,.501,.4932,.4746,.3672,.5244,.3672,.5244],Fr=[.3013,.3672,.3667,.5859,.5859,.6841,.7061,.2295,.3672,.3672,.4321,.5859,.3672,.3672,.3672,.3901,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.3672,.3672,.5859,.5859,.5859,.438,.7705,.6333,.5952,.6118,.6426,.5688,.5835,.6714,.6836,.2783,.5327,.6172,.5527,.7451,.6675,.7031,.5869,.709,.6108,.5112,.6118,.6777,.6216,.8838,.6006,.6133,.5601,.4019,.3555,.4019,.5859,.5859,.5859,.5327,.5815,.5117,.5806,.5747,.3696,.502,.5928,.2983,.3667,.5479,.2949,.8594,.5903,.5659,.5825,.584,.4272,.4307,.3965,.5908,.5273,.7837,.5522,.5337,.5283,.4336,.5859,.4336,.5859];function Ir(e){return e>=4352?1:.6}function Lr(e,t){let n=t?Fr:Pr,r=t?.5859:.5244,i=0;for(let t of e){let e=t.codePointAt(0);i+=e>=32&&e<=126?n[e-32]:e===171||e===187?r:Ir(e)}return i*16}var W={padding:40,boxPadX:8,headerBaseHeight:32,annotationHeight:16,memberRowHeight:20,sectionPadY:8,emptySectionHeight:8,mermaidPad:12,memberFontSize:11,memberFontWeight:400,nodeSpacing:40,layerSpacing:60,notePadX:10,notePadY:6,namespaceTitleHeight:28,namespacePad:16,namespaceTitleFontSize:12,lollipopLabelHeight:32,lollipopLabelPadX:8};function Rr(e){return`note ${e}`}function zr(e){return`${e} link`}function Br(e){return`namespace ${e}`}function Vr(e){let t=new Set(e.classes.map(e=>e.id)),n=new Set,r=[];for(let[i,a]of e.namespaces.entries()){let e=[];for(let r of a.classIds)!t.has(r)||n.has(r)||(n.add(r),e.push(r));e.length>0&&r.push({id:Br(i),name:a.name,classIds:e})}return r}function Hr(e){let t=new Map,n=new Set,r=[],i=new Map,a=e.relationships.map((a,o)=>{if(a.type!==`lollipop`||a.markerAt===`both`)return a;let s=a.markerAt===`from`,c=s?a.from:a.to,l=`lollipop ${r.length}`;return t.set(o,l),i.set(l,s?a.to:a.from),n.add(c),r.push({id:l,label:e.classes.find(e=>e.id===c)?.label??c,attributes:[],methods:[]}),s?{...a,from:l}:{...a,to:l}}),o=new Map(r.map(e=>[e.id,e.label]));if(r.length===0)return{diagram:e,labels:o,byRelationship:t};let s=new Set(a.flatMap(e=>[e.from,e.to]));for(let t of e.notes)t.forClass&&s.add(t.forClass);for(let t of e.namespaces)for(let e of t.classIds)s.add(e);let c=e=>n.has(e.id)&&!s.has(e.id)&&!e.annotation&&e.attributes.length===0&&e.methods.length===0,l=[...e.classes.filter(e=>!c(e)),...r],u=e.namespaces.map(e=>({...e,classIds:[...e.classIds,...r.filter(t=>e.classIds.includes(i.get(t.id)??``)).map(e=>e.id)]}));return{diagram:{...e,classes:l,relationships:a,namespaces:u},labels:o,byRelationship:t}}function Ur(t){return(0,e.findBackEdges)(t.relationships.map(e=>({source:e.from,target:e.to})),t.classes.map(e=>e.id))}function Wr(t,n,r){let i=new Map,a=new Map,o=N(n.fontSizes);for(let e of t.classes){if(r.has(e.id)){i.set(e.id,{width:k(e.label,o.nodeLabel,P.edgeLabel)+W.lollipopLabelPadX*2,height:W.lollipopLabelHeight,headerHeight:W.lollipopLabelHeight,attrHeight:0,methodHeight:0});continue}let t=e.annotation?W.headerBaseHeight+W.annotationHeight:W.headerBaseHeight,n=e.attributes.length>0?e.attributes.length*W.memberRowHeight+W.sectionPadY:W.emptySectionHeight,a=e.methods.length>0?e.methods.length*W.memberRowHeight+W.sectionPadY:W.emptySectionHeight,s=k(e.label,o.nodeLabel,P.nodeLabel),c=Xr(e.attributes),l=Xr(e.methods),u=Math.max(Yr(e),s+W.boxPadX*2,c+W.boxPadX*2,l+W.boxPadX*2),d=t+n+a;i.set(e.id,{width:u,height:d,headerHeight:t,attrHeight:n,methodHeight:a})}let s=Vr(t),c=new Map;for(let e of s)for(let t of e.classIds)c.set(t,e.id);let l=new Map,u=[];for(let e of s){let t=k(e.name,W.namespaceTitleFontSize,P.groupHeader)+W.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":le({top:W.namespaceTitleHeight+W.namespacePad/2,left:W.namespacePad,bottom:W.namespacePad,right:W.namespacePad}),"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":`(${Math.ceil(t)}, 0)`}};l.set(e.id,n),u.push(n)}for(let[e,t]of i){let n=de(e,t),r=l.get(c.get(e)??``);r?.children?r.children.push(n):u.push(n)}let d={fontSize:o.edgeLabel},f=Ur(t),p=[];for(let[e,n]of t.relationships.entries()){let t=f.has(e);p.push(B({id:`e${e}`,source:t?n.to:n.from,target:t?n.from:n.to,label:n.label,labelStyle:d}))}let m=new Set(i.keys());for(let[n,r]of t.notes.entries()){let t=Rr(n),i=(0,e.measureMultilineText)(r.text,o.edgeLabel,P.edgeLabel),s={width:i.width+W.notePadX*2,height:i.height+W.notePadY*2};a.set(t,s),u.push(de(t,s)),r.forClass!==void 0&&m.has(r.forClass)&&p.push(B({id:zr(t),source:t,target:r.forClass,labelStyle:d}))}return{elkGraph:{id:`root`,layoutOptions:{...ue({direction:ce(t.direction,se.class),nodeSpacing:W.nodeSpacing,layerSpacing:W.layerSpacing,padding:W.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.separateConnectedComponents":`false`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:u,edges:p},classSizes:i,noteSizes:a,namespaces:s}}function Gr(t,n,r,i,a,o){let s=new Map;for(let e of n.classes)s.set(e.id,e);let c=new Set(a.map(e=>e.id)),l=new Map,u=[];for(let e of t.children??[])if(c.has(e.id)){let t=e.x??0,n=e.y??0;l.set(e.id,{x:t,y:n});for(let r of e.children??[])u.push({...r,x:(r.x??0)+t,y:(r.y??0)+n})}else u.push(e);let d=e=>{let t=e.container;return t&&l.get(t)||{x:0,y:0}},f=[];for(let e of a){let n=(t.children??[]).find(t=>t.id===e.id);n&&f.push({name:e.name,classIds:e.classIds.filter(e=>!o.labels.has(e)),x:n.x??0,y:n.y??0,width:n.width??0,height:n.height??0})}let p=[];for(let t of u){let i=s.get(t.id);if(i){let a=r.get(i.id);if(!a)throw Error(`Missing computed size for class "${i.id}"`);p.push({id:i.id,label:i.label,annotation:i.annotation,attributes:i.attributes,methods:i.methods,x:t.x??0,y:t.y??0,width:t.width??a.width,height:t.height??a.height,headerHeight:a.headerHeight,attrHeight:a.attrHeight,methodHeight:a.methodHeight,interaction:n.interactions.get(i.id),inlineStyle:(0,e.resolveNodeStyle)(i.id,n),className:n.classAssignments.get(i.id)})}}let m=[],h=Ur(o.diagram),g=new Map;for(let e of u)g.set(e.id,e);let _=new Map;for(let[e,t]of o.labels){let n=g.get(e);_.set(e,{text:t,x:n?.x??0,y:n?.y??0,width:n?.width??0,height:n?.height??0})}let v=t.edges??[];for(let[e,t]of n.relationships.entries()){let n=v[e];if(!n)throw Error(`Missing ELK edge for relationship ${e}`);let r=d(n),i=ot(n,r.x,r.y),a=h.has(e)?i.reverse():i,s=st(n,r.x,r.y),c=_.get(o.byRelationship.get(e)??``);m.push({from:t.from,to:t.to,type:t.type,markerAt:t.markerAt,label:t.label,fromCardinality:t.fromCardinality,toCardinality:t.toCardinality,points:a,labelPosition:s,...c?{interfaceLabel:c}:{}})}let y=new Map;for(let e of v.slice(n.relationships.length))y.set(e.id,e);let b=[];for(let[e,t]of n.notes.entries()){let n=Rr(e),r=g.get(n),a=i.get(n);if(!r||!a)throw Error(`Missing layout for note ${e}`);let o=y.get(zr(n));b.push({id:n,text:t.text,...o&&t.forClass!==void 0?{forClass:t.forClass}:{},x:r.x??0,y:r.y??0,width:r.width??a.width,height:r.height??a.height,...o?{linkPoints:ot(o,d(o).x,d(o).y)}:{}})}return{width:t.width??600,height:t.height??400,classes:p,relationships:m,notes:b,namespaces:f}}function Kr(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[],namespaces:[]};let n=Hr(e),{elkGraph:r,classSizes:i,noteSizes:a,namespaces:o}=Wr(n.diagram,t,n.labels);return Gr(E(r,t.layoutCache),e,i,a,o,n)}function qr(e){return e.length*Math.ceil(A(`M`,W.memberFontSize))}function Jr(e){let t=e.isMethod?`${e.name}(${e.params||``})`:e.name;return`${e.visibility||``}${e.visibilitySpace?` `:``}${t}${e.isMethod&&e.type?` : ${e.type}`:``}`}function Yr(e){let t=Lr(e.label,!0),n=e.annotation?Lr(`\u00ab${e.annotation}\u00bb`,!1):0,r=Math.max(0,...[...e.attributes,...e.methods].map(e=>Lr(Jr(e),!1))),i=Math.max(t,n);return i/2+Math.max(i/2,r)+W.mermaidPad*2}function Xr(e){if(e.length===0)return 0;let n=0;for(let r of e){let e=qr((0,t.formatClassMember)(r));e>n&&(n=e)}return n}var Zr={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function Qr(t,n,r=`Inter`,i=!1,a=M,o,s,c,l=!0,u={}){let d=[],f=l&&t.classes.some(t=>!!(0,e.safeHref)(t.interaction?.href));d.push(vr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,f,u.styleAttribute,u.description),o)),d.push(ie(r,!0,u.nonce,u.bodyFont)),d.push(`<defs>`),d.push(ei(t.relationships.some(e=>e.type===`lollipop`))),d.push(`</defs>`);for(let e of t.namespaces)d.push($r(e));for(let e of t.relationships)d.push(si(e));for(let e of t.notes)d.push(oi(e));for(let e of t.classes)d.push(ti(e,a,l));for(let e of t.relationships){let t=ci(e,a);t&&d.push(t)}for(let e of t.notes)d.push(ai(e,a));for(let e of t.relationships)d.push(di(e,a));return d.push(`</svg>`),d.join(`
|
|
25
|
-
`)}function
|
|
26
|
-
`)}function
|
|
15
|
+
`+r(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function fn(t){return t===`circle`?e.f`<marker id="circle" viewBox="0 0 10 10" refX="12.25" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto-start-reverse"><circle cx="5" cy="5" r="5" fill="var(--_arrow)"/></marker>`:e.f`<marker id="cross" viewBox="0 0 15 15" refX="17.7" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto-start-reverse"><path d="M1 1L14 14M1 14L14 1" stroke="var(--_arrow)" stroke-width="2.5"/></marker>`}var pn=5.5;function mn(e){let t=e.points.map(e=>({...e})),n=(e,n)=>{let r=t[e],i=t[n],a=Math.hypot(i.x-r.x,i.y-r.y);a<=pn||(r.x+=(i.x-r.x)/a*pn,r.y+=(i.y-r.y)/a*pn)};return e.hasArrowEnd&&!e.endMarker&&n(t.length-1,t.length-2),e.hasArrowStart&&!e.startMarker&&n(0,1),t}function hn(e){return e.headColor??e.inlineStyle?.stroke}function gn(e){return e.replace(/[^a-zA-Z0-9]/g,e=>e.charCodeAt(0).toString(16))}function _n(t){let n=t?.[`stroke-dasharray`];return n&&/^[\d.\s,]+$/.test(n)?e.f` stroke-dasharray="${n.trim()}"`:``}var vn=30,yn=12;function bn(t,n,r){let i=r.groupHeader+16,a=[];if(t.region){a.push(e.f`<g class="subgraph subgraph-region" data-id="${(0,e.escapeAttr)(t.id)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" stroke-dasharray="6 4" />`);for(let e of t.children)a.push(bn(e,n,r));return a.push(`</g>`),a.join(`
|
|
16
|
+
`)}if(t.architecture){let i=t.icon&&(ce[t.icon]??`<text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;">?</text>`);a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" fill="none" stroke="var(--_node-stroke)" stroke-width="${jn}" stroke-dasharray="${Mn}" />`),i&&a.push(e.f` <g transform="translate(${t.x+1} ${t.y+1}) scale(${vn/80})"><rect width="${80}" height="${80}" fill="${se}" />${i}</g>`),a.push(` `+(0,e.renderMultilineText)(t.label,t.x+(i?34:6),t.y+1+vn/2,r.groupHeader,e.f`font-size="${r.groupHeader}" font-weight="400" fill="var(--_text)"`));for(let e of t.children)a.push(bn(e,n,r));return a.push(`</g>`),a.join(`
|
|
17
|
+
`)}a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`);let o=t.inlineStyle,s=(0,e.escapeAttr)(o?.stroke??`var(--_node-stroke)`),c=(0,e.escapeAttr)(o?.[`stroke-width`]??String(P.outerBox)),l=_n(o),u=(0,e.escapeAttr)(o?.fill??`var(--_group-fill)`),d=(0,e.escapeAttr)(o?.fill??`var(--_group-hdr)`),f=t.bandless===!0;if(t.titleOnly||a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="${f?0:On}" ry="${f?0:On}" fill="${f?u:d}" stroke="${s}" stroke-width="${c}"${l} />`),t.bandless){a.push(` `+(0,e.renderMultilineText)(t.label,t.x+t.width/2,t.titleOnly?t.y+t.height/2+yn:t.y+i/2,r.groupHeader,e.f`text-anchor="middle" font-size="${r.groupHeader}" font-weight="${400}" fill="${(0,e.escapeAttr)(o?.color??`var(--_text-sec)`)}"`));for(let e of t.children)a.push(bn(e,n,r));return a.push(`</g>`),a.join(`
|
|
18
|
+
`)}a.push(e.f` <rect x="${t.x}" y="${t.y+26}" width="${t.width}" height="${Math.max(0,t.height-26-An)}" `+e.f`rx="0" ry="0" fill="${u}" stroke="${s}" stroke-width="${c}"${l} />`);let p=t.x+t.width/2;a.push(` `+(0,e.renderMultilineText)(t.label,p,t.y+13,r.groupHeader,e.f`text-anchor="middle" font-size="${r.groupHeader}" font-weight="${400}" fill="${(0,e.escapeAttr)(o?.color??`var(--_text-sec)`)}"`));for(let e of t.children)a.push(bn(e,n,r));return a.push(`</g>`),a.join(`
|
|
19
|
+
`)}function xn(t,n,r=!0,i,a=!1){if(t.points.length<2)return``;let o=r&&(t.animate??!1),s=t.style===`invisible`,c=t.style===`dotted`?` stroke-dasharray="2 2"`:``,l=t.style===`thick`?ln:P.connector,f=s?`none`:(0,e.escapeAttr)(t.inlineStyle?.stroke??`var(--_line)`),m=(0,e.escapeAttr)(t.inlineStyle?.[`stroke-width`]??String(l)),h=hn(t),g=h?e.f`-${gn(h)}`:``,_=``;s||(t.hasArrowEnd&&(_+=e.f` marker-end="url(#${t.endMarker??e.f`arrowhead${g}`})"`),t.hasArrowStart&&(_+=e.f` marker-start="url(#${t.startMarker??e.f`arrowhead-start${g}`})"`));let v=[e.f`class="edge${o?` edge-animated`:``}"`,e.f`data-from="${(0,e.escapeAttr)(t.source)}"`,e.f`data-to="${(0,e.escapeAttr)(t.target)}"`,e.f`data-style="${t.style}"`,e.f`data-arrow-start="${t.hasArrowStart}"`,e.f`data-arrow-end="${t.hasArrowEnd}"`];t.label&&v.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.id&&v.push(e.f`data-id="${(0,e.escapeAttr)(t.id)}"`);let y=o&&!c?` stroke-dasharray="8 6"`:``,b=a?mn(t):t.points,x=n===`linear`?d(b,u):p(b,n);return e.f`<path ${v.join(` `)} d="${x}" `+e.f`fill="none" stroke="${f}" `+e.f`stroke-width="${m}"${c}${y}${_}`+(i?e.f` mask="url(#${i})"`:``)+` />`}function Sn(t,n,r){if(!t.label)return``;let i=t.label,a=t.labelPosition??wn(t.points),o=(0,e.measureMultilineText)(i,r.edgeLabel,M.edgeLabel),s=(0,e.renderMultilineTextWithBackground)(i,a.x,a.y,o.width,o.height,r.edgeLabel,0,e.f`text-anchor="middle" font-size="${r.edgeLabel}" font-weight="${M.edgeLabel}" fill="var(--_text-sec)"`,`fill="var(--bg)"`);return e.f`<g class="edge-label" data-from="${(0,e.escapeAttr)(t.source)}" data-to="${(0,e.escapeAttr)(t.target)}" data-label="${(0,e.escapeAttr)(i)}">\n`+e.f` ${s.replace(/\n/g,`
|
|
20
|
+
`)}\n`+`</g>`}function Cn(t,n){let r=t[n];if(!r)throw Error(e.f`edgeMidpoint: missing point at index ${n}`);return r}function wn(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++)t+=Tn(Cn(e,n-1),Cn(e,n));let n=t/2;for(let t=1;t<e.length;t++){let r=Cn(e,t-1),i=Cn(e,t),a=Tn(r,i);if(n<=a){let e=n/a;return{x:r.x+e*(i.x-r.x),y:r.y+e*(i.y-r.y)}}n-=a}return e[e.length-1]}function Tn(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function En(t,n,r,i=!0,a=!1){let o=Pn(t,a),s=xr(t,n,r),c=[],l=(0,e.sanitizeClassName)(t.className),u=l?e.f`node ${l}`:`node`,d=t.interaction,f=[e.f`class="${u}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`,e.f`data-shape="${t.shape}"`];c.push(e.f`<g ${f.join(` `)}>`);let p=i?(0,e.safeHref)(d?.href):void 0,m=p?` `:` `;if(p){let t=d?.target?e.f` target="${(0,e.escapeAttr)(d.target)}"`:``;c.push(e.f` <a href="${(0,e.escapeAttr)(p)}"${t}>`)}return i&&d?.tooltip&&c.push(e.f`${m}<title>${(0,e.escapeXml)(d.tooltip)}</title>`),c.push(e.f`${m}${o.replace(/\n/g,e.f`\n${m}`)}`),s&&c.push(e.f`${m}${s.replace(/\n/g,e.f`\n${m}`)}`),p&&c.push(` </a>`),c.push(`</g>`),c.join(`
|
|
21
|
+
`)}var Dn=13,On=5,kn=5,An=4,jn=2,Mn=8;function Nn(t,n,r){let i=e.f`transform="translate(${t} ${n})"`;if(r===``)return e.f`<path ${i} d="M0,80 V5 Q0,0 5,0 H75 Q80,0 80,5 V80 Z" fill="none" stroke="var(--_node-stroke)" stroke-width="${jn}" stroke-dasharray="${Mn}" />`;let a=ce[r]??`<text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;">?</text>`;return e.f`<g ${i}><rect width="${80}" height="${80}" fill="${se}" />${a}</g>`}function Pn(t,n){let r=Fn(t,n),i=t.icon===void 0&&t.shape!==`small-circle`?_n(t.inlineStyle):``;return i&&r?e.f`<g${i}>${r}</g>`:r}function Fn(t,n){let{x:r,y:i,width:a,height:o,shape:s}=t;if(t.icon!==void 0)return Nn(r,i,t.icon);let c=s===`small-circle`?void 0:t.inlineStyle,l=(0,e.escapeAttr)(c?.fill??`var(--_node-fill)`),u=(0,e.escapeAttr)(c?.stroke??`var(--_node-stroke)`),d=(0,e.escapeAttr)(c?.[`stroke-width`]??String(P.innerBox)),f=e=>e&&/^\d+(\.\d+)?(px)?$/.test(e)?parseFloat(e):0,p=f(c?.rx),m={rx:p,ry:c?.ry===void 0?p:f(c.ry)};switch(s){case`diamond`:return Bn(r,i,a,o,l,u,d);case`rounded`:return Ln(r,i,a,o,l,u,d,n?kn:6);case`stadium`:return Rn(r,i,a,o,l,u,d);case`circle`:return zn(r,i,a,o,l,u,d);case`subroutine`:return Vn(r,i,a,o,l,u,d);case`doublecircle`:return Hn(r,i,a,o,l,u,d);case`hexagon`:return Un(r,i,a,o,l,u,d);case`cylinder`:return Wn(r,i,a,o,l,u,d);case`asymmetric`:return Gn(r,i,a,o,l,u,d);case`trapezoid`:return Kn(r,i,a,o,l,u,d);case`trapezoid-alt`:return qn(r,i,a,o,l,u,d);case`parallelogram`:return Jn(r,i,a,o,l,u,d);case`parallelogram-alt`:return Yn(r,i,a,o,l,u,d);case`state-start`:return yr(r,i,a,o);case`state-end`:return br(r,i,a,o);case`document`:return Zn(r,i,a,o,l,u,d);case`stacked-document`:return Qn(r,i,a,o,l,u,d,!0);case`stacked-process`:return Qn(r,i,a,o,l,u,d,!1);case`card`:return $n(r,i,a,o,l,u,d);case`lined-process`:return er(r,i,a,o,l,u,d);case`divided-process`:return tr(r,i,a,o,l,u,d);case`window-pane`:return nr(r,i,a,o,l,u,d);case`triangle`:return rr(r,i,a,o,l,u,d,!1);case`flipped-triangle`:return rr(r,i,a,o,l,u,d,!0);case`junction`:return``;case`filled-circle`:return ir(r,i,a,o,u);case`crossed-circle`:return ar(r,i,a,o,l,u,d);case`fork-join`:return or(r,i,a,o,u);case`note`:return dr(r,i,a,o,(0,e.escapeAttr)(c?.fill??`var(--bg)`),u,d);case`notched-pentagon`:return fr(r,i,a,o,l,u,d);case`sloped-rectangle`:return pr(r,i,a,o,l,u,d);case`flag`:return mr(r,i,a,o,l,u,d);case`bow-tie-rectangle`:return hr(r,i,a,o,l,u,d);case`half-rounded-rectangle`:return gr(r,i,a,o,l,u,d);case`brace`:return _r(r,i,a,o,l,u,d,`left`);case`brace-right`:return _r(r,i,a,o,l,u,d,`right`);case`braces`:return _r(r,i,a,o,l,u,d,`both`);case`bolt`:return vr(r,i,a,o,l,u,d);case`cloud`:return sr(r,i,a,o,l,u,d);case`horizontal-cylinder`:return cr(r,i,a,o,l,u,d);case`tagged-rectangle`:return lr(r,i,a,o,l,u,d);case`fork-bar`:return In(r,i,a,o,l,u,d);case`small-circle`:return ur(r,i,a,o,l,u,d);case`text`:case`anchor`:return``;default:return In(r,i,a,o,l,u,d,m)}}function In(t,n,r,i,a,o,s,c={rx:0,ry:0}){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c.rx}" ry="${c.ry}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Ln(t,n,r,i,a,o,s,c){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c}" ry="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Rn(t,n,r,i,a,o,s){let c=i/2;return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c}" ry="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function zn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2;return e.f`<circle cx="${c}" cy="${l}" r="${u}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Bn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=r/2,d=i/2,f=[e.f`${c},${l-d}`,e.f`${c+u},${l}`,e.f`${c},${l+d}`,e.f`${c-u},${l}`].join(` `);return e.f`<polygon points="${f}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Vn(t,n,r,i,a,o,s){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="0" ry="0" fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+8}" y1="${n}" x2="${t+8}" y2="${n+i}" `+e.f`stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+r-8}" y1="${n}" x2="${t+r-8}" y2="${n+i}" `+e.f`stroke="${o}" stroke-width="${s}" />`}function Hn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2,d=u-5;return e.f`<circle cx="${c}" cy="${l}" r="${u}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<circle cx="${c}" cy="${l}" r="${d}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Un(t,n,r,i,a,o,s){let c=i/3.5,l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i/2}`,e.f`${t+r-c},${n+i}`,e.f`${t+c},${n+i}`,e.f`${t},${n+i/2}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Wn(t,n,r,i,a,o,s){let c=t+r/2,l=n+7,u=i-14;return e.f`<rect x="${t}" y="${l}" width="${r}" height="${u}" `+e.f`fill="${a}" stroke="none" />`+e.f`\n<line x1="${t}" y1="${l}" x2="${t}" y2="${l+u}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+r}" y1="${l}" x2="${t+r}" y2="${l+u}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<ellipse cx="${c}" cy="${n+i-7}" rx="${r/2}" ry="${7}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<ellipse cx="${c}" cy="${l}" rx="${r/2}" ry="${7}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Gn(t,n,r,i,a,o,s){let c=[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t+12},${n+i/2}`].join(` `);return e.f`<polygon points="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Kn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function qn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r-c},${n+i}`,e.f`${t+c},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Jn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t+c},${n}`,e.f`${t+r},${n}`,e.f`${t+r-c},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Yn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i}`,e.f`${t+c},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Xn(t,n,r){return e.f`fill="${t}" stroke="${n}" stroke-width="${r}"`}function Zn(t,n,r,i,a,o,s){let c=Math.min(10,i*.16),l=n+i-c,u=e.f`M ${t} ${n} L ${t+r} ${n} L ${t+r} ${l} `+e.f`C ${t+r*.75} ${l+c*1.8} ${t+r*.25} ${l-c*.8} ${t} ${l} Z`;return e.f`<path d="${u}" ${Xn(a,o,s)} />`}function Qn(t,n,r,i,a,o,s,c){let l=r-10,u=i-10,d=[];for(let r=2;r>=1;r--)d.push(e.f`<rect x="${t+5*r}" y="${n+5*(2-r)}" width="${l}" height="${u}" `+e.f`${Xn(a,o,s)} />`);return d.push(c?Zn(t,n+10,l,u,a,o,s):e.f`<rect x="${t}" y="${n+10}" width="${l}" height="${u}" ${Xn(a,o,s)} />`),d.join(`
|
|
22
|
+
`)}function $n(t,n,r,i,a,o,s){let c=Math.min(14,r*.12,i*.3),l=[e.f`${t+c},${n}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t},${n+c}`].join(` `);return e.f`<polygon points="${l}" ${Xn(a,o,s)} />`}function er(t,n,r,i,a,o,s){let c=Math.min(12,r*.12);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${Xn(a,o,s)} />\n`+e.f`<line x1="${t+c}" y1="${n}" x2="${t+c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />`}function tr(t,n,r,i,a,o,s){let c=n+Math.min(16,i*.3);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${Xn(a,o,s)} />\n`+e.f`<line x1="${t}" y1="${c}" x2="${t+r}" y2="${c}" stroke="${o}" stroke-width="${s}" />`}function nr(t,n,r,i,a,o,s){let c=t+Math.min(16,r*.16),l=n+Math.min(14,i*.28);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${Xn(a,o,s)} />\n`+e.f`<line x1="${c}" y1="${n}" x2="${c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<line x1="${t}" y1="${l}" x2="${t+r}" y2="${l}" stroke="${o}" stroke-width="${s}" />`}function rr(t,n,r,i,a,o,s,c){let l=c?[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r/2},${n+i}`]:[e.f`${t+r/2},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`];return e.f`<polygon points="${l.join(` `)}" ${Xn(a,o,s)} />`}function ir(t,n,r,i,a){let o=Math.min(r,i)/2;return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="${o}" fill="${a}" stroke="${a}" />`}function ar(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2-2,d=u/Math.SQRT2;return e.f`<circle cx="${c}" cy="${l}" r="${u}" ${Xn(a,o,s)} />\n`+e.f`<line x1="${c-d}" y1="${l-d}" x2="${c+d}" y2="${l+d}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<line x1="${c+d}" y1="${l-d}" x2="${c-d}" y2="${l+d}" stroke="${o}" stroke-width="${s}" />`}function or(t,n,r,i,a){let o=Math.min(8,i);return e.f`<rect x="${t}" y="${n+(i-o)/2}" width="${r}" height="${o}" fill="${a}" stroke="${a}" />`}function sr(t,n,r,i,a,o,s){let c=r/1.25,l=i-.48*c,[u,d,f,p]=[.15*c,.25*c,.35*c,.2*c],m=e.f`M0 0 a${u},${u} 0 0,1 ${.25*c},${-.1*c} `+e.f`a${f},${f} 1 0,1 ${.4*c},${-.1*c} `+e.f`a${d},${d} 1 0,1 ${.35*c},${.2*c} `+e.f`a${u},${u} 1 0,1 ${.15*c},${.35*l} `+e.f`a${p},${p} 1 0,1 ${-.15*c},${.65*l} `+e.f`a${d},${u} 1 0,1 ${-.25*c},${.15*c} `+e.f`a${f},${f} 1 0,1 ${-.5*c},0 `+e.f`a${u},${u} 1 0,1 ${-.25*c},${-.15*c} `+e.f`a${u},${u} 1 0,1 ${-.1*c},${-.35*l} `+e.f`a${p},${p} 1 0,1 ${.1*c},${-.65*l} H0 V0 Z`;return e.f`<path transform="translate(${t+.1*c} ${n+.225*c})" d="${m}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function cr(t,n,r,i,a,o,s){let c=i/2,l=c/(2.5+i/50),u=r-2*l;return e.f`<path d="M${t+l},${n+i} a${l},${c} 0,0,1 0,${-i} l${u},0 a${l},${c} 0,0,1 0,${i} `+e.f`l${-u},0 Z" fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<path d="M${t+l+u},${n} a${l},${c} 0,0,0 0,${i}" fill="none" stroke="${o}" stroke-width="${s}" />`}function lr(t,n,r,i,a,o,s){let c=.2*i;return In(t,n,r,i,a,o,s)+e.f`\n<polygon points="${t+r-c},${n+i} ${t+r},${n+i} ${t+r},${n+i-c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function ur(t,n,r,i,a,o,s){return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="7" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function dr(t,n,r,i,a,o,s){let c=[e.f`${t},${n}`,e.f`${t+r-6},${n}`,e.f`${t+r},${n+6}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<polygon points="${t+r-6},${n} ${t+r},${n+6} ${t+r-6},${n+6}" fill="var(--_inner-stroke)" stroke="${o}" stroke-width="${s}" />`}function fr(t,n,r,i,a,o,s){let c=Math.min(14,r*.12,i*.3),l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+c}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t},${n+c}`].join(` `);return e.f`<polygon points="${l}" ${Xn(a,o,s)} />`}function pr(t,n,r,i,a,o,s){let c=Math.min(12,i*.3),l=[e.f`${t},${n+c}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" ${Xn(a,o,s)} />`}function mr(t,n,r,i,a,o,s){let c=Math.min(8,i*.14),l=e.f`M ${t} ${n+c} `+e.f`C ${t+r*.25} ${n-c} ${t+r*.75} ${n+c*2} ${t+r} ${n+c} `+e.f`L ${t+r} ${n+i-c} `+e.f`C ${t+r*.75} ${n+i+c} ${t+r*.25} ${n+i-c*2} ${t} ${n+i-c} Z`;return e.f`<path d="${l}" ${Xn(a,o,s)} />`}function hr(t,n,r,i,a,o,s){let c=Math.min(14,r*.12),l=e.f`M ${t+c} ${n} L ${t+r} ${n} `+e.f`Q ${t+r-c*1.4} ${n+i/2} ${t+r} ${n+i} `+e.f`L ${t+c} ${n+i} `+e.f`Q ${t+c*1.4} ${n+i/2} ${t+c} ${n} Z`;return e.f`<path d="${l}" ${Xn(a,o,s)} />`}function gr(t,n,r,i,a,o,s){let c=i/2,l=Math.max(0,r-c),u=e.f`M ${t} ${n} L ${t+l} ${n} `+e.f`A ${c} ${c} 0 0 1 ${t+l} ${n+i} `+e.f`L ${t} ${n+i} Z`;return e.f`<path d="${u}" ${Xn(a,o,s)} />`}function _r(t,n,r,i,a,o,s,c){let l=Math.min(10,r*.12),u=[e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" fill="none" stroke="none" />`],d=e.f`M ${t+l} ${n} Q ${t} ${n} ${t} ${n+i*.25} `+e.f`Q ${t} ${n+i/2} ${t-l*.4} ${n+i/2} `+e.f`Q ${t} ${n+i/2} ${t} ${n+i*.75} `+e.f`Q ${t} ${n+i} ${t+l} ${n+i}`,f=e.f`M ${t+r-l} ${n} Q ${t+r} ${n} ${t+r} ${n+i*.25} `+e.f`Q ${t+r} ${n+i/2} ${t+r+l*.4} ${n+i/2} `+e.f`Q ${t+r} ${n+i/2} ${t+r} ${n+i*.75} `+e.f`Q ${t+r} ${n+i} ${t+r-l} ${n+i}`;return(c===`left`||c===`both`)&&u.push(e.f`<path d="${d}" fill="none" stroke="${o}" stroke-width="${s}" />`),(c===`right`||c===`both`)&&u.push(e.f`<path d="${f}" fill="none" stroke="${o}" stroke-width="${s}" />`),u.join(`
|
|
23
|
+
`)}function vr(t,n,r,i,a,o,s){let c=[e.f`${t+r*.42},${n}`,e.f`${t+r},${n}`,e.f`${t+r*.62},${n+i*.42}`,e.f`${t+r},${n+i*.42}`,e.f`${t+r*.3},${n+i}`,e.f`${t+r*.5},${n+i*.55}`,e.f`${t},${n+i*.55}`].join(` `);return e.f`<polygon points="${c}" ${Xn(a,o,s)} />`}function yr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2;return e.f`<circle cx="${a}" cy="${o}" r="${s}" fill="var(--_text)" stroke="none" />`}function br(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2,c=s*5/14;return e.f`<circle cx="${a}" cy="${o}" r="${s}" `+e.f`fill="none" stroke="var(--_text)" stroke-width="2" />`+e.f`\n<circle cx="${a}" cy="${o}" r="${c}" fill="var(--_text)" stroke="none" />`}function xr(t,n,r){if((t.shape===`state-start`||t.shape===`state-end`)&&!t.label)return``;let i=t.x+t.width/2+(t.shape===`asymmetric`?6:0),a=t.label.split(`
|
|
24
|
+
`).length,o=t.icon===void 0?t.y+t.height/2:t.y+t.height+Dn+(a-1)/2*r.nodeLabel*e.LINE_HEIGHT_RATIO,s=(0,e.escapeAttr)(t.inlineStyle?.color??`var(--_text)`),c=e.f`text-anchor="middle" font-size="${r.nodeLabel}" font-weight="${M.nodeLabel}" fill="${s}"`,l=t.inlineStyle?.[`font-family`];return l&&(c+=e.f` style="font-family: ${(0,e.escapeAttr)(l)};"`),(0,e.renderMultilineText)(t.label,i,o,r.nodeLabel,c)}function Sr(t){return(0,e.escapeAttr)(t).replace(/\r/g,` `).replace(/\n/g,` `).replace(/\t/g,`	`)}function Cr(t,n){return n===void 0?t:t.replace(`<svg `,e.f`<svg data-src="${Sr(n)}" `)}var wr=class{raw=new Map;resolved=new Map;inProgress=new Set;declare(e,t){this.raw.set(e,t),this.resolved.delete(e)}lookup(e){if(this.resolved.has(e))return this.resolved.get(e);let t=this.raw.get(e);if(t===void 0||this.inProgress.has(e))return;this.inProgress.add(e);let n=jr(t,this).trim();this.inProgress.delete(e);let r=!/\bvar\(|\bcolor-mix\(/.test(n);return this.resolved.set(e,r?n:void 0),r?n:void 0}};function Tr(e,t){let n=0;for(let r=t;r<e.length;r++){let t=e[r];if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r}return-1}function Er(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}var Dr=`(?<![\\w-])(var|color-mix)\\(`;function Or(e,t){let[n,...r]=Er(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function kr(e){let t=e.trim().split(/\s+/),n,r;for(let e of t)if(/^[\d.]+%$/.test(e)){if(r!==void 0)return null;r=Number(e.slice(0,-1))}else{if(n!==void 0)return null;n=e}return n===void 0?null:{color:n,pct:r}}function Ar(t){let n=Er(t);if(n.length!==3)return null;let[r,i,a]=n;if(r===void 0||i===void 0||a===void 0||!/^\s*in\s+srgb\s*$/i.test(r))return null;let o=kr(i),s=kr(a);if(!o||!s)return null;let c=(0,e.parseCssColor)(o.color),l=(0,e.parseCssColor)(s.color);if(!c||!l)return null;let u=(0,e.mixSrgb)(c,l,o.pct,s.pct);return u?(0,e.formatCssColor)(u):null}function jr(e,t){let n=``,r=0,i=new RegExp(Dr,`g`),a;for(;(a=i.exec(e))!==null;){let o=a[1];if(o===void 0)continue;let s=a.index,c=s+o.length,l=Tr(e,c);if(l===-1)break;let u=jr(e.slice(c+1,l),t),d=o===`var`?Or(u,t):Ar(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function Mr(e,t){let n=new wr;for(let[e,r]of Object.entries(t))n.declare(e,r);return jr(e,n)}var Nr=/(--[\w-]+)\s*:\s*([^;{}]+)/g,Pr=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,Fr=new Set([`data-src`]);function Ir(e,t){Nr.lastIndex=0;let n;for(;(n=Nr.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function Lr(e,t){return e.replace(Pr,(e,n,r,i,a)=>{if(Fr.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${jr(a.slice(1,-1),t)}${o}`})}function Rr(e,t){let n=new wr;n.declare(`--bg`,t.bg),n.declare(`--fg`,t.fg),t.line&&n.declare(`--line`,t.line),t.accent&&n.declare(`--accent`,t.accent),t.muted&&n.declare(`--muted`,t.muted),t.surface&&n.declare(`--surface`,t.surface),t.border&&n.declare(`--border`,t.border);for(let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)){let e=t[1];e!==void 0&&Ir(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&Ir(e.slice(1,-1),n)}let r=``,i=0;for(;i<e.length;){let t=e.indexOf(`<`,i);if(t===-1)break;if(r+=e.slice(i,t),e.startsWith(`<style`,t)){let a=e.indexOf(`>`,t),o=e.indexOf(`</style>`,t);if(a===-1||o===-1)break;r+=e.slice(t,a+1),r+=jr(e.slice(a+1,o),n),r+=`</style>`,i=o+8;continue}let a=-1,o=null;for(let n=t+1;n<e.length;n++){let t=e[n];if(o!==null)t===o&&(o=null);else if(t===`"`||t===`'`)o=t;else if(t===`>`){a=n;break}}if(a===-1)break;let s=e.slice(t,a+1);r+=s.startsWith(`<!`)||s.startsWith(`<?`)||s.startsWith(`</`)?s:Lr(s,n),i=a+1}return r+e.slice(i)}var zr=[.3013,.3672,.3247,.5244,.5244,.6001,.7061,.1597,.3672,.3672,.3672,.5244,.3672,.3672,.3672,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.5244,.3672,.3672,.5244,.5244,.5244,.3672,.7705,.5898,.5659,.5981,.6133,.5356,.5249,.6763,.6543,.2783,.4766,.5757,.5063,.7095,.6382,.6738,.5576,.6758,.582,.481,.5806,.6484,.5874,.8521,.5566,.5703,.5503,.3672,.3555,.3672,.5244,.5244,.5244,.5254,.5571,.4951,.5571,.5454,.3696,.502,.5464,.2852,.3667,.5044,.2949,.8301,.5464,.5366,.5571,.5571,.3887,.4048,.3965,.5464,.4897,.7441,.501,.4932,.4746,.3672,.5244,.3672,.5244],Br=[.3013,.3672,.3667,.5859,.5859,.6841,.7061,.2295,.3672,.3672,.4321,.5859,.3672,.3672,.3672,.3901,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.5859,.3672,.3672,.5859,.5859,.5859,.438,.7705,.6333,.5952,.6118,.6426,.5688,.5835,.6714,.6836,.2783,.5327,.6172,.5527,.7451,.6675,.7031,.5869,.709,.6108,.5112,.6118,.6777,.6216,.8838,.6006,.6133,.5601,.4019,.3555,.4019,.5859,.5859,.5859,.5327,.5815,.5117,.5806,.5747,.3696,.502,.5928,.2983,.3667,.5479,.2949,.8594,.5903,.5659,.5825,.584,.4272,.4307,.3965,.5908,.5273,.7837,.5522,.5337,.5283,.4336,.5859,.4336,.5859];function Vr(e){return e>=4352?1:.6}function Hr(e,t){let n=t?Br:zr,r=t?.5859:.5244,i=0;for(let t of e){let e=t.codePointAt(0);i+=e>=32&&e<=126?n[e-32]:e===171||e===187?r:Vr(e)}return i*16}var z={padding:40,boxPadX:8,headerBaseHeight:32,annotationHeight:16,memberRowHeight:20,sectionPadY:8,emptySectionHeight:16,emptyBareSectionHeight:12,mermaidPad:12,memberFontSize:11,memberFontWeight:400,nodeSpacing:40,layerSpacing:60,notePadX:10,notePadY:6,namespaceTitleHeight:28,namespacePad:16,namespaceTitleFontSize:12,lollipopLabelHeight:32,lollipopLabelPadX:8};function Ur(e){return`note ${e}`}function Wr(e){return`${e} link`}function Gr(e){return`namespace ${e}`}function Kr(e){let t=new Set(e.classes.map(e=>e.id)),n=new Set,r=[];for(let[i,a]of e.namespaces.entries()){let e=[];for(let r of a.classIds)!t.has(r)||n.has(r)||(n.add(r),e.push(r));e.length>0&&r.push({id:Gr(i),name:a.name,classIds:e})}return r}function qr(e){let t=new Map,n=new Set,r=[],i=new Map,a=e.relationships.map((a,o)=>{if(a.type!==`lollipop`||a.markerAt===`both`)return a;let s=a.markerAt===`from`,c=s?a.from:a.to,l=`lollipop ${r.length}`;return t.set(o,l),i.set(l,s?a.to:a.from),n.add(c),r.push({id:l,label:e.classes.find(e=>e.id===c)?.label??c,attributes:[],methods:[]}),s?{...a,from:l}:{...a,to:l}}),o=new Map(r.map(e=>[e.id,e.label]));if(r.length===0)return{diagram:e,labels:o,byRelationship:t};let s=new Set(a.flatMap(e=>[e.from,e.to]));for(let t of e.notes)t.forClass&&s.add(t.forClass);for(let t of e.namespaces)for(let e of t.classIds)s.add(e);let c=e=>n.has(e.id)&&!s.has(e.id)&&!e.annotation&&e.attributes.length===0&&e.methods.length===0,l=[...e.classes.filter(e=>!c(e)),...r],u=e.namespaces.map(e=>({...e,classIds:[...e.classIds,...r.filter(t=>e.classIds.includes(i.get(t.id)??``)).map(e=>e.id)]}));return{diagram:{...e,classes:l,relationships:a,namespaces:u},labels:o,byRelationship:t}}function Jr(t){return(0,e.findBackEdges)(t.relationships.map(e=>({source:e.from,target:e.to})),t.classes.map(e=>e.id))}function Yr(t,n,r){let i=new Map,a=new Map,o=ne(n.fontSizes),s=t.layout?.padding??z.mermaidPad,c=s-z.mermaidPad;for(let e of t.classes){if(r.has(e.id)){i.set(e.id,{width:k(e.label,o.nodeLabel,M.edgeLabel)+z.lollipopLabelPadX*2,height:z.lollipopLabelHeight,headerHeight:z.lollipopLabelHeight,attrHeight:0,methodHeight:0});continue}let n=Math.max(0,(e.annotation?z.headerBaseHeight+z.annotationHeight:z.headerBaseHeight)+c*2),a=e.attributes.length+e.methods.length===0,l=a&&t.layout?.hideEmptyMembersBox===!0?0:Math.max(0,(a?z.emptyBareSectionHeight:z.emptySectionHeight)+c*2),u=e.attributes.length>0?e.attributes.length*z.memberRowHeight+Math.max(0,z.sectionPadY+c*2):l,d=e.methods.length>0?e.methods.length*z.memberRowHeight+Math.max(0,z.sectionPadY+c*2):l,f=k(e.label,o.nodeLabel,M.nodeLabel),p=ti(e.attributes),m=ti(e.methods),h=Math.max(ei(e,s),f+z.boxPadX*2,p+z.boxPadX*2,m+z.boxPadX*2),g=n+u+d;i.set(e.id,{width:h,height:g,headerHeight:n,attrHeight:u,methodHeight:d})}let l=Kr(t),u=new Map;for(let e of l)for(let t of e.classIds)u.set(t,e.id);let d=new Map,f=[];for(let e of l){let t=k(e.name,z.namespaceTitleFontSize,M.groupHeader)+z.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":de({top:z.namespaceTitleHeight+z.namespacePad/2,left:z.namespacePad,bottom:z.namespacePad,right:z.namespacePad}),"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":`(${Math.ceil(t)}, 0)`}};d.set(e.id,n),f.push(n)}for(let[e,t]of i){let n=pe(e,t),r=d.get(u.get(e)??``);r?.children?r.children.push(n):f.push(n)}let p={fontSize:o.edgeLabel},m=Jr(t),h=[];for(let[e,n]of t.relationships.entries()){let t=m.has(e);h.push(ge({id:`e${e}`,source:t?n.to:n.from,target:t?n.from:n.to,label:n.label,labelStyle:p}))}let g=new Set(i.keys());for(let[n,r]of t.notes.entries()){let t=Ur(n),i=(0,e.measureMultilineText)(r.text,o.edgeLabel,M.edgeLabel),s={width:i.width+z.notePadX*2,height:i.height+z.notePadY*2};a.set(t,s),f.push(pe(t,s)),r.forClass!==void 0&&g.has(r.forClass)&&h.push(ge({id:Wr(t),source:t,target:r.forClass,labelStyle:p}))}return{elkGraph:{id:`root`,layoutOptions:{...fe({direction:ue(t.direction,le.class),nodeSpacing:z.nodeSpacing,layerSpacing:z.layerSpacing,padding:z.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.separateConnectedComponents":`false`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:f,edges:h},classSizes:i,noteSizes:a,namespaces:l}}function Xr(t,n,r,i,a,o){let s=new Map;for(let e of n.classes)s.set(e.id,e);let c=new Set(a.map(e=>e.id)),l=new Map,u=[];for(let e of t.children??[])if(c.has(e.id)){let t=e.x??0,n=e.y??0;l.set(e.id,{x:t,y:n});for(let r of e.children??[])u.push({...r,x:(r.x??0)+t,y:(r.y??0)+n})}else u.push(e);let d=e=>{let t=e.container;return t&&l.get(t)||{x:0,y:0}},f=[];for(let e of a){let n=(t.children??[]).find(t=>t.id===e.id);n&&f.push({name:e.name,classIds:e.classIds.filter(e=>!o.labels.has(e)),x:n.x??0,y:n.y??0,width:n.width??0,height:n.height??0})}let p=[];for(let t of u){let i=s.get(t.id);if(i){let a=r.get(i.id);if(!a)throw Error(`Missing computed size for class "${i.id}"`);p.push({id:i.id,label:i.label,annotation:i.annotation,attributes:i.attributes,methods:i.methods,x:t.x??0,y:t.y??0,width:t.width??a.width,height:t.height??a.height,headerHeight:a.headerHeight,attrHeight:a.attrHeight,methodHeight:a.methodHeight,interaction:n.interactions.get(i.id),inlineStyle:(0,e.resolveNodeStyle)(i.id,n),className:n.classAssignments.get(i.id)})}}let m=[],h=Jr(o.diagram),g=new Map;for(let e of u)g.set(e.id,e);let _=new Map;for(let[e,t]of o.labels){let n=g.get(e);_.set(e,{text:t,x:n?.x??0,y:n?.y??0,width:n?.width??0,height:n?.height??0})}let v=t.edges??[];for(let[e,t]of n.relationships.entries()){let n=v[e];if(!n)throw Error(`Missing ELK edge for relationship ${e}`);let r=d(n),i=ut(n,r.x,r.y),a=h.has(e)?i.reverse():i,s=dt(n,r.x,r.y),c=_.get(o.byRelationship.get(e)??``);m.push({from:t.from,to:t.to,type:t.type,markerAt:t.markerAt,...t.dashed?{dashed:!0}:{},label:t.label,fromCardinality:t.fromCardinality,toCardinality:t.toCardinality,points:a,labelPosition:s,...c?{interfaceLabel:c}:{}})}let y=new Map;for(let e of v.slice(n.relationships.length))y.set(e.id,e);let b=[];for(let[e,t]of n.notes.entries()){let n=Ur(e),r=g.get(n),a=i.get(n);if(!r||!a)throw Error(`Missing layout for note ${e}`);let o=y.get(Wr(n));b.push({id:n,text:t.text,...o&&t.forClass!==void 0?{forClass:t.forClass}:{},x:r.x??0,y:r.y??0,width:r.width??a.width,height:r.height??a.height,...o?{linkPoints:ut(o,d(o).x,d(o).y)}:{}})}return{width:t.width??600,height:t.height??400,classes:p,relationships:m,notes:b,namespaces:f}}function Zr(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[],namespaces:[]};let n=qr(e),{elkGraph:r,classSizes:i,noteSizes:a,namespaces:o}=Yr(n.diagram,t,n.labels);return Xr(E(r,t.layoutCache),e,i,a,o,n)}function Qr(e){return e.length*Math.ceil(A(`M`,z.memberFontSize))}function $r(e){let t=e.isMethod?`${e.name}(${e.params||``})`:e.name;return`${e.visibility||``}${e.visibilitySpace?` `:``}${t}${e.isMethod&&e.type?` : ${e.type}`:``}`}function ei(e,t=z.mermaidPad){let n=Hr(e.label,!0),r=e.annotation?Hr(`\u00ab${e.annotation}\u00bb`,!1):0,i=Math.max(0,...[...e.attributes,...e.methods].map(e=>Hr($r(e),!1))),a=Math.max(n,r);return a/2+Math.max(a/2,i)+t*2}function ti(e){if(e.length===0)return 0;let n=0;for(let r of e){let e=Qr((0,t.formatClassMember)(r));e>n&&(n=e)}return n}var ni={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function ri(t,n,r=`Inter`,i=!1,a=j,o,s,c,l=!0,u={}){let d=[],f=l&&t.classes.some(t=>!!(0,e.safeHref)(t.interaction?.href));d.push(Cr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,f,u.styleAttribute,u.description),o)),d.push(oe(r,!0,u.nonce,u.bodyFont)),d.push(`<defs>`),d.push(ai(t.relationships.some(e=>e.type===`lollipop`))),d.push(`</defs>`);for(let e of t.namespaces)d.push(ii(e));for(let e of t.relationships)d.push(fi(e));for(let e of t.notes)d.push(di(e));for(let e of t.classes)d.push(oi(e,a,l));for(let e of t.relationships){let t=pi(e,a);t&&d.push(t)}for(let e of t.notes)d.push(ui(e,a));for(let e of t.relationships)d.push(gi(e,a));return d.push(`</svg>`),d.join(`
|
|
25
|
+
`)}function ii(t){let{x:n,y:r,width:i,height:a}=t,o=z.namespaceTitleHeight,s=P.outerBox;return[e.f`<g class="class-namespace" data-id="${(0,e.escapeAttr)(t.name)}" data-label="${(0,e.escapeAttr)(t.name)}">`,e.f` <rect x="${n}" y="${r}" width="${i}" height="${a}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,e.f` <rect x="${n}" y="${r}" width="${i}" height="${o}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,e.f` <text x="${n+z.namespacePad}" y="${r+o/2}" dy="${F}" font-size="${z.namespaceTitleFontSize}" font-weight="${M.groupHeader}" fill="var(--_text-sec)">${wi(t.name)}</text>`,`</g>`].join(`
|
|
26
|
+
`)}function ai(e){return` <marker id="cls-inherit" markerWidth="12" markerHeight="10" refX="12" refY="5" orient="auto-start-reverse">
|
|
27
27
|
<polygon points="0 0, 12 5, 0 10" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
28
28
|
</marker>
|
|
29
29
|
<marker id="cls-composition" markerWidth="18" markerHeight="14" refX="16.5" refY="7" orient="auto-start-reverse">
|
|
@@ -37,79 +37,143 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
|
|
|
37
37
|
</marker>`+(e?`
|
|
38
38
|
<marker id="cls-lollipop" markerWidth="12" markerHeight="12" refX="11" refY="6" orient="auto-start-reverse">
|
|
39
39
|
<circle cx="6" cy="6" r="5" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
40
|
-
</marker>`:``)}function
|
|
41
|
-
`)}var
|
|
42
|
-
</g>`}function
|
|
43
|
-
</g>`}function
|
|
44
|
-
`)}function
|
|
45
|
-
`)}function
|
|
46
|
-
`).map(e=>e.trim()).join(` `)]}function
|
|
47
|
-
`)}function
|
|
40
|
+
</marker>`:``)}function oi(t,n,r=!0){let{x:i,y:a,width:o,height:s,headerHeight:c,attrHeight:l,inlineStyle:u}=t,d=[],f=t.interaction,p=(0,e.escapeAttr)(u?.fill??`var(--_node-fill)`),m=(0,e.escapeAttr)(u?.stroke??`var(--_node-stroke)`),h=(0,e.escapeAttr)(u?.[`stroke-width`]??String(P.outerBox)),g=u?.fill?p:`var(--_group-hdr)`,_=u?.color?(0,e.escapeAttr)(u.color):void 0,v=t.annotation?e.f` data-annotation="${(0,e.escapeAttr)(t.annotation)}"`:``,y=(0,e.sanitizeClassName)(t.className),b=[e.f`class="${y?e.f`class-node ${y}`:`class-node`}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`];d.push(e.f`<g ${b.join(` `)}${v}>`);let x=r?(0,e.safeHref)(f?.href):void 0;if(x){let t=f?.target?e.f` target="${(0,e.escapeAttr)(f.target)}"`:``;d.push(e.f` <a href="${(0,e.escapeAttr)(x)}"${t}>`)}r&&f?.tooltip&&d.push(e.f` <title>${wi(f.tooltip)}</title>`),d.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" `+e.f`rx="0" ry="0" fill="${p}" stroke="${m}" stroke-width="${h}" />`),d.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${c}" `+e.f`rx="0" ry="0" fill="${g}" stroke="${m}" stroke-width="${h}" />`);let S=a+c/2;if(t.annotation){let n=a+12;d.push(e.f` <text x="${i+o/2}" y="${n}" text-anchor="middle" dy="${F}" `+e.f`font-size="${ni.annotationSize}" font-weight="${ni.annotationWeight}" `+e.f`font-style="italic" fill="${_??`var(--_text-muted)`}">«${wi(t.annotation)}»</text>`),S=a+c/2+6}d.push(` `+(0,e.renderMultilineText)(t.label,i+o/2,S,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="700" fill="${_??`var(--_text)`}"`));let C=a+c;l>0&&d.push(e.f` <line x1="${i}" y1="${C}" x2="${i+o}" y2="${C}" `+e.f`stroke="${m}" stroke-width="${P.innerBox}" />`);let w=(l-t.attributes.length*20)/2,T=(s-c-l-t.methods.length*20)/2;for(let e=0;e<t.attributes.length;e++){let n=t.attributes[e],r=C+w+e*20+10;d.push(` `+ci(n,i+z.boxPadX,r,_))}let E=C+l;s-c-l>0&&d.push(e.f` <line x1="${i}" y1="${E}" x2="${i+o}" y2="${E}" `+e.f`stroke="${m}" stroke-width="${P.innerBox}" />`);for(let e=0;e<t.methods.length;e++){let n=t.methods[e],r=E+T+e*20+10;d.push(` `+ci(n,i+z.boxPadX,r,_))}return x&&d.push(` </a>`),d.push(`</g>`),d.join(`
|
|
41
|
+
`)}var si=700;function ci(t,n,r,i){let a=t.isAbstract?` font-style="italic"`:``,o=t.isStatic?` text-decoration="underline"`:``,s=i??`var(--_text-faint)`,c=i??`var(--_text-sec)`,l=i??`var(--_text-muted)`,u=[];t.visibility&&u.push(e.f`<tspan fill="${c}" font-weight="${si}">${wi(t.visibility)}</tspan>${t.visibilitySpace?e.f`<tspan fill="${s}"> </tspan>`:``}`);let d=t.isMethod?e.f`${t.name}(${t.params||``})`:t.name;return u.push(e.f`<tspan fill="${c}">${wi(d)}</tspan>`),t.type&&(u.push(e.f`<tspan fill="${s}"> : </tspan>`),u.push(e.f`<tspan fill="${l}">${wi(t.type)}</tspan>`)),e.f`<text x="${n}" y="${r}" class="mono" dy="${F}" `+e.f`font-size="${ni.memberSize}" font-weight="${ni.memberWeight}"${a}${o}>`+e.f`${u.join(``)}</text>`}var li=6;function ui(t,n){let{x:r,y:i,width:a,height:o}=t,s=t.forClass===void 0?``:e.f` data-for="${(0,e.escapeAttr)(t.forClass)}"`,c=[e.f`${r},${i}`,e.f`${r+a-li},${i}`,e.f`${r+a},${i+li}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `),l=e.f`${r+a-li},${i} ${r+a},${i+li} `+e.f`${r+a-li},${i+li}`;return e.f`<g class="class-note"${s}>`+e.f`\n <polygon points="${c}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />`+e.f`\n <polygon points="${l}" `+e.f`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />`+e.f`\n ${(0,e.renderMultilineText)(t.text,r+a/2,i+o/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`)}`+`
|
|
42
|
+
</g>`}function di(t){if(!t.linkPoints||t.linkPoints.length<2)return``;let n=t.linkPoints.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.forClass===void 0?``:e.f` data-for="${(0,e.escapeAttr)(t.forClass)}"`;return e.f`<polyline class="class-note-link"${r} points="${n}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${P.connector}" stroke-dasharray="2 3" />`}function fi(t){if(t.points.length<2)return``;let n=t.dashed||t.type===`dependency`||t.type===`realization`||t.type===`dashed-link`?` stroke-dasharray="6 4"`:``,r=mi(t.type,t.markerAt),i=[`class="class-relationship"`,e.f`data-from="${(0,e.escapeAttr)(t.from)}"`,e.f`data-to="${(0,e.escapeAttr)(t.to)}"`,e.f`data-type="${t.type}"`,e.f`data-marker-at="${t.markerAt}"`];return t.label&&i.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.fromCardinality&&i.push(e.f`data-from-cardinality="${(0,e.escapeAttr)(t.fromCardinality)}"`),t.toCardinality&&i.push(e.f`data-to-cardinality="${(0,e.escapeAttr)(t.toCardinality)}"`),e.f`<path ${i.join(` `)} d="${d(t.points,u)}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${P.connector}"${n}${r} />`}function pi(t,n){let r=t.interfaceLabel;if(!r)return``;let i=t.markerAt===`from`?t.from:t.to;return e.f`<g class="class-interface" data-id="${(0,e.escapeAttr)(i)}" data-label="${(0,e.escapeAttr)(r.text)}">\n `+(0,e.renderMultilineText)(r.text,r.x+r.width/2,r.y+r.height/2,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${M.edgeLabel}" fill="var(--_text)"`)+`
|
|
43
|
+
</g>`}function mi(t,n){let r=hi(t);return r?(n===`to`?``:e.f` marker-start="url(#${r})"`)+(n===`from`?``:e.f` marker-end="url(#${r})"`):``}function hi(e){switch(e){case`inheritance`:case`realization`:return`cls-inherit`;case`composition`:return`cls-composition`;case`aggregation`:return`cls-aggregation`;case`association`:case`dependency`:return`cls-arrow`;case`lollipop`:return`cls-lollipop`;default:return null}}function gi(t,n){if(!t.label&&!t.fromCardinality&&!t.toCardinality||t.points.length<2)return``;let r=[];if(t.label){let i=_i(t.points,t.labelPosition??vi(t.points)),a=(0,e.measureMultilineText)(t.label,n.edgeLabel,M.edgeLabel);r.push((0,e.renderMultilineTextWithBackground)(t.label,i.x,i.y,a.width,a.height,n.edgeLabel,4,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`,`class="class-relationship-label-bg" fill="var(--bg)"`))}if(t.fromCardinality&&t.points.length>=2){let i=t.points[0],a=t.points[1],o=yi(i,a,`start`,bi(t,`from`));r.push((0,e.renderMultilineText)(t.fromCardinality,i.x+o.x,i.y+o.y,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${o.anchor}" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`))}if(t.toCardinality&&t.points.length>=2){let i=t.points[t.points.length-1],a=t.points[t.points.length-2],o=yi(i,a,`end`,bi(t,`to`));r.push((0,e.renderMultilineText)(t.toCardinality,i.x+o.x,i.y+o.y,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${o.anchor}" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`))}return r.join(`
|
|
44
|
+
`)}function _i(e,t){let n=e[0],r=1/0;for(let i=1;i<e.length;i++){let a=e[i-1],o=e[i],s=o.x-a.x,c=o.y-a.y,l=s*s+c*c,u=Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*c)/l)),d={x:a.x+u*s,y:a.y+u*c},f=(d.x-t.x)**2+(d.y-t.y)**2;f<r&&(r=f,n=d)}return n}function vi(e){return e.length===0?{x:0,y:0}:e[Math.floor(e.length/2)]}function yi(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=Math.max(Math.hypot(i,a),1e-6),s=xi+(r?Si:0),c=Ci+(r?Si:0),l=i/o,u=a/o,d=n===`start`?1:-1,[f,p]=[l*d,u*d],m=(n===`start`?-p:p)*s,h=(n===`start`?f:-f)*s,g=h+u*s;if(Math.abs(m)>Math.abs(h)){let e=Math.sign(m);return{x:e*c+l*s,y:g,anchor:e>0?`start`:`end`}}return{x:m+l*s,y:g,anchor:`middle`}}function bi(e,t){return hi(e.type)!==null&&(e.markerAt===t||e.markerAt===`both`)}var xi=12,Si=6,Ci=5,wi=e.escapeXml,B={padding:40,boxPadX:14,cellPadX:10,headerHeight:34,bareHeight:68,rowHeight:22,minWidth:140,attrFontSize:11,attrFontWeight:400,nodeSpacing:70,layerSpacing:90,loopOut:20,loopHalf:10,loopLabelGap:4,loopNestGap:16,loopMargin:12};function Ti(t,n,r){let i=ne(r.fontSizes).edgeLabel,a=[];for(let[r,o]of t.relationships.entries()){if(o.entity1!==n||o.entity2!==n)continue;let t=a[a.length-1],s=o.label?(0,e.measureMultilineText)(o.label,i,M.edgeLabel).width+8:0;a.push({index:r,nest:a.length,out:t?t.out+B.loopLabelGap+t.labelW+B.loopNestGap:B.loopOut,labelW:s})}return a}function Ei(e){return e.replace(/<br\s{0,8}\/?>/gi,`
|
|
45
|
+
`)}function Di(e){let t=e.attributes.map(Oi);return[0,1,2,3].filter(e=>e<2||t.some(t=>t[e].length>0)).map(e=>({cell:e,width:Math.max(...t.map(t=>Ai(t[e])))+B.cellPadX*2}))}function Oi(e){return[e.type,e.name,e.keys.join(`,`),Ei(e.comment??``).split(`
|
|
46
|
+
`).map(e=>e.trim()).join(` `)]}function ki(e){return Math.max(-10,((e.layout?.entityPadding??15)-15)*1.25)}function Ai(e){return[...e].reduce((e,t)=>e+(t.codePointAt(0)>=11904?2:1),0)*Math.ceil(A(`M`,B.attrFontSize))}function ji(e,t){let n=new Map,r=ne(t.fontSizes),i=(e.layout?.diagramPadding??20)-20,a=ki(e),o=e.layout?.minEntityWidth??0;for(let t of e.entities){let e=k(t.label,r.nodeLabel,M.nodeLabel),s=t.attributes.length===0,c=Di(t),l=c.reduce((e,t)=>e+t.width,0)+c.length*i*1.25,u=e+B.boxPadX*2+i*2,d=Math.max(o,s?u:Math.max(B.minWidth,u,l)),f=s?Math.max(20,B.bareHeight+i*3):B.headerHeight+a+t.attributes.length*(B.rowHeight+a);n.set(t.id,{width:d,height:f})}let s=[];for(let[e,t]of n)s.push(pe(e,t));let c={fontSize:r.edgeLabel},l=[];for(let[t,n]of e.relationships.entries())n.entity1!==n.entity2&&l.push(ge({id:`e${t}`,source:n.entity1,target:n.entity2,label:n.label,labelStyle:c}));let u=0;for(let n of e.entities){let r=Ti(e,n.id,t),i=r[r.length-1];i&&(u=Math.max(u,i.out+i.labelW))}return{elkGraph:{id:`root`,layoutOptions:{...fe({direction:ue(e.direction,le.er),nodeSpacing:Math.max(B.nodeSpacing,u+20),layerSpacing:Math.max(B.layerSpacing,u+20),padding:B.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.separateConnectedComponents":`false`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:s,edges:l},entitySizes:n}}function Mi(t,n,r,i){let a=ki(n),o=new Map;for(let e of n.entities)o.set(e.id,e);let s=[];for(let i of t.children??[]){let t=o.get(i.id);if(t){let o=r.get(t.id);if(!o)throw Error(`Missing computed size for entity "${t.id}"`);s.push({id:t.id,label:t.label,attributes:t.attributes,x:i.x??0,y:i.y??0,width:i.width??o.width,height:i.height??o.height,headerHeight:t.attributes.length===0?o.height:B.headerHeight+a,rowHeight:B.rowHeight+a,inlineStyle:(0,e.resolveNodeStyle)(t.id,n),className:n.classAssignments.get(t.id)})}}let c=new Map((t.edges??[]).map(e=>[e.id,e])),l=[],u=1/0;for(let[e,t]of n.relationships.entries()){let r={entity1:t.entity1,entity2:t.entity2,cardinality1:t.cardinality1,cardinality2:t.cardinality2,label:t.label,identifying:t.identifying};if(t.entity1!==t.entity2){l.push({...r,points:ut(c.get(`e${e}`))});continue}let a=s.find(e=>e.id===t.entity1),o=Ti(n,t.entity1,i).find(t=>t.index===e),d=a.y+a.height/2,f=Math.max(B.loopHalf,a.height/8)+10*o.nest,p=a.x-o.out;l.push({...r,points:[{x:a.x,y:d-f},{x:p,y:d-f},{x:p,y:d+f},{x:a.x,y:d+f}],labelPoint:{x:p-B.loopLabelGap-o.labelW/2,y:d}}),u=Math.min(u,p-B.loopLabelGap-o.labelW)}let d=Math.max(0,B.loopMargin-u);if(d>0){for(let e of s)e.x+=d;for(let e of l){for(let t of e.points)t.x+=d;e.labelPoint&&(e.labelPoint.x+=d)}}return{width:(t.width??600)+d,height:t.height??400,entities:s,relationships:l}}function Ni(e,t={}){if(e.entities.length===0)return{width:0,height:0,entities:[],relationships:[]};let{elkGraph:n,entitySizes:r}=ji(e,t);return Mi(E(n,t.layoutCache),e,r,t)}var Pi=70,Fi={attrSize:11,attrWeight:400};function Ii(t,n,r=`Inter`,i=!1,a=j,o,s,c,l={}){let u=[];u.push(Cr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push(oe(r,!0,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(`</defs>`);for(let e of t.relationships)u.push(zi(e));for(let e of t.entities)u.push(Li(e,a));for(let e of t.relationships)u.push(Vi(e));for(let e of t.relationships)u.push(Bi(e,a));return u.push(`</svg>`),u.join(`
|
|
47
|
+
`)}function Li(t,n){let{id:r,x:i,y:a,width:o,height:s,headerHeight:c,rowHeight:l,label:u,attributes:d,inlineStyle:f}=t,p=[],m=(0,e.escapeAttr)(f?.fill??`var(--_node-fill)`),h=(0,e.escapeAttr)(f?.stroke??`var(--_node-stroke)`),g=(0,e.escapeAttr)(f?.[`stroke-width`]??String(P.outerBox)),_=(0,e.escapeAttr)(f?.[`stroke-width`]??String(P.innerBox)),v=f?.fill?m:`var(--_group-hdr)`,y=f?.color?(0,e.escapeAttr)(f.color):void 0,b=(0,e.sanitizeClassName)(t.className);p.push(e.f`<g class="${b?e.f`entity ${b}`:`entity`}" data-id="${(0,e.escapeAttr)(r)}" data-label="${(0,e.escapeAttr)(u)}">`),p.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" `+e.f`rx="0" ry="0" fill="${m}" stroke="${h}" stroke-width="${g}" />`),p.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${c}" `+e.f`rx="0" ry="0" fill="${v}" stroke="${h}" stroke-width="${g}" />`),p.push(` `+(0,e.renderMultilineText)(u,i+o/2,a+c/2,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="700" fill="${y??`var(--_text)`}"`));let x=a+c;if(d.length>0){let n=a+s,r=Di(t),c=(o-r.reduce((e,t)=>e+t.width,0))/r.length,u=[i];for(let e of r)u.push(u[u.length-1]+e.width+c);for(let t=1;!f?.fill&&t<d.length;t+=2)p.push(e.f` <rect x="${i}" y="${x+t*l}" width="${o}" height="${l}" `+e.f`fill="var(--_key-badge)" />`);let m=(t,n,r,i)=>e.f` <line x1="${t}" y1="${n}" x2="${r}" y2="${i}" stroke="${h}" stroke-width="${_}" />`;p.push(m(i,x,i+o,x));for(let e=1;e<d.length;e++){let t=x+e*l;p.push(m(i,t,i+o,t))}for(let e=1;e<r.length;e++)p.push(m(u[e],x,u[e],n));for(let e=0;e<d.length;e++){let t=x+e*l+l/2,n=Oi(d[e]);p.push(` `+Ri(d[e],r.map((e,t)=>({x:u[t]+B.cellPadX,text:n[e.cell]})),t,y).replace(/\n/g,`
|
|
48
48
|
`))}}return p.push(`</g>`),p.join(`
|
|
49
|
-
`)}function
|
|
50
|
-
`)}function
|
|
51
|
-
`)}function
|
|
52
|
-
`)}function
|
|
53
|
-
`)
|
|
54
|
-
`).
|
|
55
|
-
`)}function
|
|
49
|
+
`)}function Ri(t,n,r,i){let a=[];if(t.comment&&t.comment.length>0){let n=Ei(t.comment);a.push(e.f`<g><title>${Wi(n)}</title>`)}return n.forEach((t,n)=>{if(!t.text)return;let o=n===1?`--_text-sec`:`--_text-muted`;a.push(e.f`<text x="${t.x}" y="${r}" class="mono" dy="${F}" `+e.f`font-size="${Fi.attrSize}" font-weight="${Fi.attrWeight}">`+e.f`<tspan fill="${i??`var(${o})`}">${Wi(t.text)}</tspan></text>`)}),t.comment&&t.comment.length>0&&a.push(`</g>`),a.join(`
|
|
50
|
+
`)}function zi(t){if(t.points.length<2)return``;let n=t.points.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.identifying?``:` stroke-dasharray="6 4"`,i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``,a=[`class="er-relationship"`,e.f`data-entity1="${(0,e.escapeAttr)(t.entity1)}"`,e.f`data-entity2="${(0,e.escapeAttr)(t.entity2)}"`,e.f`data-cardinality1="${t.cardinality1}"`,e.f`data-cardinality2="${t.cardinality2}"`,e.f`data-identifying="${t.identifying}"`];return e.f`<polyline ${a.join(` `)}${i} points="${n}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${P.connector}"${r} />`}function Bi(t,n){if(!t.label||t.points.length<2)return``;let r=t.labelPoint??Ui(t.points),i=(0,e.measureMultilineText)(t.label,n.edgeLabel,M.edgeLabel),a=i.width+8,o=i.height+6;return e.f`<rect x="${r.x-a/2}" y="${r.y-o/2}" width="${a}" height="${o}" rx="2" ry="2" `+`fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />`+e.f`\n${(0,e.renderMultilineText)(t.label,r.x,r.y,n.edgeLabel,e.f`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${M.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${Pi}%, var(--bg))"`)}`}function Vi(e){if(e.points.length<2)return``;let t=[],n=e.points[0],r=e.points[1];t.push(Hi(n,r,e.cardinality1));let i=e.points[e.points.length-1],a=e.points[e.points.length-2];return t.push(Hi(i,a,e.cardinality2)),t.join(`
|
|
51
|
+
`)}function Hi(t,n,r){let i=[],a=P.connector+.25,o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);if(c===0)return``;let l=o/c,u=s/c,d=-u,f=l,p=t.x-l*4,m=t.y-u*4,h=t.x-l*16,g=t.y-u*16,_=r===`one`||r===`zero-one`,v=r===`many`||r===`zero-many`,y=r===`zero-one`||r===`zero-many`;if(_){i.push(e.f`<line x1="${p+d*6}" y1="${m+f*6}" `+e.f`x2="${p-d*6}" y2="${m-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`);let t=p-l*4,n=m-u*4;i.push(e.f`<line x1="${t+d*6}" y1="${n+f*6}" `+e.f`x2="${t-d*6}" y2="${n-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(v){let t=p,n=m;i.push(e.f`<line x1="${t+d*7}" y1="${n+f*7}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`),i.push(e.f`<line x1="${t}" y1="${n}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`),i.push(e.f`<line x1="${t-d*7}" y1="${n-f*7}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(r===`many`){let n=t.x-l*20,r=t.y-u*20;i.push(e.f`<line x1="${n+d*6}" y1="${r+f*6}" `+e.f`x2="${n-d*6}" y2="${r-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(y){let n=v?20:12,r=t.x-l*n,o=t.y-u*n;i.push(e.f`<circle cx="${r}" cy="${o}" r="4" `+e.f`fill="var(--bg)" stroke="var(--_line)" stroke-width="${a}" />`)}return i.join(`
|
|
52
|
+
`)}function Ui(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}if(t===0)return e[0];let n=t/2,r=0;for(let t=1;t<e.length;t++){let i=e[t].x-e[t-1].x,a=e[t].y-e[t-1].y,o=Math.sqrt(i*i+a*a);if(r+o>=n){let s=o>0?(n-r)/o:0;return{x:e[t-1].x+i*s,y:e[t-1].y+a*s}}r+=o}return e[e.length-1]}var Wi=e.escapeXml,Gi={padding:30,paddingY:30,bottomAdj:0,actorMinWidth:80,actorGap:140,actorHeight:40,actorPadX:16,headerGap:20,messageRowHeight:40,selfMessageHeight:30,activationWidth:10,blockPadX:10,blockPadTop:40,blockPadBottom:8,blockHeaderExtra:28,blockHeaderLabelGap:26,blockNestedHeaderGap:17,dividerExtra:24,dividerLabelGap:26,noteWidth:60,notePadX:12,notePadY:6,noteGap:10,noteOffsetAfterMessage:8,noteStackGap:4,boxPad:10,titleBand:36},Ki=60,qi=45,Ji=20;function Yi(e){return e+8}var Xi=14;function Zi(e,t){return e.type===`actor`?Math.max(44,t):t}function Qi(e){return e.type===`actor`?15:14}var $i=new Set([`boundary`,`control`,`entity`,`database`]);function ea(e){return e.type===`actor`||$i.has(e.participantType)}var ta=4;function na(t,n,r,i){return t+(0,e.measureMultilineText)(n,r,i).height/2}function ra(e,t){let n=(e,t)=>(e??t)-t,r=n(t?.noteMargin,10),i=n(t?.diagramMarginX,50);return{...Gi,padding:Gi.padding+i,paddingY:Gi.paddingY+n(t?.diagramMarginY,10),bottomAdj:Math.max(0,n(t?.bottomMarginAdj,1)),actorMinWidth:Gi.actorMinWidth+n(t?.width,150),actorGap:Gi.actorGap+n(t?.actorMargin,50),activationWidth:Gi.activationWidth+n(t?.activationWidth,10),selfMessageHeight:Gi.selfMessageHeight-(t?.rightAngles?10:0),notePadX:Gi.notePadX+r,notePadY:Gi.notePadY+r,actorHeight:e?.actorHeight??Gi.actorHeight+n(t?.height,65),headerGap:e?.headerGap??Gi.headerGap,messageRowHeight:e?.messageRowHeight??Gi.messageRowHeight+n(t?.boxMargin,10),noteOffsetAfterMessage:e?.noteOffsetAfterMessage??Gi.noteOffsetAfterMessage,noteStackGap:e?.noteStackGap??Gi.noteStackGap}}var ia=16;function aa(t,n,r=M.edgeLabel){return(0,e.measureMultilineText)(t,n,r).width}var oa=.5;function sa(e){return e.blockPadX+1}var ca=.2,la=.24;function ua(e,t,n){let r=18*la,i=18*ca;return[[e,t],[e+n,t],[e+n,t+18-i],[e+n-r,t+18],[e,t+18]]}function da(e,t){return e.type===`rect`&&e.color!==void 0?0:aa(e.type,t,M.groupHeader)+16}function fa(e,t,n){let r=`[${e}]`,i=[];for(let e of r.split(`
|
|
53
|
+
`)){let r=``;for(let a of e.split(` `))r&&aa(r,n)+aa(`${a} `,n)>=t?(i.push(r),r=a):r=r?`${r} ${a}`:a;i.push(r)}return i.join(`
|
|
54
|
+
`).slice(1,-1)}function pa(t,n){return t?(t.split(`
|
|
55
|
+
`).length-1)*n*e.LINE_HEIGHT_RATIO:0}function ma(e){return e.map((t,n)=>e.slice(0,n).flatMap((e,n)=>e.startIndex>=t.startIndex&&e.endIndex<=t.endIndex?[n]:[]))}function ha(e,t,n,r,i){let a=new Map(e.actors.map((e,t)=>[e.id,t])),o=(e,t,r)=>{if(e<0||t>=n.length)return;let i=0;for(let r=e+1;r<=t;r++)i+=n[r];if(i>=r)return;let a=(r-i)/(t-e);for(let r=e+1;r<=t;r++)n[r]+=a};for(let t of e.messages){if(!t.label)continue;let e=a.get(t.from),n=a.get(t.to),r=aa(t.label,i);e===n?(o(e-1,e,r/2+ia),o(e,e+1,r/2+ia)):o(Math.min(e,n),Math.max(e,n),r+32)}for(let n of e.notes){let e=a.get(n.actorIds[0]??``),s=Math.max(r.noteWidth,aa(n.text,i)+r.notePadX*2),c=t[e]/2+r.noteGap+s+ia;if(n.position===`right`)o(e,e+1,c);else if(n.position===`left`)o(e-1,e,c);else if(n.actorIds.length===1)o(e,e+1,s/2+ia),o(e-1,e,s/2+ia);else{let t=a.get(n.actorIds[n.actorIds.length-1]);o(Math.min(e,t),Math.max(e,t),s-50)}}}function ga(e,t,n){let r=e=>k(e,n,M.edgeLabel)<=t;return e.split(`
|
|
56
|
+
`).map(e=>{let t=[],n=``;for(let i of e.split(/\s+/).filter(Boolean))n&&!r(`${n} ${i}`)?(t.push(n),n=i):n=n?`${n} ${i}`:i;return t.push(n),t.join(`
|
|
57
|
+
`)}).join(`
|
|
58
|
+
`)}function _a(e,t){let n=e.layout,r=t/16,i=n.width??150,a=i*r,o=(i+(n.actorMargin??50))*r;return{...e,notes:e.notes.map(e=>({...e,text:ga(e.text,a,t)})),messages:e.messages.map(e=>({...e,label:ga(e.label,o,t)}))}}function va(t,n={}){let r=t.layout?.wrap?_a(t,ne(n.fontSizes).edgeLabel):t;if(r.actors.length===0)return{width:0,height:0,actors:[],lifelines:[],messages:[],activations:[],blocks:[],notes:[],boxes:[],footerActors:[]};let i=ra(n.sequence,r.layout),a=e=>e===`left`||e===`right`?e:void 0,o=a(r.layout?.noteAlign),s=a(r.layout?.messageAlign),c=ne(n.fontSizes),l=r.actors.map(e=>{let t=k(e.label,c.nodeLabel,M.nodeLabel);return Math.max(t+i.actorPadX*2,i.actorMinWidth)}),u=l.map((e,t)=>t===0?0:Math.max(i.actorGap,(l[t-1]+e)/2+40+(i.actorGap-Gi.actorGap)));ha(r,l,u,i,c.edgeLabel);let d=[],f=i.padding+l[0]/2;for(let e=0;e<r.actors.length;e++)f+=u[e],d.push(f);let p=new Map;for(let e=0;e<r.actors.length;e++)p.set(r.actors[e].id,e);let m=r.boxes.filter(e=>e.actorIds.length>0),h=m.some(e=>e.label!==``),g=m.length===0?0:i.boxPad+(h?Yi(c.edgeLabel):0),_=r.title?i.titleBand:0,v=i.paddingY+_,y=v+g,b=r.actors.map((e,t)=>({id:e.id,label:e.label,type:e.type,...e.participantType!==void 0&&{participantType:e.participantType},x:d[t],y,width:l[t],height:Zi(e,i.actorHeight)})),x=e=>b[e].height,S=Math.max(...r.actors.map((e,t)=>e.createdAt===void 0?x(t):0),i.actorHeight),C=Math.max(...b.map(e=>e.height),i.actorHeight),w=m.map(e=>{let t=e.actorIds.map(e=>p.get(e)??0),n=Math.min(...t),r=Math.max(...t),a=d[n]-l[n]/2-i.boxPad,o=d[r]+l[r]/2+i.boxPad,s={label:e.label,x:a,y:v,width:o-a,height:0};return e.color!==void 0&&(s.color=e.color),s}),T=r.actors.map(e=>ea(e)?na(Qi(e),e.label,c.nodeLabel,M.nodeLabel):0),E=Math.max(0,...r.actors.map((e,t)=>e.createdAt===void 0?T[t]:0)),D=c.edgeLabel+12,O=y+S+Math.max(i.headerGap,E>0?E+ta+D:0),A=[],ee=new Map,te=new Map,j=new Map,re=r.blocks.map(e=>{let t=r.messages.slice(e.startIndex,e.endIndex+1).flatMap(e=>[d[p.get(e.from)],d[p.get(e.to)]]),n=t.length?Math.max(...t)-Math.min(...t):d[d.length-1]-d[0],i=Math.max(n-14,60),a=e=>e&&fa(e,i,c.edgeLabel);return{label:a(e.label),dividers:e.dividers.map(e=>a(e.label))}});r.blocks.forEach((e,t)=>{let n=r.blocks.some((n,r)=>r<t&&n.startIndex===e.startIndex),a=pa(re[t].label,c.edgeLabel),o=n?0:i.blockHeaderLabelGap;j.set(e.startIndex,(j.get(e.startIndex)??0)+a+o),ee.set(e.startIndex,(ee.get(e.startIndex)??0)+i.blockHeaderExtra+a+(n?i.blockNestedHeaderGap:o));for(let[n,a]of e.dividers.entries()){let e=r.blocks.some(e=>e.startIndex===a.index);te.set(a.index,i.dividerExtra+(e?0:i.dividerLabelGap)+pa(re[t].dividers[n],c.edgeLabel))}});let ie=ma(r.blocks),N=new Map;r.blocks.forEach((e,t)=>{let n=N.get(e.endIndex)??[];n.push(t),N.set(e.endIndex,n)});let P=[],F=e=>r.notes.slice(e.noteStartIndex,e.noteEndIndex),ae=new Map;for(let e of r.notes){let t=ae.get(e.afterIndex)??[];t.push(e),ae.set(e.afterIndex,t)}let oe=[],I=new Map,se=(t,n)=>{let r=Math.max(i.noteWidth,aa(t.text,c.edgeLabel)+i.notePadX*2),a=t.text.split(`
|
|
59
|
+
`).length,s=c.edgeLabel*(1+(a-1)*e.LINE_HEIGHT_RATIO)+i.notePadY*2,u=p.get(t.actorIds[0]??``)??0,f;if(t.position===`left`)f=d[u]-l[u]/2-r-i.noteGap;else if(t.position===`right`)f=d[u]+l[u]/2+i.noteGap;else if(t.actorIds.length>1){let e=p.get(t.actorIds[t.actorIds.length-1]??``)??u,n=d[u],i=d[e];r=Math.max(r,Math.abs(n-i)+50),f=(n+i)/2-r/2}else f=d[u]-r/2;let m={text:t.text,x:f,y:n,width:r,height:s,position:t.position,actors:t.actorIds,...o&&{align:o}};return oe.push(m),I.set(t,m),n+s+i.noteStackGap},ce=ae.get(-1);if(ce&&ce.length>0){let e=O;for(let t of ce)e=se(t,e);O=Math.max(O,e+i.messageRowHeight/2)}let le=new Map,ue=[],de=i.activationWidth/2;function fe(e,t,n=!1){let r=n?t+i.selfMessageHeight+2:t,a=le.get(e)??[];le.set(e,a);let o=a.length;a.push({startY:r,depth:o})}function pe(e,t,n=!1){let r=n?t+i.selfMessageHeight:t,a=le.get(e);if(!a||a.length===0)return;let{startY:o,depth:s}=a.pop(),c=p.get(e)??0,l=s*de;ue.push({actorId:e,x:d[c]-i.activationWidth/2+l,topY:o,bottomY:r,width:i.activationWidth,depth:s})}let me=new Map;for(let e of r.activations){let t=me.get(e.afterIndex)??[];t.push(e),me.set(e.afterIndex,t)}function he(e,t,n=!1){for(let r of me.get(e)??[])r.kind===`start`?fe(r.actorId,t,n):pe(r.actorId,t,n)}he(-1,O);let ge=r.mirrorActors!==!1,_e=[];for(let e=0;e<r.messages.length;e++){let t=r.messages[e],n=p.get(t.from)??0,a=p.get(t.to)??0,o=t.from===t.to&&ge&&r.actors[n].destroyedAt===e,u=t.from===t.to&&!o;O+=(ee.get(e)??0)+(te.get(e)??0);let f=pa(t.label,c.edgeLabel);O+=f,_e[e]=f;let m=d[n],h=d[a];o&&(m-=ea(r.actors[n])?18:l[n]/2);let g=!u&&r.actors[a].createdAt===e;if(g){let e=l[a]/2;h+=m<h?-e:e}if(!o&&ge&&n!==a){let t=Math.sign(h-m),i=e=>ea(r.actors[e])?18:l[e]/2;r.actors[n].destroyedAt===e&&(m+=t*(i(n)+1)),r.actors[a].destroyedAt===e&&(h-=t*(i(a)+8))}A.push({from:t.from,to:t.to,label:t.label,lineStyle:t.lineStyle,arrowHead:t.arrowHead,x1:m,x2:h,y:O,isSelf:u,bidirectional:t.bidirectional??!1,...t.isLost&&{isLost:!0},...s&&{labelAlign:s},...u&&r.layout?.rightAngles&&{rightAngles:!0},seqNumber:t.seqNumber}),t.activate&&fe(t.to,O,u),t.deactivate&&pe(t.from,O,u),he(e,O,u),O+=u?i.selfMessageHeight+i.messageRowHeight:i.messageRowHeight,g&&(O+=x(a)/2);let _=t=>{let n=A[e].y+(u?20:0)+i.blockPadBottom+12;for(let e of F(r.blocks[t])){let t=I.get(e);n=Math.max(n,t.y+t.height+i.blockPadBottom)}for(let e of ie[t])n=Math.max(n,P[e]+i.blockPadBottom);P[t]=n,O=Math.max(O,n+i.messageRowHeight/2)},v=N.get(e)??[],y=ae.get(e);if(y&&y.length>0){let t=u?i.selfMessageHeight:0,n=A[e].y+t+i.noteOffsetAfterMessage;for(let e of y){let t=r.notes.indexOf(e);for(let e of v)P[e]===void 0&&r.blocks[e].noteEndIndex<=t&&(_(e),n=Math.max(n,P[e]+i.noteOffsetAfterMessage));n=se(e,n)}O=Math.max(O,n+i.messageRowHeight/2)}for(let e of v)P[e]===void 0&&_(e)}for(let[e,t]of le)for(let{startY:n,depth:r}of t){let t=p.get(e)??0,a=r*de;ue.push({actorId:e,x:d[t]-i.activationWidth/2+a,topY:n,bottomY:O-i.messageRowHeight/2,width:i.activationWidth,depth:r})}ue.sort((e,t)=>e.depth-t.depth);let ve=[];r.blocks.forEach((e,t)=>{let n=ie[t].map(e=>ve[e]),a=(A[e.startIndex]?.y??O)-i.blockPadTop-j.get(e.startIndex)-(_e[e.startIndex]??0);for(let e of n)a=Math.min(a,e.y-i.blockHeaderExtra-i.blockNestedHeaderGap);let o=P[t]??O+i.blockPadBottom+12,s=new Set;for(let t=e.startIndex;t<=e.endIndex;t++){let e=r.messages[t];e&&(s.add(p.get(e.from)??0),s.add(p.get(e.to)??0))}if(s.size===0)for(let e=0;e<r.actors.length;e++)s.add(e);let l=Math.min(...s),u=Math.max(...s),f=sa(i),m=d[l]-f,h=d[u]+f;for(let t of r.messages.slice(e.startIndex,e.endIndex+1)){if(t.from!==t.to)continue;let e=d[p.get(t.from)],n=aa(t.label,c.edgeLabel)/2;m=Math.min(m,e-n-i.blockPadX),h=Math.max(h,e+Math.max(45,n)+i.blockPadX)}for(let e of ue){let t=p.get(e.actorId);t<l||t>u||e.topY>=o||e.bottomY<=a||(h=Math.max(h,e.x+e.width+i.blockPadX))}for(let t of F(e)){let e=I.get(t);m=Math.min(m,e.x-i.blockPadX),h=Math.max(h,e.x+e.width+i.blockPadX)}for(let e of n)m=Math.min(m,e.x-i.blockPadX),h=Math.max(h,e.x+e.width+i.blockPadX);let g=e.dividers.map((e,a)=>{let o=re[t].dividers[a],s=n.filter((n,i)=>r.blocks[ie[t][i]].startIndex===e.index);if(s.length>0)return{y:Math.min(...s.map(e=>e.y))-i.dividerExtra,label:o};let l=A[e.index];return{y:(l?.y??O)-((e.label&&l?.label?40:28)+i.dividerLabelGap+pa(o,c.edgeLabel)+(_e[e.index]??0)),label:o}});ve.push({type:e.type,label:re[t].label,...e.color===void 0?{}:{color:e.color},x:m,y:a,width:h-m,height:o-a,dividers:g})});let ye=oe,be=O,xe=Math.max(0,...r.actors.map((e,t)=>e.destroyedAt===void 0&&T[t]>0?T[t]+ta:0)),L=be+(ge?C+xe:0)+i.paddingY+i.bottomAdj,Se=i.padding,Ce=0;for(let e of b)Se=Math.min(Se,e.x-e.width/2),Ce=Math.max(Ce,e.x+e.width/2);for(let e of ve)Se=Math.min(Se,e.x),Ce=Math.max(Ce,e.x+e.width);for(let e of ye)Se=Math.min(Se,e.x),Ce=Math.max(Ce,e.x+e.width);for(let e of w)Se=Math.min(Se,e.x),Ce=Math.max(Ce,e.x+e.width);for(let e of A)if(e.isSelf&&(Ce=Math.max(Ce,e.x1+45+8),e.label)){let t=k(e.label,c.edgeLabel,M.edgeLabel)/2+8;Ce=Math.max(Ce,e.x1+t),Se=Math.min(Se,e.x1-t)}let R=Se<i.padding?i.padding-Se:0;if(R>0){for(let e of b)e.x+=R;for(let e of A)e.x1+=R,e.x2+=R;for(let e of ue)e.x+=R;for(let e of ve)e.x+=R;for(let e of ye)e.x+=R;for(let e of w)e.x+=R;for(let e=0;e<d.length;e++)d[e]+=R}for(let e=0;e<r.actors.length;e++){let t=r.actors[e].createdAt;t!==void 0&&(b[e].y=(A[t]?.y??O)-x(e)/2)}let we=r.actors.map((e,t)=>{let n=e.destroyedAt,r={actorId:e.id,x:d[t],topY:b[t].y+x(t)+(T[t]>0?T[t]+ta:0),bottomY:n===void 0?be:(A[n]?.y??O)-(ge?x(t)/2:0)};return n!==void 0&&(r.destroyed=!0),r}),Te=b.map((e,t)=>r.actors[t].destroyedAt===void 0?{...e,y:be}:{...e,y:we[t].bottomY}).filter(()=>ge);for(let e of w)e.height=L-i.paddingY-i.bottomAdj+i.boxPad-e.y;let Ee=r.title?(0,e.measureMultilineText)(r.title,18,M.groupHeader).width+2*i.padding:0,De=Ce+R+i.padding;return{width:Math.max(De,Ee,200),height:Math.max(L,100),actors:b,lifelines:we,messages:A,activations:ue,blocks:ve,notes:ye,boxes:w,footerActors:Te,...r.title&&{title:{text:r.title,y:i.paddingY+9}}}}function ya(t,n,r=`Inter`,i=!1,a=j,o,s,c,l={}){let u=[];u.push(Cr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(ba()),u.push(`</defs>`);for(let e of t.boxes)u.push(Pa(e,a));for(let e of t.blocks.toReversed())Fa(e)&&u.push(Ia(e,a));for(let e of t.lifelines)u.push(ka(e));for(let e of t.activations)u.push(Aa(e));for(let e of t.blocks)Fa(e)||u.push(Ia(e,a));for(let e of t.footerActors)u.push(Sa(e,a,`actor-footer`));for(let e of t.messages)u.push(ja(e,a));for(let e of t.notes)u.push(za(e,a));for(let e of t.actors)u.push(Sa(e,a));return t.title&&u.push(`<g class="title">`+(0,e.renderMultilineText)(t.title.text,t.width/2,t.title.y,18,e.f`font-size="${18}" text-anchor="middle" font-weight="${M.groupHeader}" fill="var(--_text)"`)+`</g>`),u.push(`</svg>`),u.join(`
|
|
60
|
+
`)}function ba(){let t=ae.width,n=ae.height;return e.f` <marker id="seq-arrow" markerWidth="${t}" markerHeight="${n}" refX="${t}" refY="${n/2}" orient="auto-start-reverse">`+e.f`\n <polygon points="0 0, ${t} ${n/2}, 0 ${n}" fill="var(--_arrow)" />`+`
|
|
56
61
|
</marker>`+e.f`\n <marker id="seq-arrow-open" markerWidth="${t}" markerHeight="${n}" refX="${t}" refY="${n/2}" orient="auto-start-reverse">`+e.f`\n <polyline points="0 0, ${t} ${n/2}, 0 ${n}" fill="none" stroke="var(--_arrow)" stroke-width="1" />`+`
|
|
57
62
|
</marker>`+e.f`\n <marker id="seq-lost" markerWidth="${n*2}" markerHeight="${n*2}" refX="${n}" refY="${n}" orient="auto">`+e.f`\n <path d="M${n/2} ${n/2} L${n*1.5} ${n*1.5} M${n*1.5} ${n/2} L${n/2} ${n*1.5}" fill="none" stroke="var(--_arrow)" stroke-width="1" />`+`
|
|
58
|
-
</marker>`}var
|
|
59
|
-
|
|
60
|
-
`)}
|
|
61
|
-
`)
|
|
62
|
-
`)
|
|
63
|
-
`)}
|
|
64
|
-
`);let i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``;r.push(e.f`<g class="block" data-type="${(0,e.escapeAttr)(t.type)}"${i}>`),r.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${2}" stroke-dasharray="${ma}" />`);let a=ea(t,n.edgeLabel),{x:o,y:s}=t,c=$i(o,s,a).map(([t,n])=>e.f`${t},${n}`).join(` `);r.push(e.f` <polygon points="${c}" `+e.f`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${I.outerBox}" />`),r.push(` `+(0,e.renderMultilineText)(t.type,t.x+6,t.y+9,n.edgeLabel,e.f`font-size="${n.edgeLabel}" font-weight="${P.groupHeader}" fill="var(--_text-sec)"`)),t.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${t.label}]`,t.x+(a+t.width)/2,fa(t,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${P.edgeLabel}" fill="var(--_text-sec)"`));for(let i of t.dividers)r.push(e.f` <line x1="${t.x}" y1="${i.y}" x2="${t.x+t.width}" y2="${i.y}" `+`stroke="var(--_line)" stroke-width="2" stroke-dasharray="${ha}" />`),i.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${i.label}]`,t.x+t.width/2,pa(i,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${P.edgeLabel}" fill="var(--_text-muted)"`));return r.push(`</g>`),r.join(`
|
|
65
|
-
`)}function
|
|
66
|
-
</g>`}var K={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelHeight:16,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4},ja=.8;function Ma(e,t,n){let r=Math.min(n,.2*e),i=(e-2*r)/t,a=.7*i>2*r?Math.floor(.35*i):r;return{p0:r,pad:a,bar:.95*Math.min(2*a,(e-2*a)/t)}}function Na(t,n,r){let{min:i,max:a}=t.yAxis.range,o=t.series.flatMap(e=>e.data),s=o[0],c=s!==void 0&&o.every(e=>e===s)&&i===s-.1&&a===s+.1?{min:s,max:s}:{min:i,max:a},l=(0,e.niceTickValues)(c.min,c.max),u=Wa(l),d=Math.min(r(u)/2,.2*n),f=c.max-c.min;return{range:c,ticks:l,labels:u,pad:d,frac:e=>f>0?(e-c.min)/f:.5}}function Pa(t,n,r){let i=t.xAxis.categories?void 0:t.xAxis.range,a=e=>r?K.axisLabelFontSize/2:ja*Math.max(...e.map(e=>k(e,K.axisLabelFontSize,K.axisLabelFontWeight)))/2,o=t.series.some(e=>e.type===`bar`);if(!i){let e=Ra(t),r=za(t,e),{p0:i,pad:s,bar:c}=Ma(n,e,a(r)),l=o?s:i,u=t=>e<2?n/2:l+t*(n-2*l)/(e-1);return{at:(e,t)=>u(t),ticks:r.map((e,t)=>({label:e,at:u(t)})),bar:c}}let s=(0,e.niceTickValues)(i.min,i.max),c=Wa(s),{p0:l,pad:u,bar:d}=Ma(n,s.length,a(c)),f=o?u:l,p=i.max-i.min,m=e=>{let t=p>0?(e-i.min)/p:.5;return f+(r?1-t:t)*(n-2*f)};return{at:(e,t)=>m(e<2?i.min:i.min+t*p/(e-1)),ticks:s.map((e,t)=>({label:c[t],at:m(e)})),bar:d}}function Fa(e,t={}){return e.horizontal?La(e):Ia(e)}function Ia(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let i=Na(e,K.plotHeight,()=>K.axisLabelHeight),a=i.ticks,o=i.labels,s=Math.max(...o.map(e=>k(e,K.axisLabelFontSize,K.axisLabelFontWeight)),K.yLabelWidth),c=K.padding+(t?K.titleHeight:0),l=K.padding+K.xLabelHeight+(n?K.axisTitlePad:0),u=K.padding+s+K.yLabelGap+(r?K.axisTitlePad:0),d=K.padding,f=K.plotWidth,p=K.plotHeight,m=u+f+d,h=c+p+l,g={x:u,y:c,width:f,height:p},_=Ra(e),v=Pa(e,f,!1),y=(e,t)=>u+v.at(e,t),b=e=>c+p-i.pad-i.frac(e)*(p-2*i.pad),x=c+p,S=v.ticks.map(e=>({label:e.label,x:u+e.at,y:x,tx:u+e.at,ty:x+K.tickLength,labelX:u+e.at,labelY:x+18,textAnchor:`middle`})),C=a.map((e,t)=>({label:o[t],x:u,y:b(e),tx:u-K.tickLength,ty:b(e),labelX:u-K.yLabelGap,labelY:b(e),textAnchor:`end`})),w=a.map(e=>({x1:u,y1:b(e),x2:u+f,y2:b(e)})),T=za(e,_),E=e.series.map((e,t)=>t),D=Ha(e,y,b,v.bar,i.range.min>=0?c+p:b(0),T,E),O=Ua(e,y,b,T,E),A=Ka(e,E),j={x1:u,y1:c+p,x2:u+f,y2:c+p},ee={x1:u,y1:c,x2:u,y2:c+p},M={ticks:S,line:j,...e.xAxis.title?{title:{text:e.xAxis.title,x:u+f/2,y:h-K.padding}}:{}},N={ticks:C,line:ee,...e.yAxis.title?{title:{text:e.yAxis.title,x:K.padding+4,y:c+p/2,rotate:-90}}:{}};return{width:m,height:h,title:e.title?{text:e.title,x:m/2,y:K.padding+K.titleFontSize}:void 0,xAxis:M,yAxis:N,plotArea:g,bars:D,lines:O,gridLines:w,legend:A}}function La(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let i=Na(e,K.plotWidth,e=>ja*Math.max(...e.map(e=>k(e,K.axisLabelFontSize,K.axisLabelFontWeight)))),a=i.ticks,o=i.labels,s=za(e,Ra(e)),c=Pa(e,K.plotHeight,!0),l=Math.max(...c.ticks.map(({label:e})=>k(e,K.axisLabelFontSize,K.axisLabelFontWeight)),40),u=K.padding+(t?K.titleHeight:0)+(r?K.axisTitlePad:0)+K.xLabelHeight,d=K.padding,f=K.padding+l+K.yLabelGap+(n?K.axisTitlePad:0),p=Math.max(K.padding,k(o[o.length-1],K.axisLabelFontSize,K.axisLabelFontWeight)/2+4),m=K.plotWidth,h=K.plotHeight,g=f+m+p,_=u+h+d,v={x:f,y:u,width:m,height:h},y=e=>f+i.pad+i.frac(e)*(m-2*i.pad),b=(e,t)=>u+c.at(e,t),x=a.map((e,t)=>({label:o[t],x:y(e),y:u,tx:y(e),ty:u-K.tickLength,labelX:y(e),labelY:u-18,textAnchor:`middle`})),S=c.ticks.map(({label:e,at:t})=>({label:e,x:f,y:u+t,tx:f-K.tickLength,ty:u+t,labelX:f-K.yLabelGap,labelY:u+t,textAnchor:`end`})),C=a.map(e=>({x1:y(e),y1:u,x2:y(e),y2:u+h})),w=e.series.map((e,t)=>t),T=e.series.filter(e=>e.type===`bar`).length,E=[];if(T>0){let t=c.bar,n=t,r=0,a=0;for(let o of e.series){if(o.type!==`bar`){a++;continue}for(let e=0;e<o.data.length;e++){let c=b(o.data.length,e)-n/2,l=y(Math.max(o.data[e],i.range.min)),u=i.range.min>=0?f:y(0);E.push({x:Math.min(u,l),y:c,width:Math.abs(l-u),height:t,value:o.data[e],label:s[e],seriesIndex:r,colorIndex:w[a]})}r++,a++}}let D=[],O=0,A=0;for(let t of e.series){if(t.type!==`line`){A++;continue}let e=t.data.map((e,n)=>({x:y(e),y:b(t.data.length,n),value:e,label:s[n]}));D.push({points:e,seriesIndex:O,colorIndex:w[A]}),O++,A++}let j={x1:f,y1:u,x2:f+m,y2:u},ee={x1:f,y1:u,x2:f,y2:u+h},M={ticks:x,line:j,...e.yAxis.title?{title:{text:e.yAxis.title,x:f+m/2,y:K.padding+(t?K.titleHeight:0)+K.axisTitlePad/2}}:{}},N={ticks:S,line:ee,...e.xAxis.title?{title:{text:e.xAxis.title,x:K.padding+4,y:u+h/2,rotate:-90}}:{}};return{width:g,height:_,horizontal:!0,title:e.title?{text:e.title,x:g/2,y:K.padding+K.titleFontSize}:void 0,xAxis:M,yAxis:N,plotArea:v,bars:E,lines:D,gridLines:C,legend:Ka(e,w)}}function Ra(e){if(e.xAxis.categories)return e.xAxis.categories.length;for(let t of e.series)if(t.data.length>0)return t.data.length;return 1}function za(e,t){if(e.xAxis.categories)return e.xAxis.categories;if(e.xAxis.range){let{min:n,max:r}=e.xAxis.range,i=t>1?(r-n)/(t-1):0;return Array.from({length:t},(e,t)=>Ga(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var Ba=8;function Va(e,t){let n=e.map(e=>k(e,K.axisLabelFontSize,K.axisLabelFontWeight));for(let r=1;r<e.length;r++){let i=!0;for(let a=0;a+r<e.length;a+=r)if(r*t-(n[a]+n[a+r])/2<Ba){i=!1;break}if(i)return r}return Math.max(1,e.length)}function Ha(e,t,n,r,i,a,o){if(e.series.filter(e=>e.type===`bar`).length===0)return[];let s=r,c=[],l=0,u=0;for(let d of e.series){if(d.type!==`bar`){u++;continue}for(let e=0;e<d.data.length;e++){let f=t(d.data.length,e)-s/2,p=n(d.data[e]);c.push({x:f,y:Math.min(p,i),width:r,height:Math.abs(i-p),value:d.data[e],label:a[e],seriesIndex:l,colorIndex:o[u]})}l++,u++}return c}function Ua(e,t,n,r,i){let a=[],o=0,s=0;for(let c of e.series){if(c.type!==`line`){s++;continue}let e=c.data.map((e,i)=>({x:t(c.data.length,i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function Wa(e){let t=e.length>1?Math.abs(e[1]-e[0]):0,n=t>0&&t<1?Math.ceil(-Math.log10(t)-1e-9):0;return e.map(e=>String(Number.isInteger(e)&&n===0?e:Number(e.toFixed(n))))}function Ga(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function Ka(e,t){let n=0,r=0;return e.series.map((e,i)=>{let a=e.type===`bar`?n++:r++;return{label:`${e.type===`bar`?`Bar`:`Line`} ${a+1}`,x:0,y:0,type:e.type,seriesIndex:a,colorIndex:t[i]}})}var q={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,dotRadius:5,lineWidth:2.5},J={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function qa(t,n,r=`Inter`,i=!1,a=!1,o,s,c,l={}){let u=[],d=Math.max(0,...t.bars.map(e=>e.colorIndex),...t.lines.map(e=>e.colorIndex)),f=vr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description).replace(`<svg `,`<svg data-xychart-colors="${d}" `),o);u.push(f),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont));let{style:p,defs:m}=Ja(t,a,n.accent,n.bg,l.nonce);u.push(p),m&&u.push(m);let{plotArea:h}=t,g=h.y+h.height;u.push(t.horizontal?`<path d="M${Y(h.x)},${Y(g)} V${Y(h.y)} H${Y(h.x+h.width)}" class="xychart-axis"/>`:`<path d="M${Y(h.x)},${Y(h.y)} V${Y(g)} H${Y(h.x+h.width)}" class="xychart-axis"/>`);for(let e of[...t.xAxis.ticks,...t.yAxis.ticks])u.push(`<path d="M${Y(e.x)},${Y(e.y)} L${Y(e.tx)},${Y(e.ty)}" class="xychart-axis"/>`);let _=[];for(let e of t.bars){let n=` data-value="${e.value}"${e.label?` data-label="${X(e.label)}"`:``}`,r=Math.max(e.x,h.x),i=Math.min(e.x+e.width,h.x+h.width),o=Math.max(e.y,h.y),s=Math.min(e.y+e.height,h.y+h.height);if(i<=r||s<=o)continue;let c=`M${Y(r)},${Y(o)} H${Y(i)} V${Y(s)} H${Y(r)} Z`;if(u.push(`<path d="${c}" class="xychart-bar xychart-color-${e.colorIndex}"${n}/>`),a){let n=$a(e.value),a=e.label?`${e.label}: ${n}`:n,c=Qa((r+i)/2,o,n);_.push({extent:t.horizontal?i-r:s-o,html:`<g class="xychart-bar-group"><rect x="${Y(r)}" y="${Y(o)}" width="${Y(i-r)}" height="${Y(s-o)}" fill="transparent"/><title>${X(a)}</title>`+c+`</g>`})}}_.sort((e,t)=>t.extent-e.extent);for(let e of t.lines){if(e.points.length===0)continue;let t=Ya(e.points);u.push(`<path d="${t}" class="xychart-line-shadow xychart-color-${e.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${t}" class="xychart-line xychart-color-${e.colorIndex}"/>`)}let v=Math.max(...t.lines.map(e=>e.points.length),0),y=v>0&&v<=12,b=[];if(a){let e=new Map;for(let n of t.legend)n.type===`line`&&e.set(n.seriesIndex,n.label);let n=new Map;for(let e of t.lines)for(let t of e.points){let r=Y(t.x),i=n.get(r)??[];n.set(r,i),i.push({x:t.x,y:t.y,value:t.value,label:t.label,seriesIndex:e.seriesIndex,colorIndex:e.colorIndex})}for(let t of n.values()){let n=t[0].x,r=t[0].label||``;if(a&&t.length>1){let i=Math.min(...t.map(e=>e.y)),a=Math.max(...t.map(e=>e.y)),o=q.dotRadius*3,s=`<rect x="${Y(n-o)}" y="${Y(i-o)}" width="${Y(o*2)}" height="${Y(a-i+o*2)}" fill="transparent" class="xychart-hit"/>`,c=t.map(t=>({text:$a(t.value),legendLabel:e.get(t.seriesIndex)||`Line ${t.seriesIndex+1}`})),l=Za(n,i-q.dotRadius,r,c),u=c.map(e=>e.text),d=r?`${r}: ${u.join(` · `)}`:u.join(` · `),f=`<g class="xychart-dot-group">${s}`;for(let e of t){let t=` data-value="${e.value}"${e.label?` data-label="${X(e.label)}"`:``}`;f+=`<circle cx="${Y(e.x)}" cy="${Y(e.y)}" r="${q.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`}f+=`<title>${X(d)}</title>${l}</g>`,b.push(f)}else if(a){let e=t[0],r=` data-value="${e.value}"${e.label?` data-label="${X(e.label)}"`:``}`,i=$a(e.value),a=e.label?`${e.label}: ${i}`:i,o=Qa(n,e.y-q.dotRadius,i),s=y?`<circle cx="${Y(n)}" cy="${Y(e.y)}" r="${q.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;b.push(`<g class="xychart-dot-group">${s}<circle cx="${Y(e.x)}" cy="${Y(e.y)}" r="${q.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${r}/><title>${X(a)}</title>${o}</g>`)}}}for(let e of t.xAxis.ticks)e.label!==``&&u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${q.labelSize}" font-weight="${q.labelWeight}" dy="${L}" class="xychart-label">${X(e.label)}</text>`);for(let e of t.yAxis.ticks)u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${q.labelSize}" font-weight="${q.labelWeight}" dy="${L}" class="xychart-label">${X(e.label)}</text>`);if(t.xAxis.title){let e=t.xAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${q.axisTitleSize}" font-weight="${q.axisTitleWeight}" dy="${L}" class="xychart-axis-title">${X(e.text)}</text>`)}if(t.yAxis.title){let e=t.yAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${q.axisTitleSize}" font-weight="${q.axisTitleWeight}" dy="${L}" class="xychart-axis-title">${X(e.text)}</text>`)}t.title&&u.push(`<text x="${t.title.x}" y="${t.title.y}" text-anchor="middle" font-size="${q.titleSize}" font-weight="${q.titleWeight}" dy="${L}" class="xychart-title">${X(t.title.text)}</text>`);for(let e of _)u.push(e.html);for(let e of b)u.push(e);return u.push(`</svg>`),u.join(`
|
|
67
|
-
`)}function Ja(n,r,i,a,o){let s=i??t.CHART_ACCENT_FALLBACK,c=new Set;for(let e of n.bars)c.add(e.colorIndex);for(let e of n.lines)c.add(e.colorIndex);let l=[];for(let e of[...c].sort((e,t)=>e-t)){let n=e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,s,a);l.push(` --xychart-color-${e}: ${n};`),l.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let u=[];for(let e of[...c].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;u.push(` .xychart-bar.xychart-color-${e} { stroke: none; fill: var(--xychart-bar-fill-${e}); }`),u.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),u.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let d=r?`
|
|
63
|
+
</marker>`}var xa={boundary:(e,t)=>`\n <circle cx="15" cy="12" r="8" ${e} />\n <path d="M1 6V18M1 12H7" ${t} />`,control:(e,t)=>`\n <circle cx="12" cy="13" r="9" ${e} />\n <path d="M13 1L10 4L13 7" ${t} />`,entity:(e,t)=>`\n <circle cx="12" cy="11" r="9" ${e} />\n <path d="M3 22H21" ${t} />`,database:(e,t)=>`\n <path d="M2 5A10 3.5 0 0 1 22 5V19A10 3.5 0 0 1 2 19Z" ${e} />\n <path d="M2 5A10 3.5 0 0 0 22 5" ${t} />`};function Sa(t,n,r=`actor`){let{id:i,x:a,y:o,width:s,height:c,label:l,type:u,participantType:d}=t,f=[],p=e.f`font-size="${n.nodeLabel}" text-anchor="middle" font-weight="${M.nodeLabel}" fill="var(--_text)"`;if(f.push(e.f`<g class="${r}" data-id="${(0,e.escapeAttr)(i)}" data-label="${(0,e.escapeAttr)(l)}" data-type="${u}">`),u===`actor`){let t=44/65,r=o,i=e=>a+e*t,s=e=>r+e*t,u=e.f`stroke="var(--_line)" stroke-width="2"`;f.push(e.f` <circle cx="${a}" cy="${s(15)}" r="${15*t}" fill="var(--_node-fill)" ${u} />`+e.f`\n <path d="M${a} ${s(30)}V${s(50)}M${i(-18)} ${s(38)}H${i(18)}M${i(-18)} ${s(65)}L${a} ${s(50)}L${i(16)} ${s(65)}" fill="none" ${u} />`),f.push(` `+(0,e.renderMultilineText)(l,a,o+c+15,n.nodeLabel,p))}else if(ea(t)){let t=c/24*.9,r=P.outerBox/t,i=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${r}"`,s=e.f`fill="none" stroke="var(--_node-stroke)" stroke-width="${r}"`,u=xa[d](i,s);f.push(e.f` <g transform="translate(${a-12*t},${o+(c-24*t)/2}) scale(${t})">${u}\n </g>`),f.push(` `+(0,e.renderMultilineText)(l,a,o+c+14,n.nodeLabel,p))}else{let t=a-s/2,r=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}"`,i=a,u=o+c/2;if(d===`queue`){let n=c/2,i=t+8,a=t+s-8;f.push(e.f` <path d="M${i},${o}H${a}A${8},${n} 0 0 1 ${a},${o+c}H${i}A${8},${n} 0 0 1 ${i},${o}Z" ${r} />`,e.f` <path d="M${a},${o}A${8},${n} 0 0 0 ${a},${o+c}" fill="none" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`)}else d===`collections`?(f.push(e.f` <rect x="${t+4}" y="${o}" width="${s-4}" height="${c-4}" rx="4" ry="4" ${r} />`,e.f` <rect x="${t}" y="${o+4}" width="${s-4}" height="${c-4}" rx="4" ry="4" ${r} />`),i=a-2,u=o+2+(c-4)/2):f.push(e.f` <rect x="${t}" y="${o}" width="${s}" height="${c}" rx="4" ry="4" ${r} />`);f.push(` `+(0,e.renderMultilineText)(l,i,u,n.nodeLabel,p))}return f.push(`</g>`),f.join(`
|
|
64
|
+
`)}var Ca=10;function wa(e,t){return e.y-Ca-pa(e.label,t.edgeLabel)/2}function Ta(e,t){return e.y+9+pa(e.label,t.edgeLabel)/2}function Ea(e,t){return e.y+14+pa(e.label,t.edgeLabel)/2}var Da=`2 2`,Oa=`3 3`;function ka(t){return e.f`<line class="lifeline" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x1="${t.x}" y1="${t.topY}" x2="${t.x}" y2="${t.bottomY}" `+`stroke="var(--_line)" stroke-width="${oa}" />`}function Aa(t){return e.f`<rect class="activation" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x="${t.x}" y="${t.topY}" width="${t.width}" height="${t.bottomY-t.topY}" `+e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />`}function ja(t,n){let r=[],i=t.lineStyle===`dashed`?` stroke-dasharray="6 4"`:``,a=t.isLost?`seq-lost`:t.arrowHead===`filled`?`seq-arrow`:`seq-arrow-open`,o=t.bidirectional?e.f` marker-start="url(#${a})"`:``;if(r.push(e.f`<g class="message" data-from="${(0,e.escapeAttr)(t.from)}" data-to="${(0,e.escapeAttr)(t.to)}" `+e.f`data-label="${(0,e.escapeAttr)(t.label)}" data-line-style="${t.lineStyle}" `+e.f`data-arrow-head="${t.arrowHead}" data-self="${t.isSelf}" data-bidirectional="${t.bidirectional}"${t.isLost?` data-lost="true"`:``}>`),t.isSelf){let n=t.rightAngles?e.f`M ${t.x1},${t.y-10} H ${t.x1+75} V ${t.y+15} H ${t.x2}`:e.f`M ${t.x1},${t.y} C ${t.x1+60},${t.y-10} ${t.x1+60},${t.y+20+10} ${t.x2},${t.y+20}`;r.push(e.f` <path d="${n}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${P.connector}"${i} marker-end="url(#${a})"${o} />`)}else r.push(e.f` <line x1="${t.x1}" y1="${t.y}" x2="${t.x2}" y2="${t.y}" `+e.f`stroke="var(--_line)" stroke-width="${P.connector}"${i} marker-end="url(#${a})"${o} />`);return r.push(` `+(0,e.renderMultilineText)(t.label,t.labelAlign===`left`?Math.min(t.x1,t.x2)+Ra:t.labelAlign===`right`?Math.max(t.x1,t.x2)-Ra:(t.x1+t.x2)/2,wa(t,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${t.labelAlign===`left`?`start`:t.labelAlign===`right`?`end`:`middle`}" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`)),t.seqNumber!==void 0&&r.push(` `+Ma(t,n)),r.push(`</g>`),r.join(`
|
|
65
|
+
`)}function Ma(t,n){let r=Math.max(n.edgeLabel-2,8),i=t.bidirectional?t.x1+Math.sign(t.x2-t.x1)*(8+ae.width):t.x1;return`<g class="seq-number">`+e.f`<circle cx="${i}" cy="${t.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${P.innerBox}" />`+(0,e.renderMultilineText)(String(t.seqNumber),i,t.y,r,e.f`font-size="${r}" text-anchor="middle" font-weight="${M.edgeLabel}" fill="var(--_arrow)"`)+`</g>`}var Na=35;function Pa(t,n){let r=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``,i=t.color===void 0?``:e.f` data-color="${(0,e.escapeAttr)(t.color)}"`,a=t.color===void 0?`none`:e.f`color-mix(in srgb, ${(0,e.escapeAttr)(t.color)} ${Na}%, var(--bg))`,o=[e.f`<g class="participant-box"${r}${i}>`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" rx="4" ry="4" `+e.f`fill="${a}" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />`];return t.label&&o.push(` `+(0,e.renderMultilineText)(t.label,t.x+t.width/2,t.y+Yi(n.edgeLabel)/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${M.groupHeader}" fill="var(--_text-sec)"`)),o.push(`</g>`),o.join(`
|
|
66
|
+
`)}function Fa(e){return e.type===`rect`&&e.color!==void 0}function Ia(t,n){let r=[];if(Fa(t))return[e.f`<g class="block" data-type="rect" data-color="${(0,e.escapeAttr)(t.color)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`fill="${(0,e.escapeAttr)(t.color)}" />`,`</g>`].join(`
|
|
67
|
+
`);let i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``;r.push(e.f`<g class="block" data-type="${(0,e.escapeAttr)(t.type)}"${i}>`),r.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${2}" stroke-dasharray="${Da}" />`);let a=da(t,n.edgeLabel),{x:o,y:s}=t,c=ua(o,s,a).map(([t,n])=>e.f`${t},${n}`).join(` `);r.push(e.f` <polygon points="${c}" `+e.f`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),r.push(` `+(0,e.renderMultilineText)(t.type,t.x+6,t.y+9,n.edgeLabel,e.f`font-size="${n.edgeLabel}" font-weight="${M.groupHeader}" fill="var(--_text-sec)"`)),t.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${t.label}]`,t.x+(a+t.width)/2,Ta(t,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${M.edgeLabel}" fill="var(--_text-sec)"`));for(let i of t.dividers)r.push(e.f` <line x1="${t.x}" y1="${i.y}" x2="${t.x+t.width}" y2="${i.y}" `+`stroke="var(--_line)" stroke-width="2" stroke-dasharray="${Oa}" />`),i.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${i.label}]`,t.x+t.width/2,Ea(i,n),n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`));return r.push(`</g>`),r.join(`
|
|
68
|
+
`)}var La=10,Ra=10;function za(t,n){let{x:r,y:i,width:a,height:o}=t,s=t.actors&&t.actors.length>0?e.f` data-actors="${t.actors.map(e.escapeAttr).join(`,`)}"`:``,c=t.position?e.f` data-position="${(0,e.escapeAttr)(t.position)}"`:``;return e.f`<g class="note"${c}${s}>`+e.f`\n <rect x="${r}" y="${i}" width="${a}" height="${o}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`+e.f`\n ${(0,e.renderMultilineText)(t.text,t.align===`left`?r+La:t.align===`right`?r+a-La:r+a/2,i+o/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="${t.align===`left`?`start`:t.align===`right`?`end`:`middle`}" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`)}`+`
|
|
69
|
+
</g>`}var V={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelHeight:16,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4},Ba=.8;function Va(e){return e.min>=0||e.min===e.max}function Ha(e,t,n){let r=Math.min(n,.2*e),i=(e-2*r)/t,a=.7*i>2*r?Math.floor(.35*i):r;return{p0:r,pad:a,bar:.95*Math.min(2*a,(e-2*a)/t)}}function Ua(t,n,r){let i=(0,e.collapseFlatRange)(t.yAxis.range,t.series.flatMap(e=>e.data)),a=(0,e.niceTickValues)(i.min,i.max),o=eo(a),s=Math.min(r(o)/2,.2*n),c=i.max-i.min;return{range:i,ticks:a,labels:o,pad:s,frac:e=>c>0?(e-i.min)/c:.5}}function Wa(t,n,r){let i=t.xAxis.categories?void 0:t.xAxis.range,a=e=>r?V.axisLabelFontSize/2:Ba*Math.max(...e.map(e=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight)))/2,o=t.series.some(e=>e.type===`bar`);if(!i){let e=Ja(t),r=Ya(t,e),{p0:i,pad:s,bar:c}=Ha(n,e,a(r)),l=o?s:i,u=t=>e<2?n/2:l+t*(n-2*l)/(e-1);return{at:(e,t)=>u(t),ticks:r.map((e,t)=>({label:e,at:u(t)})),bar:c}}let s=(0,e.niceTickValues)(i.min,i.max),c=eo(s),{p0:l,pad:u,bar:d}=Ha(n,s.length,a(c)),f=o?u:l,p=i.max-i.min,m=e=>{let t=p>0?(e-i.min)/p:.5;return f+(r?1-t:t)*(n-2*f)};return{at:(e,t)=>m(e<2?i.min:i.min+t*p/(e-1)),ticks:s.map((e,t)=>({label:c[t],at:m(e)})),bar:d}}function Ga(e,t={}){return e.horizontal?qa(e):Ka(e)}function Ka(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let i=Ua(e,V.plotHeight,()=>V.axisLabelHeight),a=i.ticks,o=i.labels,s=Math.max(...o.map(e=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight)),V.yLabelWidth),c=V.padding+(t?V.titleHeight:0),l=V.padding+V.xLabelHeight+(n?V.axisTitlePad:0),u=V.padding+s+V.yLabelGap+(r?V.axisTitlePad:0),d=V.padding,f=V.plotWidth,p=V.plotHeight,m=u+f+d,h=c+p+l,g={x:u,y:c,width:f,height:p},_=Ja(e),v=Wa(e,f,!1),y=(e,t)=>u+v.at(e,t),b=e=>c+p-i.pad-i.frac(e)*(p-2*i.pad),x=c+p,S=v.ticks.map(e=>({label:e.label,x:u+e.at,y:x,tx:u+e.at,ty:x+V.tickLength,labelX:u+e.at,labelY:x+18,textAnchor:`middle`})),C=a.map((e,t)=>({label:o[t],x:u,y:b(e),tx:u-V.tickLength,ty:b(e),labelX:u-V.yLabelGap,labelY:b(e),textAnchor:`end`})),w=a.map(e=>({x1:u,y1:b(e),x2:u+f,y2:b(e)})),T=Ya(e,_),E=e.series.map((e,t)=>t),D=Qa(e,y,b,v.bar,Va(i.range)?c+p:b(0),T,E),O=$a(e,y,b,T,E),A=no(e,E),ee={x1:u,y1:c+p,x2:u+f,y2:c+p},te={x1:u,y1:c,x2:u,y2:c+p},j={ticks:S,line:ee,...e.xAxis.title?{title:{text:e.xAxis.title,x:u+f/2,y:h-V.padding}}:{}},ne={ticks:C,line:te,...e.yAxis.title?{title:{text:e.yAxis.title,x:V.padding+4,y:c+p/2,rotate:-90}}:{}};return{width:m,height:h,title:e.title?{text:e.title,x:m/2,y:V.padding+V.titleFontSize}:void 0,xAxis:j,yAxis:ne,plotArea:g,bars:D,lines:O,gridLines:w,legend:A}}function qa(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title;if(!e.yAxis.range)throw Error(`XY chart: y-axis range was not set by the parser`);let i=Ua(e,V.plotWidth,e=>Ba*Math.max(...e.map(e=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight)))),a=i.ticks,o=i.labels,s=Ya(e,Ja(e)),c=Wa(e,V.plotHeight,!0),l=Math.max(...c.ticks.map(({label:e})=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight)),40),u=V.padding+(t?V.titleHeight:0)+(r?V.axisTitlePad:0)+V.xLabelHeight,d=V.padding,f=V.padding+l+V.yLabelGap+(n?V.axisTitlePad:0),p=Math.max(V.padding,k(o[o.length-1],V.axisLabelFontSize,V.axisLabelFontWeight)/2+4),m=V.plotWidth,h=V.plotHeight,g=f+m+p,_=u+h+d,v={x:f,y:u,width:m,height:h},y=e=>f+i.pad+i.frac(e)*(m-2*i.pad),b=(e,t)=>u+c.at(e,t),x=a.map((e,t)=>({label:o[t],x:y(e),y:u,tx:y(e),ty:u-V.tickLength,labelX:y(e),labelY:u-18,textAnchor:`middle`})),S=c.ticks.map(({label:e,at:t})=>({label:e,x:f,y:u+t,tx:f-V.tickLength,ty:u+t,labelX:f-V.yLabelGap,labelY:u+t,textAnchor:`end`})),C=a.map(e=>({x1:y(e),y1:u,x2:y(e),y2:u+h})),w=e.series.map((e,t)=>t),T=e.series.filter(e=>e.type===`bar`).length,E=[];if(T>0){let t=c.bar,n=t,r=0,a=0;for(let o of e.series){if(o.type!==`bar`){a++;continue}for(let e=0;e<o.data.length;e++){let c=b(o.data.length,e)-n/2,l=y(Math.max(o.data[e],i.range.min)),u=Va(i.range)?f:y(0);E.push({x:Math.min(u,l),y:c,width:Math.abs(l-u),height:t,value:o.data[e],label:s[e],seriesIndex:r,colorIndex:w[a]})}r++,a++}}let D=[],O=0,A=0;for(let t of e.series){if(t.type!==`line`){A++;continue}let e=t.data.map((e,n)=>({x:y(e),y:b(t.data.length,n),value:e,label:s[n]}));D.push({points:e,seriesIndex:O,colorIndex:w[A]}),O++,A++}let ee={x1:f,y1:u,x2:f+m,y2:u},te={x1:f,y1:u,x2:f,y2:u+h},j={ticks:x,line:ee,...e.yAxis.title?{title:{text:e.yAxis.title,x:f+m/2,y:V.padding+(t?V.titleHeight:0)+V.axisTitlePad/2}}:{}},ne={ticks:S,line:te,...e.xAxis.title?{title:{text:e.xAxis.title,x:V.padding+4,y:u+h/2,rotate:-90}}:{}};return{width:g,height:_,horizontal:!0,title:e.title?{text:e.title,x:g/2,y:V.padding+V.titleFontSize}:void 0,xAxis:j,yAxis:ne,plotArea:v,bars:E,lines:D,gridLines:C,legend:no(e,w)}}function Ja(e){if(e.xAxis.categories)return e.xAxis.categories.length;for(let t of e.series)if(t.data.length>0)return t.data.length;return 1}function Ya(e,t){if(e.xAxis.categories)return e.xAxis.categories;if(e.xAxis.range){let{min:n,max:r}=e.xAxis.range,i=t>1?(r-n)/(t-1):0;return Array.from({length:t},(e,t)=>to(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var Xa=8;function Za(e,t){let n=e.map(e=>k(e,V.axisLabelFontSize,V.axisLabelFontWeight));for(let r=1;r<e.length;r++){let i=!0;for(let a=0;a+r<e.length;a+=r)if(r*t-(n[a]+n[a+r])/2<Xa){i=!1;break}if(i)return r}return Math.max(1,e.length)}function Qa(e,t,n,r,i,a,o){if(e.series.filter(e=>e.type===`bar`).length===0)return[];let s=r,c=[],l=0,u=0;for(let d of e.series){if(d.type!==`bar`){u++;continue}for(let e=0;e<d.data.length;e++){let f=t(d.data.length,e)-s/2,p=n(d.data[e]);c.push({x:f,y:Math.min(p,i),width:r,height:Math.abs(i-p),value:d.data[e],label:a[e],seriesIndex:l,colorIndex:o[u]})}l++,u++}return c}function $a(e,t,n,r,i){let a=[],o=0,s=0;for(let c of e.series){if(c.type!==`line`){s++;continue}let e=c.data.map((e,i)=>({x:t(c.data.length,i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function eo(e){let t=e.length>1?Math.abs(e[1]-e[0]):0,n=t>0&&t<1?Math.ceil(-Math.log10(t)-1e-9):0;return e.map(e=>String(Number.isInteger(e)&&n===0?e:Number(e.toFixed(n))))}function to(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function no(e,t){let n=0,r=0;return e.series.map((e,i)=>{let a=e.type===`bar`?n++:r++;return{label:`${e.type===`bar`?`Bar`:`Line`} ${a+1}`,x:0,y:0,type:e.type,seriesIndex:a,colorIndex:t[i]}})}var H={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,dotRadius:5,lineWidth:2.5},U={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function ro(t,n,r=`Inter`,i=!1,a=!1,o,s,c,l={}){let u=[],d=Math.max(0,...t.bars.map(e=>e.colorIndex),...t.lines.map(e=>e.colorIndex)),{style:f,defs:p,cls:m}=io(t,a,n.accent,n.bg,l.nonce),h=Cr((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description).replace(`<svg `,`<svg data-xychart-colors="${d}" `),m),o);u.push(h),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),u.push(f),p&&u.push(p);let{plotArea:g}=t,_=g.y+g.height;u.push(t.horizontal?`<path d="M${W(g.x)},${W(_)} V${W(g.y)} H${W(g.x+g.width)}" class="xychart-axis"/>`:`<path d="M${W(g.x)},${W(g.y)} V${W(_)} H${W(g.x+g.width)}" class="xychart-axis"/>`);for(let e of[...t.xAxis.ticks,...t.yAxis.ticks])u.push(`<path d="M${W(e.x)},${W(e.y)} L${W(e.tx)},${W(e.ty)}" class="xychart-axis"/>`);let v=[];for(let e of t.bars){let n=` data-value="${e.value}"${e.label?` data-label="${uo(e.label)}"`:``}`,r=Math.max(e.x,g.x),i=Math.min(e.x+e.width,g.x+g.width),o=Math.max(e.y,g.y),s=Math.min(e.y+e.height,g.y+g.height);if(i<=r||s<=o)continue;let c=`M${W(r)},${W(o)} H${W(i)} V${W(s)} H${W(r)} Z`;if(u.push(`<path d="${c}" class="xychart-bar xychart-color-${e.colorIndex}"${n}/>`),a){let n=lo(e.value),a=e.label?`${e.label}: ${n}`:n,c=co((r+i)/2,o,n);v.push({extent:t.horizontal?i-r:s-o,html:`<g class="xychart-bar-group"><rect x="${W(r)}" y="${W(o)}" width="${W(i-r)}" height="${W(s-o)}" fill="transparent"/><title>${uo(a)}</title>`+c+`</g>`})}}v.sort((e,t)=>t.extent-e.extent);for(let e of t.lines){if(e.points.length===0)continue;let t=ao(e.points);u.push(`<path d="${t}" class="xychart-line-shadow xychart-color-${e.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${t}" class="xychart-line xychart-color-${e.colorIndex}"/>`)}let y=Math.max(...t.lines.map(e=>e.points.length),0),b=y>0&&y<=12,x=[];if(a){let e=new Map;for(let n of t.legend)n.type===`line`&&e.set(n.seriesIndex,n.label);let n=new Map;for(let e of t.lines)for(let t of e.points){let r=W(t.x),i=n.get(r)??[];n.set(r,i),i.push({x:t.x,y:t.y,value:t.value,label:t.label,seriesIndex:e.seriesIndex,colorIndex:e.colorIndex})}for(let t of n.values()){let n=t[0].x,r=t[0].label||``;if(a&&t.length>1){let i=Math.min(...t.map(e=>e.y)),a=Math.max(...t.map(e=>e.y)),o=H.dotRadius*3,s=`<rect x="${W(n-o)}" y="${W(i-o)}" width="${W(o*2)}" height="${W(a-i+o*2)}" fill="transparent" class="xychart-hit"/>`,c=t.map(t=>({text:lo(t.value),legendLabel:e.get(t.seriesIndex)||`Line ${t.seriesIndex+1}`})),l=so(n,i-H.dotRadius,r,c),u=c.map(e=>e.text),d=r?`${r}: ${u.join(` · `)}`:u.join(` · `),f=`<g class="xychart-dot-group">${s}`;for(let e of t){let t=` data-value="${e.value}"${e.label?` data-label="${uo(e.label)}"`:``}`;f+=`<circle cx="${W(e.x)}" cy="${W(e.y)}" r="${H.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`}f+=`<title>${uo(d)}</title>${l}</g>`,x.push(f)}else if(a){let e=t[0],r=` data-value="${e.value}"${e.label?` data-label="${uo(e.label)}"`:``}`,i=lo(e.value),a=e.label?`${e.label}: ${i}`:i,o=co(n,e.y-H.dotRadius,i),s=b?`<circle cx="${W(n)}" cy="${W(e.y)}" r="${H.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;x.push(`<g class="xychart-dot-group">${s}<circle cx="${W(e.x)}" cy="${W(e.y)}" r="${H.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${r}/><title>${uo(a)}</title>${o}</g>`)}}}for(let e of t.xAxis.ticks)e.label!==``&&u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${H.labelSize}" font-weight="${H.labelWeight}" dy="${F}" class="xychart-label">${uo(e.label)}</text>`);for(let e of t.yAxis.ticks)u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${H.labelSize}" font-weight="${H.labelWeight}" dy="${F}" class="xychart-label">${uo(e.label)}</text>`);if(t.xAxis.title){let e=t.xAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${H.axisTitleSize}" font-weight="${H.axisTitleWeight}" dy="${F}" class="xychart-axis-title">${uo(e.text)}</text>`)}if(t.yAxis.title){let e=t.yAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${H.axisTitleSize}" font-weight="${H.axisTitleWeight}" dy="${F}" class="xychart-axis-title">${uo(e.text)}</text>`)}t.title&&u.push(`<text x="${t.title.x}" y="${t.title.y}" text-anchor="middle" font-size="${H.titleSize}" font-weight="${H.titleWeight}" dy="${F}" class="xychart-title">${uo(t.title.text)}</text>`);for(let e of v)u.push(e.html);for(let e of x)u.push(e);return u.push(`</svg>`),u.join(`
|
|
70
|
+
`)}function io(n,r,i,a,o){let s=i??t.CHART_ACCENT_FALLBACK,c=new Set;for(let e of n.bars)c.add(e.colorIndex);for(let e of n.lines)c.add(e.colorIndex);let l=[];for(let e of[...c].sort((e,t)=>e-t)){let n=e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,s,a);l.push(` --xychart-color-${e}: ${n};`),l.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let u=[];for(let e of[...c].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;u.push(` .xychart-bar.xychart-color-${e} { stroke: none; fill: var(--xychart-bar-fill-${e}); }`),u.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),u.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let d=r?`
|
|
68
71
|
.xychart-dot { opacity: 0; }
|
|
69
72
|
.xychart-dot-group:hover .xychart-dot { opacity: 1; }
|
|
70
73
|
.xychart-tip { opacity: 0; pointer-events: none; }
|
|
71
74
|
.xychart-tip-bg { fill: var(--_text); filter: drop-shadow(0 1px 3px color-mix(in srgb, var(--fg) 20%, transparent)); }
|
|
72
|
-
.xychart-tip-text { fill: var(--bg); font-size: ${
|
|
75
|
+
.xychart-tip-text { fill: var(--bg); font-size: ${U.fontSize}px; font-weight: ${U.fontWeight}; }
|
|
73
76
|
.xychart-tip-ptr { fill: var(--_text); }
|
|
74
77
|
.xychart-bar-group:hover .xychart-tip,
|
|
75
|
-
.xychart-dot-group:hover .xychart-tip { opacity: 1; }`:``,f=l.length>0?`\n
|
|
78
|
+
.xychart-dot-group:hover .xychart-tip { opacity: 1; }`:``,f=(0,e.paletteClass)(l),p=l.length>0?`\n .${f} {\n${l.join(`
|
|
76
79
|
`)}\n }`:``;return{style:`${(0,e.styleOpenTag)(o)}
|
|
77
80
|
.xychart-axis { fill: none; stroke: var(--_text); stroke-width: 2; }
|
|
78
|
-
.xychart-line { fill: none; stroke-width: ${
|
|
81
|
+
.xychart-line { fill: none; stroke-width: ${H.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
|
|
79
82
|
.xychart-line-shadow { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.12; }
|
|
80
83
|
.xychart-dot { stroke: var(--bg); stroke-width: 2; }
|
|
81
84
|
.xychart-label { fill: var(--_text-muted); }
|
|
82
85
|
.xychart-axis-title { fill: var(--_text-sec); }
|
|
83
|
-
.xychart-title { fill: var(--_text); }${
|
|
86
|
+
.xychart-title { fill: var(--_text); }${p}
|
|
84
87
|
${u.join(`
|
|
85
88
|
`)}${d}
|
|
86
|
-
</style>`,defs
|
|
87
|
-
.pie-slice.pie-highlight { opacity: 1; }`:``,l=o.length>0?`\n
|
|
88
|
-
`)}\n }`:``;return
|
|
89
|
-
.pie-outer { fill: none; stroke: var(--fg); stroke-width: ${
|
|
89
|
+
</style>`,defs:``,cls:f}}function ao(e){return e.map((e,t)=>`${t===0?`M`:`L`}${W(e.x)},${W(e.y)}`).join(` `)}function oo(e){if(e.length===0)return``;if(e.length===1)return`M${W(e[0].x)},${W(e[0].y)}`;if(e.length===2)return`M${W(e[0].x)},${W(e[0].y)} L${W(e[1].x)},${W(e[1].y)}`;let t=e.length,n=[],r=[];for(let i=0;i<t-1;i++)n.push(e[i+1].x-e[i].x),r.push(n[i]===0?0:(e[i+1].y-e[i].y)/n[i]);let i=Array(t).fill(0);for(let e=1;e<t-1;e++){let t=r[e-1],a=r[e];if(t*a<=0)continue;let o=2*n[e]+n[e-1],s=n[e]+2*n[e-1];i[e]=(o+s)/(o/t+s/a)}let a=(e,t,n,r)=>{let i=((2*e+t)*n-e*r)/(e+t);return i*n<=0?i=0:n*r<=0&&Math.abs(i)>3*Math.abs(n)&&(i=3*n),i};i[0]=a(n[0],n[1],r[0],r[1]),i[t-1]=a(n[t-2],n[t-3],r[t-2],r[t-3]);let o=`M${W(e[0].x)},${W(e[0].y)}`;for(let r=0;r<t-1;r++){let t=n[r]/3,a=e[r].x+t,s=e[r].y+i[r]*t,c=e[r+1].x-t,l=e[r+1].y-i[r+1]*t;o+=` C${W(a)},${W(s)} ${W(c)},${W(l)} ${W(e[r+1].x)},${W(e[r+1].y)}`}return o}function so(e,t,n,r){let i=k(n,U.fontSize,600),a=Math.max(...r.map(e=>{let t=k(e.legendLabel,U.fontSize,U.fontWeight),n=k(e.text,U.fontSize,U.fontWeight);return t+10+n})),o=Math.max(i,a)+U.padX*2,s=26+r.length*20+6,c=Math.max(U.minY,t-U.offsetY-s-U.pointerSize),l=e-o/2,u=e,d=c+s,f=U.pointerSize,p=`<polygon points="${W(u-f)},${W(d)} ${W(u+f)},${W(d)} ${W(u)},${W(d+f)}" class="xychart-tip xychart-tip-ptr"/>`,m=`<rect x="${W(l)}" y="${W(c)}" width="${W(o)}" height="${s}" rx="${U.rx}" class="xychart-tip xychart-tip-bg"/>`;m+=p;let h=c+6+10;m+=`<text x="${W(e)}" y="${W(h)}" text-anchor="middle" font-weight="600" font-size="${U.fontSize}" dy="${F}" class="xychart-tip xychart-tip-text">${uo(n)}</text>`;let g=l+U.padX,_=l+o-U.padX;for(let e of r)h+=20,m+=`<text x="${W(g)}" y="${W(h)}" text-anchor="start" font-size="${U.fontSize}" font-weight="${U.fontWeight}" dy="${F}" class="xychart-tip xychart-tip-text">${uo(e.legendLabel)}</text>`,m+=`<text x="${W(_)}" y="${W(h)}" text-anchor="end" font-size="${U.fontSize}" font-weight="${U.fontWeight}" dy="${F}" class="xychart-tip xychart-tip-text">${uo(e.text)}</text>`;return m}function co(e,t,n){let r=k(n,U.fontSize,U.fontWeight)+U.padX*2,i=U.height,a=Math.max(U.minY,t-U.offsetY-i-U.pointerSize),o=e-r/2,s=e,c=a+i/2,l=e,u=a+i,d=U.pointerSize,f=`<polygon points="${W(l-d)},${W(u)} ${W(l+d)},${W(u)} ${W(l)},${W(u+d)}" class="xychart-tip xychart-tip-ptr"/>`;return`<rect x="${W(o)}" y="${W(a)}" width="${W(r)}" height="${i}" rx="${U.rx}" class="xychart-tip xychart-tip-bg"/>`+f+`<text x="${W(s)}" y="${W(c)}" text-anchor="middle" dy="${F}" class="xychart-tip xychart-tip-text">${uo(n)}</text>`}function lo(e){return Number.isInteger(e)?e.toLocaleString(`en-US`):e.toFixed(+(Math.abs(e)<10))}function W(e){return String(Math.round(e*10)/10)}function uo(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var G={height:450,margin:40,legendRectSize:18,legendSpacing:4,textPosition:.75,outerStrokeWidth:2,titleFontSize:25,sectionFontSize:17,legendFontSize:17,fontWeight:400,paletteSize:12,highlightScale:1.05,minPercent:1},fo=Math.PI*2;function K(e){return String(Math.round(e*100)/100)}function po(e,t,n,r){return{x:e+n*Math.sin(r),y:t-n*Math.cos(r)}}function mo(e,t,n,r,i,a=0){if(i-r>=fo-1e-9){let r=(n,r)=>`M${K(e)},${K(t-n)}A${K(n)},${K(n)},0,1,${r},${K(e)},${K(t+n)}A${K(n)},${K(n)},0,1,${r},${K(e)},${K(t-n)}`;return r(n,1)+(a>0?r(a,0):``)+`Z`}let o=po(e,t,n,r),s=po(e,t,n,i),c=+(i-r>Math.PI),l=`M${K(o.x)},${K(o.y)}A${K(n)},${K(n)},0,${c},1,${K(s.x)},${K(s.y)}`;if(a<=0)return`${l}L${K(e)},${K(t)}Z`;let u=po(e,t,a,i),d=po(e,t,a,r);return`${l}L${K(u.x)},${K(u.y)}A${K(a)},${K(a)},0,${c},0,${K(d.x)},${K(d.y)}Z`}function ho(e,t,n){return n?`${e} [${String(t)}]`:e}function go(e,t={}){let n=G.height,r=n,i=Math.min(r,n)/2-G.margin,a=r/2,o=n/2,s=e.slices.reduce((e,t)=>e+t.value,0),c=e.slices.map((e,t)=>({slice:e,colorIndex:t%G.paletteSize})).filter(({slice:e})=>e.value/s*100>=G.minPercent),l=c.reduce((e,t)=>e+t.slice.value,0),u=G.legendRectSize+G.legendSpacing,d=e.slices.length,f=d>0?e.legendPosition??`right`:`right`,p=e.slices.map(t=>ho(t.label,t.value,e.showData)),m=Math.max(0,...p.map(e=>k(e,G.legendFontSize,G.fontWeight))),h=G.legendRectSize+G.legendSpacing,g=u*d,_=f===`left`?m+h:0,v=f===`top`?g+u:0,y=a-m/2-h,b=o-g/2,x={right:{x:a+12*G.legendRectSize,y:b},left:{x:a-i-h,y:b},center:{x:y,y:b},top:{x:y,y:o-i},bottom:{x:y,y:o+i+u}}[f],S=h+m,C=d>0&&(f===`left`||f===`right`)?r+G.margin+S:r+G.margin,w=f===`top`||f===`bottom`?n+g:n,T=e.title??``,E=T.length>0?k(T,G.titleFontSize,G.fontWeight):0,D=a-E/2,O=a+E/2,A=Math.min(0,D),ee=Math.max(C,O),te=w,j=-A,ne=a+_+j,M=o+v+-0,re=[],ie=0,N=e.donutHole??0,P=N>0&&N<=.9?N*i:0,F=i*(e.textPosition??G.textPosition);for(let{slice:t,colorIndex:n}of c){let r=ie,a=ie+t.value/l*fo;ie=a;let o=po(ne,M,F,(r+a)/2),c=e.highlightSlice!==void 0&&e.highlightSlice!==`hover`&&e.highlightSlice!==``&&e.highlightSlice===t.label,u=c?G.highlightScale:1;re.push({label:t.label,value:t.value,colorIndex:n,startAngle:r,endAngle:a,path:mo(ne,M,i*u,r,a,P*u),percentText:`${(t.value/s*100).toFixed(0)}%`,labelX:o.x,labelY:o.y,...c?{highlighted:c}:{}})}let ae=p.map((e,t)=>{let n=x.x+j,r=x.y+t*u+-0;return{text:e,colorIndex:t%G.paletteSize,x:n,y:r,size:G.legendRectSize,textX:n+G.legendRectSize+G.legendSpacing,textY:r+G.legendRectSize-G.legendSpacing}});return{width:Math.ceil(ee-A),height:Math.ceil(te-0),cx:ne,cy:M,radius:i,outerRadius:i+G.outerStrokeWidth/2,title:T.length>0?{text:T,x:a+j,y:o+-0-(n-50)/2}:void 0,slices:re,legend:ae,accTitle:e.accTitle,accDescr:e.accDescr,sliceColors:e.sliceColors}}function _o(e){return String(Math.round(e*100)/100)}function vo(e,n,r){return e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,n??t.CHART_ACCENT_FALLBACK,r)}function yo(t,n,r){let i=new Set;for(let e of t.slices)i.add(e.colorIndex);for(let e of t.legend)i.add(e.colorIndex);let a=[...i].sort((e,t)=>e-t),o=a.map(e=>` --pie-color-${e}: ${t.sliceColors?.[e]??vo(e,n.accent,n.bg)};`),s=a.map(e=>` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`),c=t.slices.some(e=>e.highlighted)?`
|
|
90
|
+
.pie-slice.pie-highlight { opacity: 1; }`:``,l=(0,e.paletteClass)(o),u=o.length>0?`\n .${l} {\n${o.join(`
|
|
91
|
+
`)}\n }`:``;return{css:`${(0,e.styleOpenTag)(r)}
|
|
92
|
+
.pie-outer { fill: none; stroke: var(--fg); stroke-width: ${G.outerStrokeWidth}px; }
|
|
90
93
|
.pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }${c}
|
|
91
|
-
.pie-slice-label { fill: var(--_text); font-size: ${
|
|
92
|
-
.pie-title { fill: var(--_text); font-size: ${
|
|
93
|
-
.pie-legend-text { fill: var(--_text); font-size: ${
|
|
94
|
+
.pie-slice-label { fill: var(--_text); font-size: ${G.sectionFontSize}px; font-weight: ${G.fontWeight}; }
|
|
95
|
+
.pie-title { fill: var(--_text); font-size: ${G.titleFontSize}px; font-weight: ${G.fontWeight}; }
|
|
96
|
+
.pie-legend-text { fill: var(--_text); font-size: ${G.legendFontSize}px; font-weight: ${G.fontWeight}; }${u}
|
|
94
97
|
${s.join(`
|
|
95
98
|
`)}
|
|
96
|
-
</style
|
|
97
|
-
`)}var
|
|
99
|
+
</style>`,cls:l}}function bo(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=yo(t,n,c.nonce);l.push(Cr((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o??t.accTitle,s,void 0,c.styleAttribute,t.accDescr),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<circle cx="${_o(t.cx)}" cy="${_o(t.cy)}" r="${_o(t.outerRadius)}" class="pie-outer"/>`);for(let n of t.slices)l.push(`<path d="${n.path}" class="pie-slice${n.highlighted?` pie-highlight`:``} pie-color-${n.colorIndex}" data-label="${(0,e.escapeAttr)(n.label)}" data-value="${n.value}"/>`);for(let n of t.slices)l.push(`<text x="${_o(n.labelX)}" y="${_o(n.labelY)}" text-anchor="middle" class="pie-slice-label">${(0,e.escapeXml)(n.percentText)}</text>`);t.title&&l.push(`<text x="${_o(t.title.x)}" y="${_o(t.title.y)}" text-anchor="middle" class="pie-title">${(0,e.escapeXml)(t.title.text)}</text>`);for(let n of t.legend)l.push(`<g class="pie-legend"><rect x="${_o(n.x)}" y="${_o(n.y)}" width="${n.size}" height="${n.size}" class="pie-legend-swatch pie-color-${n.colorIndex}"/><text x="${_o(n.textX)}" y="${_o(n.textY)}" class="pie-legend-text">${(0,e.escapeXml)(n.text)}</text></g>`);return l.push(`</svg>`),l.join(`
|
|
100
|
+
`)}var xo={titlePadding:10,titleFontSize:20,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2,xAxisPosition:`top`,yAxisPosition:`left`,width:500,height:500,axisLabelPadding:5,axisLabelFontSize:16,internalBorderWidth:1,externalBorderWidth:2},So={chartWidth:500,chartHeight:500};function Co(e){return{anchor:`middle`,baseline:`hanging`,rotation:0,...e}}function wo(e){let t={...xo,...So,...e.config},n=e.points.length>0,r=!!(e.xAxisLeft||e.xAxisRight),i=!!(e.yAxisBottom||e.yAxisTop),a=!!e.title,o=t.xAxisLabelPadding*2+t.xAxisLabelFontSize,s=t.yAxisLabelPadding*2+t.yAxisLabelFontSize,c=a?t.titleFontSize+t.titlePadding*2:0,l=!n&&t.xAxisPosition===`top`,u=l&&r?o:0,d=!l&&r?o:0,f=t.yAxisPosition===`left`&&i?s:0,p=t.yAxisPosition===`right`&&i?s:0,m=t.quadrantPadding+f,h=t.quadrantPadding+u+c,g=t.chartWidth-t.quadrantPadding*2-f-p,_=t.chartHeight-t.quadrantPadding*2-u-d-c,v=g/2,y=_/2,b=[[m+v,h],[m,h],[m,h+y],[m+v,h+y]].map(([r,i],a)=>({index:a,x:r,y:i,width:v,height:y,text:Co({text:e.quadrants[a],x:r+v/2,y:n?i+t.quadrantTextTopPadding:i+y/2,fontSize:t.quadrantLabelFontSize,baseline:n?`hanging`:`middle`})})),x=t.quadrantExternalBorderStrokeWidth/2,S=(e,n,r,i)=>({x1:e,y1:n,x2:r,y2:i,strokeWidth:t.quadrantExternalBorderStrokeWidth,kind:`external`}),C=(e,n,r,i)=>({x1:e,y1:n,x2:r,y2:i,strokeWidth:t.quadrantInternalBorderStrokeWidth,kind:`internal`}),w=[S(m-x,h,m+g+x,h),S(m+g,h+x,m+g,h+_-x),S(m-x,h+_,m+g+x,h+_),S(m,h+x,m,h+_-x),C(m+v,h+x,m+v,h+_-x),C(m+x,h+y,m+g-x,h+y)],T=[],E=l?t.xAxisLabelPadding+c:t.xAxisLabelPadding+h+_+t.quadrantPadding,D=!!e.xAxisRight,O=(e,n)=>T.push(Co({text:e,x:n,y:E,fontSize:t.xAxisLabelFontSize,anchor:D?`middle`:`start`}));r&&e.xAxisLeft&&O(e.xAxisLeft,m+(D?v/2:0)),r&&e.xAxisRight&&O(e.xAxisRight,m+v+v/2);let k=t.yAxisPosition===`left`?t.yAxisLabelPadding:t.yAxisLabelPadding+m+g+t.quadrantPadding,A=!!e.yAxisTop,ee=(e,n)=>T.push(Co({text:e,x:k,y:n,fontSize:t.yAxisLabelFontSize,anchor:A?`middle`:`start`,rotation:-90}));i&&e.yAxisBottom&&ee(e.yAxisBottom,h+_-(A?y/2:0)),i&&e.yAxisTop&&ee(e.yAxisTop,h+y-y/2);let te=[...e.points].reverse().map(e=>{let n=m+e.x*g,r=h+_-e.y*_;return{x:n,y:r,radius:e.radius??t.pointRadius,color:e.color,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth??`0px`,text:Co({text:e.label,x:n,y:r+t.pointTextPadding,fontSize:t.pointLabelFontSize})}});return{width:t.chartWidth,height:t.chartHeight,themeColors:e.themeColors,title:a?Co({text:e.title,x:t.chartWidth/2,y:t.titlePadding,fontSize:t.titleFontSize}):void 0,quadrants:b,lines:w,axisLabels:T,points:te}}function To(e){return String(Math.round(e*100)/100)}var Eo=[14,10,6,3];function Do(n,r){let i=`var(--accent, ${t.CHART_ACCENT_FALLBACK})`,a=`color-mix(in srgb, ${i} 35%, var(--bg))`,o=Eo.map((e,t)=>` .quadrant-cell-${t} { fill: color-mix(in srgb, ${i} ${e}%, var(--bg)); }`),s=n.points.flatMap((e,t)=>{let n=[e.color&&`fill: ${e.color};`,e.strokeColor&&`stroke: ${e.strokeColor};`,e.strokeWidth!==`0px`&&`stroke-width: ${e.strokeWidth};`].filter(Boolean);return n.length>0?[` .quadrant-point-${t} { ${n.join(` `)} }`]:[]}),c=n.themeColors??{},l=[...[1,2,3,4].flatMap(e=>[c[`quadrant${e}Fill`]&&` .quadrant-cell-${e-1} { fill: ${c[`quadrant${e}Fill`]}; }`,c[`quadrant${e}TextFill`]&&` .quadrant:nth-child(${e}) .quadrant-label { fill: ${c[`quadrant${e}TextFill`]}; }`]),c.quadrantPointFill&&` .quadrant-point { fill: ${c.quadrantPointFill}; stroke: ${c.quadrantPointFill}; }`,c.quadrantPointTextFill&&` .quadrant-point-label { fill: ${c.quadrantPointTextFill}; }`,c.quadrantXAxisTextFill&&` .quadrant-axis-label[transform$="rotate(0)"] { fill: ${c.quadrantXAxisTextFill}; }`,c.quadrantYAxisTextFill&&` .quadrant-axis-label[transform$="rotate(-90)"] { fill: ${c.quadrantYAxisTextFill}; }`,c.quadrantTitleFill&&` .quadrant-title { fill: ${c.quadrantTitleFill}; }`,c.quadrantInternalBorderStrokeFill&&` .quadrant-line-internal { stroke: ${c.quadrantInternalBorderStrokeFill}; }`,c.quadrantExternalBorderStrokeFill&&` .quadrant-line-external { stroke: ${c.quadrantExternalBorderStrokeFill}; }`].filter(Boolean);return`${(0,e.styleOpenTag)(r)}
|
|
98
101
|
${o.join(`
|
|
99
102
|
`)}
|
|
100
103
|
.quadrant-line { stroke: ${a}; }
|
|
101
104
|
.quadrant-text { fill: var(--_text); }
|
|
102
105
|
.quadrant-point { fill: var(--fg); stroke: var(--fg); stroke-width: 0px; }${[...l,...s].map(e=>`
|
|
103
106
|
`+e).join(``)}
|
|
104
|
-
</style>`}function
|
|
105
|
-
`)}var yo=2048,bo=[569,569,727,1139,1139,1821,1366,391,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,569,569,1196,1196,1196,1139,2079,1366,1366,1479,1479,1366,1251,1593,1479,569,1024,1366,1139,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,569,569,569,961,1139,682,1139,1139,1024,1139,1139,569,1139,1139,455,455,1024,455,1706,1139,1139,1139,1139,682,1024,569,1139,1024,1479,1024,1024,1024,684,532,684,1196],xo=[569,682,971,1139,1139,1821,1479,487,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,682,682,1196,1196,1196,1251,1992,1479,1479,1479,1479,1366,1251,1593,1479,569,1139,1479,1251,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,682,569,682,1196,1139,682,1139,1251,1139,1251,1139,682,1251,1251,569,569,1139,569,1821,1251,1251,1251,1251,797,1139,682,1251,1139,1593,1139,1139,1024,801,573,801,1196];function So(e,t){let n=e.codePointAt(0);if(!(n<32||n>126))return(t?xo:bo)[n-32]/yo}var $={width:216,diagramMarginX:50,diagramMarginY:10,shapeMargin:50,shapePadding:20,shapeInRow:4,boundaryInRow:2,nextLinePaddingX:0,screenWidth:1440,nameSize:14,typeSize:10.5,descrSize:11.5,messageSize:12,boundarySize:14,nameLine:15.35,typeLine:15.72,descrLine:17.1,descrExtraLine:12.48,textScale:.922,boundaryLabelHeight:18,boundaryTypeHeight:16.1,boundaryDescrHeight:14.4,rootHeadingHeight:47,titleExtra:60,cornerRadius:12,strokeWidth:2,personRx:.177,personRxMaxOfHeight:.45,personHeadRatio:.23,personHeadMin:16,personHeadMax:56,personHeadOverlap:.27,dbTrim:3.91,queueExtra:10},Co=$.width-2*$.shapePadding;function wo(e,t,n){let r=[];for(let i of e.split(`
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
</style>`}function Oo(t,n){return`<text x="0" y="0" class="quadrant-text ${n}" font-size="${t.fontSize}" dominant-baseline="${t.baseline}" text-anchor="${t.anchor}" transform="translate(${To(t.x)}, ${To(t.y)}) rotate(${t.rotation})">${(0,e.escapeXml)(t.text)}</text>`}function ko(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(Cr((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(Do(t,c.nonce)),l.push(`<g class="quadrants">`);for(let e of t.quadrants)l.push(`<g class="quadrant"><rect x="${To(e.x)}" y="${To(e.y)}" width="${To(e.width)}" height="${To(e.height)}" class="quadrant-cell-${e.index}"/>${Oo(e.text,`quadrant-label`)}</g>`);l.push(`</g>`),l.push(`<g class="border">`);for(let e of t.lines)l.push(`<line x1="${To(e.x1)}" y1="${To(e.y1)}" x2="${To(e.x2)}" y2="${To(e.y2)}" stroke-width="${e.strokeWidth}" class="quadrant-line quadrant-line-${e.kind}"/>`);l.push(`</g>`),l.push(`<g class="data-points">`),t.points.forEach((e,t)=>{let n=e.color||e.strokeColor||e.strokeWidth!==`0px`?` quadrant-point-${t}`:``;l.push(`<g class="data-point"><circle cx="${To(e.x)}" cy="${To(e.y)}" r="${e.radius}" class="quadrant-point${n}"/>${Oo(e.text,`quadrant-point-label`)}</g>`)}),l.push(`</g>`),l.push(`<g class="labels">`);for(let e of t.axisLabels)l.push(`<g class="label">${Oo(e,`quadrant-axis-label`)}</g>`);return l.push(`</g>`),l.push(`<g class="title">`),t.title&&l.push(Oo(t.title,`quadrant-title`)),l.push(`</g>`),l.push(`</svg>`),l.join(`
|
|
108
|
+
`)}var Ao=4500,jo=50,Mo=.45,No=2500,Po=300,Fo=jo/10,Io=100,Lo=10,Ro=150/100,zo=15,Bo=1200,Vo=900,Ho=jo,Uo=2*Math.PI,Wo=-2147483648,Go=2147483647,Ko=e=>e.x+e.width/2,qo=e=>e.y+e.height/2,q=e=>e.x+e.width,J=e=>e.y+e.height,Jo=e=>e>0?1:e<0?-1:0,Yo=(e,t)=>e.source===t?e.target:e.source;function Xo(e){let t=new Set;for(let n of e.edges)t.add(n.source===e?n.target:n.source);return t}function Zo(e,t){return!(q(e)<t.x||J(e)<t.y||q(t)<e.x||J(t)<e.y)}function Qo(e,t,n){return e>t?n:1+n%4}function $o(e,t,n){let r=Ko(e),i=qo(e),a=Ko(t),o=qo(t);if(Zo(e,t))return n.x0=r,n.y0=i,n.x1=a,n.y1=o,!0;let s=e.x,c=e.y,l=q(e),u=e.x,d=J(e),f=q(e),p=e.width/2,m=e.height/2,h=t.x,g=t.y,_=q(t),v=t.x,y=J(t),b=q(t),x=t.width/2,S=t.height/2,C=!1,w=!1;if(r===a){if(i>o)return n.x0=r,n.y0=c,n.x1=a,n.y1=y,!1;if(i<o)return n.x0=r,n.y0=d,n.x1=a,n.y1=g,!1}else if(i===o){if(r>a)return n.x0=s,n.y0=i,n.x1=_,n.y1=o,!1;if(r<a)return n.x0=l,n.y0=i,n.x1=h,n.y1=o,!1}else{let T=e.height/e.width,E=t.height/t.width,D=(o-i)/(a-r);if(-T===D?(r>a?(n.x0=u,n.y0=d):(n.x0=l,n.y0=c),C=!0):T===D&&(r>a?(n.x0=s,n.y0=c):(n.x0=f,n.y0=d),C=!0),-E===D?(a>r?(n.x1=v,n.y1=y):(n.x1=_,n.y1=g),w=!0):E===D&&(a>r?(n.x1=h,n.y1=g):(n.x1=b,n.y1=y),w=!0),C&&w)return!1;let O,k;if(r>a?i>o?(O=Qo(T,D,4),k=Qo(E,D,2)):(O=Qo(-T,D,3),k=Qo(-E,D,1)):i>o?(O=Qo(-T,D,1),k=Qo(-E,D,3)):(O=Qo(T,D,2),k=Qo(E,D,4)),!C)switch(O){case 1:n.y0=c,n.x0=r+-m/D;break;case 2:n.x0=f,n.y0=i+p*D;break;case 3:n.y0=d,n.x0=r+m/D;break;case 4:n.x0=u,n.y0=i+-p*D}if(!w)switch(k){case 1:n.y1=g,n.x1=a+-S/D;break;case 2:n.x1=b,n.y1=o+x*D;break;case 3:n.y1=y,n.x1=a+S/D;break;case 4:n.x1=v,n.y1=o+-x*D}}return!1}function es(e,t,n){let r=Ko(e)<Ko(t)?-1:1,i=qo(e)<qo(t)?-1:1,a=Math.min(q(e),q(t))-Math.max(e.x,t.x),o=Math.min(J(e),J(t))-Math.max(e.y,t.y);e.x<=t.x&&q(e)>=q(t)?a+=Math.min(t.x-e.x,q(e)-q(t)):t.x<=e.x&&q(t)>=q(e)&&(a+=Math.min(e.x-t.x,q(t)-q(e))),e.y<=t.y&&J(e)>=J(t)?o+=Math.min(t.y-e.y,J(e)-J(t)):t.y<=e.y&&J(t)>=J(e)&&(o+=Math.min(e.y-t.y,J(t)-J(e)));let s=Math.abs((qo(t)-qo(e))/(Ko(t)-Ko(e)));qo(t)===qo(e)&&Ko(t)===Ko(e)&&(s=1);let c=s*a,l=o/s;return a<l?l=a:c=o,{x:-1*r*(l/2+n),y:-1*i*(c/2+n)}}function ts(e){let t=e.slice(),n=[],r=new Map,i;(t.length===1||t.length===2)&&(i=t[0]);for(let e of t){let t=Xo(e).size;r.set(e,t),t===1&&n.push(e)}let a=n.slice();for(;i===void 0;){a=[];for(let e=0;e<t.length;e++){let i=t[e];if(i===void 0)break;let o=t.indexOf(i);o>=0&&t.splice(o,1);for(let e of Xo(i))if(n.indexOf(e)<0){let t=(r.get(e)??0)-1;t===1&&a.push(e),r.set(e,t)}}n=n.concat(a),(t.length===1||t.length===2)&&(i=t[0])}return i}function ns(e,t,n,r,i,a){let o=(r-n+1)/2;o<0&&(o+=180);let s=(o+n)%360*Uo/360,c=i*Math.cos(s),l=i*Math.sin(s);e.x=c-e.width/2,e.y=l-e.height/2;let u=e.edges.slice(),d=u.length;t!==null&&d--;let f=u.length,p=0;if(t!==null){let e=u.find(e=>e.source===t||e.target===t);p=e===void 0?0:(u.indexOf(e)+1)%f}let m=Math.abs(r-n)/d,h=0;for(let r=p;h!==d;r=(r+1)%f){let o=u[r];if(o===void 0)break;let s=Yo(o,e);if(s===t)continue;let c=(n+h*m)%360;ns(s,e,c,(c+m)%360,i+a,a),h++}}function rs(e){let t=Go,n=-2147483647,r=Go,i=-2147483647;for(let a of e)t>a.x&&(t=a.x),n<q(a)&&(n=q(a)),r>a.y&&(r=a.y),i<J(a)&&(i=J(a));return{x:t,y:r,width:n-t,height:i-r}}function is(e,t,n){let r=Go,i=Go;for(let t of e)r>t.y&&(r=t.y),i>t.x&&(i=t.x);let a=i-zo,o=r-zo;for(let r of e)r.x=t+(r.x-a),r.y=n+(r.y-o)}function as(e){let t=ts(e),n=Wo;for(let t of e){let e=Math.sqrt(t.width*t.width+t.height*t.height);e>n&&(n=e)}ns(t,null,0,359,0,Math.max(n,Ho));let r=rs(e);for(let t of e)t.x=0+(t.x-r.x),t.y=0+(t.y-r.y);let i=0+(r.x+r.width-r.x),a=0+(r.y+r.height-r.y);is(e,Bo-i/2,Vo-a/2)}function os(e,t,n){let r=e[t]?.[n];if(r===void 0)throw Error(`cose-bilkent: grid index out of range`);return r}function ss(e){let t=Go,n=-2147483647,r=Go,i=-2147483647;for(let a of e.nodes)t>a.x&&(t=a.x),n<q(a)&&(n=q(a)),r>a.y&&(r=a.y),i<J(a)&&(i=J(a));let a=t,o=r,s=n-t,c=i-r,l=a-zo,u=a+s+zo,d=o-zo,f=o+c+zo,p=e.repulsionRange,m=Math.ceil((u-l)/p),h=Math.ceil((f-d)/p),g=[];for(let e=0;e<m;e++){let e=[];for(let t=0;t<h;t++)e.push([]);g.push(e)}e.grid=g;for(let t of e.nodes){let e=Math.floor((t.x-l)/p),n=Math.floor((t.width+t.x-l)/p),r=Math.floor((t.y-d)/p),i=Math.floor((t.height+t.y-d)/p);for(let a=e;a<=n;a++)for(let o=r;o<=i;o++)os(g,a,o).push(t),t.startX=e,t.finishX=n,t.startY=r,t.finishY=i}}function cs(e,t){e.overlapping=$o(e.target,e.source,t),e.overlapping||(e.lengthX=t.x0-t.x1,e.lengthY=t.y0-t.y1,Math.abs(e.lengthX)<1&&(e.lengthX=Jo(e.lengthX)),Math.abs(e.lengthY)<1&&(e.lengthY=Jo(e.lengthY)),e.length=Math.sqrt(e.lengthX*e.lengthX+e.lengthY*e.lengthY))}function ls(e,t){for(let n of e.edges){if(cs(n,t),n.overlapping)continue;let e=n.length;if(e===0)continue;let r=Mo*(e-jo),i=r*(n.lengthX/e),a=r*(n.lengthY/e);n.source.springForceX+=i,n.source.springForceY+=a,n.target.springForceX-=i,n.target.springForceY-=a}}function us(e,t,n){if(Zo(e,t)){let n=es(e,t,jo/2),r=2*n.x,i=2*n.y,a=1/2;e.repulsionForceX-=a*r,e.repulsionForceY-=a*i,t.repulsionForceX+=a*r,t.repulsionForceY+=a*i}else{$o(e,t,n);let r=n.x1-n.x0,i=n.y1-n.y0;Math.abs(r)<Fo&&(r=Jo(r)*Fo),Math.abs(i)<Fo&&(i=Jo(i)*Fo);let a=r*r+i*i,o=Math.sqrt(a),s=Ao*1*1/a,c=s*r/o,l=s*i/o;e.repulsionForceX-=c,e.repulsionForceY-=l,t.repulsionForceX+=c,t.repulsionForceY+=l}}function ds(e,t,n){let r=t%Lo===1;r&&ss(e);let i=new Set;for(let t of e.nodes){if(r){let n=new Set,r=e.grid;for(let a=t.startX-1;a<t.finishX+2;a++)for(let o=t.startY-1;o<t.finishY+2;o++){let s=r[a],c=s===void 0?void 0:s[o];if(!(a<0||o<0||c===void 0)){for(let r of c)if(t!==r&&!i.has(r)&&!n.has(r)){let i=Math.abs(Ko(t)-Ko(r))-(t.width/2+r.width/2),a=Math.abs(qo(t)-qo(r))-(t.height/2+r.height/2);i<=e.repulsionRange&&a<=e.repulsionRange&&n.add(r)}}}t.surrounding=[...n]}for(let e of t.surrounding)us(t,e,n);i.add(t)}}var fs=[1,2.6721379557162637,4.74848763464932,7.140321254379494,9.797958971132713,12.688614040795791,15.788627053658772,19.07992343983501,22.548134816417495,26.181498055314396,29.970162105620904,33.905727183844746,37.98092508439659,42.189389618730246,46.52548701922506,50.984187615743544,55.56096674434149,60.25172687355656,65.05273546109957,69.96057469111715,74.9721003323884,80.08440770139889,85.29480323234884,90.60078052411225,96.00000000000003];function ps(e,t){return fs[e-1]??e**+t}function ms(e,t){let n=0,r=t*Po;for(let i of e){let e=t*(i.springForceX+i.repulsionForceX)/1,a=t*(i.springForceY+i.repulsionForceY)/1;Math.abs(e)>r&&(e=r*Jo(e)),Math.abs(a)>r&&(a=r*Jo(a)),i.x+=e,i.y+=a,n+=Math.abs(e)+Math.abs(a),i.springForceX=0,i.springForceY=0,i.repulsionForceX=0,i.repulsionForceY=0}return n}function hs(e,t){let n=new Map;if(e.length===0)return n;let r=new Map,i=e.map(e=>{let t={id:e.id,x:0-e.width/2,y:0-e.height/2,width:e.width,height:e.height,edges:[],springForceX:0,springForceY:0,repulsionForceX:0,repulsionForceY:0,startX:0,finishX:0,startY:0,finishY:0,surrounding:[]};return r.set(e.id,t),t}),a=[];for(let e of t){let t=r.get(e.source),n=r.get(e.target);if(t===void 0||n===void 0)throw Error(`cose-bilkent: edge ${e.source}->${e.target} references an unknown node`);if(t===n||t.edges.some(e=>e.source===n||e.target===n))continue;let i={source:t,target:n,lengthX:0,lengthY:0,length:0,overlapping:!1};t.edges.push(i),n.edges.push(i),a.push(i)}let o=i[0];if(o===void 0)return n;let s=new Set,c=new Map,l=[o];for(;l.length>0;){let e=l.shift();if(e===void 0)break;s.add(e);for(let t of e.edges){let n=Yo(t,e);if(c.get(e)!==n){if(s.has(n))throw Error(`cose-bilkent: input graph contains a cycle`);l.push(n),c.set(n,e)}}}if(s.size!==i.length)throw Error(`cose-bilkent: input graph must be a single tree`);as([...s]);let u=i.length,d=Math.max(u*5,No),f=Ro*u,p=No/Io,m=Io/No,h={nodes:i,edges:a,repulsionRange:100,grid:[]},g={x0:0,y0:0,x1:0,y1:0},_=1,v=0,y=0,b=0,x=0;for(;y++,y!==d;){if(y%Io===0){let e=!1;y>d/3&&(e=Math.abs(b-x)<2);let t=b<f;if(x=b,t||e)break;v++,_=Math.max(1-ps(v,Math.log(96)/Math.log(p))/100*1,m)}ls(h,g),ds(h,y,g),b=ms(i,_)}is(i,0,0);for(let e of i)n.set(e.id,{x:e.x+e.width/2,y:e.y+e.height/2});return n}var gs={padding:10,maxNodeWidth:200,fontSize:16,lineHeight:24,sections:11,edgeInset:15,cornerRadius:5},_s=e=>String(Math.round(e*1e4)/1e4);function vs(e){return k(e.text,gs.fontSize,e.bold?700:400)}function ys(e){return e.reduce((e,t)=>e+vs(t),0)}function bs(e,t){let n=e.flatMap(e=>(e.text.match(/\s+|\S+/g)??[]).map(t=>({...e,text:t}))),r=e=>/^\s/.test(e.text),i=[[]],a=0;for(let e=0;e<n.length;){if(r(n[e])){i[i.length-1].push(n[e]),a+=vs(n[e]),e++;continue}let o=[];for(;e<n.length&&!r(n[e]);)o.push(n[e++]);let s=ys(o),c=i[i.length-1];a+s>t&&c.some(e=>!r(e))&&(i.push([]),a=0),i[i.length-1].push(...o),a+=s}return i}function xs(e){let n=(0,t.mindmapLabelLines)(e),r=Math.max(...n.map(ys));if(r<gs.maxNodeWidth)return{lines:n,width:r,height:n.length*gs.lineHeight};let i=n.flatMap(e=>bs(e,gs.maxNodeWidth));return{lines:i,width:gs.maxNodeWidth,height:i.length*gs.lineHeight}}function Ss(e,t,n,r,i,a,o,s,c,l){let u=(e,t)=>{l.minX=Math.min(l.minX,e),l.maxX=Math.max(l.maxX,e),l.minY=Math.min(l.minY,t),l.maxY=Math.max(l.maxY,t)};u(s,c);let d=Math.abs(n),f=Math.abs(r);if(d===0||f===0||e===s&&t===c)return;let p=i*Math.PI/180,m=Math.cos(p),h=Math.sin(p),g=(e-s)/2,_=(t-c)/2,v=m*g+h*_,y=-h*g+m*_,b=v*v/(d*d)+y*y/(f*f);if(b>1){let e=Math.sqrt(b);d*=e,f*=e}let x=d*d*f*f-d*d*y*y-f*f*v*v,S=d*d*y*y+f*f*v*v,C=(a===o?-1:1)*Math.sqrt(Math.max(0,x/S)),w=C*d*y/f,T=-C*f*v/d,E=m*w-h*T+(e+s)/2,D=h*w+m*T+(t+c)/2,O=(e,t,n,r)=>Math.atan2(e*r-t*n,e*n+t*r),k=O(1,0,(v-w)/d,(y-T)/f),A=O((v-w)/d,(y-T)/f,(-v-w)/d,(-y-T)/f);!o&&A>0?A-=2*Math.PI:o&&A<0&&(A+=2*Math.PI);let ee=Math.atan2(-f*h,d*m),te=Math.atan2(f*m,d*h);for(let e of[ee,ee+Math.PI,te,te+Math.PI]){let t=e,n=Math.min(k,k+A),r=Math.max(k,k+A);for(;t<n;)t+=2*Math.PI;for(;t-2*Math.PI>=n;)t-=2*Math.PI;t>r||u(E+d*Math.cos(t)*m-f*Math.sin(t)*h,D+d*Math.cos(t)*h+f*Math.sin(t)*m)}}function Cs(e){let t={minX:0,minY:0,maxX:0,maxY:0},n=0,r=0;for(let[i,a,o,s,c,l,u]of e)Ss(n,r,i,a,o,s,c,n+l,r+u,t),n+=l,r+=u;return t}function ws(e){return`M0 0 `+e.map(e=>`a${e[0]},${e[1]} ${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`).join(` `)+` H0 V0 Z`}function Ts(e,t){let n=.15*e,r=.25*e,i=.35*e,a=.2*e;return[[n,n,0,0,1,e*.25,-e*.1],[i,i,1,0,1,e*.4,-e*.1],[r,r,1,0,1,e*.35,e*.2],[n,n,1,0,1,e*.15,t*.35],[a,a,1,0,1,-e*.15,t*.65],[r,n,1,0,1,-e*.25,e*.15],[i,i,1,0,1,-e*.5,0],[n,n,1,0,1,-e*.25,-e*.15],[n,n,1,0,1,-e*.1,-t*.35],[a,a,1,0,1,e*.1,-t*.65]]}function Es(e,t){let n=.15*e,r=n*.8;return[[n,n,1,0,0,e*.25,-t*.1],[n,n,1,0,0,e*.25,0],[n,n,1,0,0,e*.25,0],[n,n,1,0,0,e*.25,t*.1],[n,n,1,0,0,e*.15,t*.33],[r,r,1,0,0,0,t*.34],[n,n,1,0,0,-e*.15,t*.33],[n,n,1,0,0,-e*.25,t*.15],[n,n,1,0,0,-e*.25,0],[n,n,1,0,0,-e*.25,0],[n,n,1,0,0,-e*.25,-t*.15],[n,n,1,0,0,-e*.1,-t*.33],[r,r,1,0,0,0,-t*.34],[n,n,1,0,0,e*.1,-t*.33]]}function Ds(e,t,n){let r=gs.padding,i=r/2;switch(e){case`circle`:{let e=Math.hypot(t,n)/2+r;return{width:2*e,height:2*e,boxX:-e,boxY:-e,radius:e}}case`rect`:{let e=t+4*r,i=n+2*r;return{width:e,height:i,boxX:-e/2,boxY:-i/2,rect:{width:e,height:i,radius:0}}}case`rounded`:{let e=t+3*r,i=n+3*r;return{width:e,height:i,boxX:-e/2,boxY:-i/2,rect:{width:e,height:i,radius:gs.cornerRadius}}}case`hexagon`:{let e=n+2*r,i=e/4,a=t+2*i+2*r;return{width:a,height:e,boxX:-a/2,boxY:-e/2,points:[[i,0],[a-i,0],[a,-e/2],[a-i,-e],[i,-e],[0,-e/2]].map(([t,n])=>`${_s(t-a/2)},${_s(n+e/2)}`).join(` `)}}case`cloud`:{let e=t+2*i,r=n+2*i,a=Ts(e,r),o=Cs(a);return{width:o.maxX-o.minX,height:o.maxY-o.minY,boxX:-e/2+o.minX,boxY:-r/2+o.minY,path:Os(a,-e/2,-r/2)}}case`bang`:{let e=t+10*i,r=n+8*i,a=Math.max(e,t+20),o=Math.max(r,n+20),s=Es(a,o),c=Cs(s);return{width:c.maxX-c.minX,height:c.maxY-c.minY,boxX:-a/2+c.minX,boxY:-o/2+c.minY,path:Os(s,-a/2,-o/2)}}default:{let e=gs.cornerRadius,r=t+8*i,a=n+2*i;return{width:r,height:a,boxX:-r/2,boxY:-a/2,underline:!0,path:`M${_s(-r/2)} ${_s(a/2-e)} v${_s(-a+2*e)} q0,${-e} ${e},${-e} h${_s(r-2*e)} q${e},0 ${e},${e} v${_s(a-2*e)} q0,${e} ${-e},${e} h${_s(-(r-2*e))} q${-e},0 ${-e},${-e} Z`}}}}function Os(e,t,n){return ws(e).replace(`M0 0`,`M${_s(t)} ${_s(n)}`)}function ks(e){let t=e=>_s(e),[n,r,i]=e,a=(e,n,r,i,a)=>`${t((r*e[0]+i*n[0])/a)},${t((r*e[1]+i*n[1])/a)}`;return`M${t(n[0])},${t(n[1])}L${a(n,r,5,1,6)}C${a(n,r,2,1,3)},${a(n,r,1,2,3)},${((e,n,r)=>`${t((e[0]+4*n[0]+r[0])/6)},${t((e[1]+4*n[1]+r[1])/6)}`)(n,r,i)}C${a(r,i,2,1,3)},${a(r,i,1,2,3)},${a(r,i,1,5,6)}L${t(i[0])},${t(i[1])}`}function As(e){let t=[],n=new Map,r=(e,i)=>{t.push(e),n.set(e.id,i),e.children.forEach((t,n)=>r(t,e.level===0?n%gs.sections:i))};r(e.root,void 0);let i=t.map(e=>{let t=xs(e.text),r=Ds(e.shape,t.width,t.height);return{node:e,section:n.get(e.id),x:0,y:0,width:r.width,height:r.height,boxX:r.boxX,boxY:r.boxY,lines:t.lines,labelWidth:t.width,labelHeight:t.height,...r.path===void 0?{}:{path:r.path},...r.points===void 0?{}:{points:r.points},...r.radius===void 0?{}:{radius:r.radius},...r.rect===void 0?{}:{rect:r.rect},...r.underline?{underline:!0}:{}}}),a=hs(i.map(e=>({id:String(e.node.id),width:e.width,height:e.height})),t.flatMap(e=>e.children.map(t=>({source:String(e.id),target:String(t.id)}))));for(let e of i){let t=a.get(String(e.node.id));e.x=t.x,e.y=t.y}let o=[];for(let e of i)for(let t of e.node.children){let n=i[t.id],r=n.x-e.x,a=n.y-e.y,s=Math.hypot(r,a)||1,c=gs.edgeInset,l=[e.x+r/s*c,e.y+a/s*c],u=[n.x-r/s*c,n.y-a/s*c];o.push({from:e.node.id,to:t.id,section:n.section,depth:e.node.level+1,path:ks([l,[(l[0]+u[0])/2,(l[1]+u[1])/2],u])})}let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let e of i)s=Math.min(s,e.x+e.boxX),c=Math.min(c,e.y+e.boxY),l=Math.max(l,e.x+e.boxX+e.width),u=Math.max(u,e.y+e.boxY+e.height);let d=gs.padding;return{originX:s-d,originY:c-d,width:l-s+2*d,height:u-c+2*d,nodes:i,edges:o}}var js=e=>String(Math.round(e*100)/100);function Ms(e){return e===void 0?``:e.split(/\s+/).filter(e=>/^[A-Za-z_][\w-]*$/.test(e)).map(e=>` ${e}`).join(``)}function Ns(t,n,r){let i=new Set;for(let e of t.nodes)e.section!==void 0&&i.add(e.section);let a=[...i].sort((e,t)=>e-t),o=a.map(e=>` --mm-color-${e}: ${vo(e,n.accent,n.bg)};`),s=a.map(e=>` .mm-s${e} .mm-shape { fill: color-mix(in srgb, var(--mm-color-${e}) 32%, var(--bg)); }\n .mm-s${e} .mm-underline { stroke: var(--mm-color-${e}); }\n .mm-edge.mm-s${e} { stroke: var(--mm-color-${e}); }`),c=(0,e.paletteClass)(o);return{css:`${(0,e.styleOpenTag)(r)}
|
|
109
|
+
.mm-edge { fill: none; }
|
|
110
|
+
.mm-shape { stroke: none; }
|
|
111
|
+
.mm-underline { stroke-width: 3px; }
|
|
112
|
+
.mm-root .mm-shape { fill: var(--fg); }
|
|
113
|
+
.mm-label { fill: var(--_text); font-size: ${gs.fontSize}px; font-weight: 400; text-anchor: middle; }
|
|
114
|
+
.mm-root .mm-label { fill: var(--bg); }
|
|
115
|
+
.mm-bold { font-weight: 700; }
|
|
116
|
+
.mm-italic { font-style: italic; }
|
|
117
|
+
.${c} {
|
|
118
|
+
${o.join(`
|
|
119
|
+
`)}
|
|
120
|
+
}
|
|
121
|
+
${s.join(`
|
|
122
|
+
`)}
|
|
123
|
+
</style>`,cls:c}}function Ps(t){let n=-t.labelHeight/2;return t.lines.map((t,r)=>{let i=n+gs.lineHeight*(r+.5),a=t.map(t=>{let n=`${t.bold?`mm-bold`:``}${t.bold&&t.italic?` `:``}${t.italic?`mm-italic`:``}`,r=(0,e.escapeXml)(t.text);return n===``?r:`<tspan class="${n}">${r}</tspan>`}).join(``);return`<text x="0" y="${js(i)}" dy="0.35em" class="mm-label" xml:space="preserve">${a.trim()}</text>`}).join(``)}function Fs(e){let t=`mm-node ${e.section===void 0?`mm-root`:`mm-s${e.section}`} mm-${e.node.shape}${Ms(e.node.className)}`,n=``;if(e.radius!==void 0)n=`<circle class="mm-shape" r="${js(e.radius)}" cx="0" cy="0"/>`;else if(e.rect!==void 0){let{width:t,height:r,radius:i}=e.rect;n=`<rect class="mm-shape"${i?` rx="${i}" ry="${i}"`:``} x="${js(-t/2)}" y="${js(-r/2)}" width="${js(t)}" height="${js(r)}"/>`}else e.points===void 0?e.path!==void 0&&(n=`<path class="mm-shape" d="${e.path}"/>`):n=`<polygon class="mm-shape" points="${e.points}"/>`;if(e.underline){let t=e.width/2,r=e.height/2;n+=`<line class="mm-underline" x1="${js(-t)}" y1="${js(r)}" x2="${js(t)}" y2="${js(r)}"/>`}return`<g class="${t}" data-id="node_${e.node.id}" transform="translate(${js(e.x)}, ${js(e.y)})">`+n+Ps(e)+`</g>`}function Is(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=Ns(t,n,c.nonce);l.push(Cr((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u),l.push(`<g transform="translate(${js(-t.originX)}, ${js(-t.originY)})">`),l.push(`<g class="mm-edges">`);for(let e of t.edges){let t=17-3*(e.depth+1);l.push(`<path d="${e.path}" class="mm-edge ${e.section===void 0?``:`mm-s${e.section}`}" stroke-width="${t>0?t:3}" data-edge="edge_${e.from}_${e.to}"/>`)}l.push(`</g>`),l.push(`<g class="mm-nodes">`);for(let e of t.nodes)l.push(Fs(e));return l.push(`</g></g></svg>`),l.join(`
|
|
124
|
+
`)}var Ls=2048,Rs=[617,752,665,1074,1074,1229,1446,327,752,752,752,1074,752,752,752,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,752,752,1074,1074,1074,752,1578,1208,1159,1225,1256,1097,1075,1385,1340,570,976,1179,1037,1453,1307,1380,1142,1384,1192,985,1189,1328,1203,1745,1140,1168,1127,752,728,752,1074,1074,1074,1076,1141,1014,1141,1117,757,1028,1119,584,751,1033,604,1700,1119,1099,1141,1141,796,829,812,1119,1003,1524,1026,1010,972,752,1074,752,1074],zs=[617,752,751,1200,1200,1401,1446,470,752,752,885,1200,752,752,752,799,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,752,752,1200,1200,1200,897,1578,1297,1219,1253,1316,1165,1195,1375,1400,570,1091,1264,1132,1526,1367,1440,1202,1452,1251,1047,1253,1388,1273,1810,1230,1256,1147,823,728,823,1200,1200,1200,1091,1191,1048,1189,1177,757,1028,1214,611,751,1122,604,1760,1209,1159,1193,1196,875,882,812,1210,1080,1605,1131,1093,1082,888,1200,888,1200];function Bs(e,t){let n=e.charCodeAt(0)-32;if(!(e.length!==1||n<0||n>=Rs.length))return(t?zs:Rs)[n]/Ls}var Vs={fontSize:16,lineHeight:17.6,firstLineHeight:19,textPad:8.8,nodeWidth:150,padding:20,leftMargin:150,columnWidth:200,eventGap:10,periodFloor:67.8,eventFloor:50,titleFontSize:33.4688,titleAscent:31,titleDescent:7,viewBoxPadding:50,colorLimit:12};function Hs(e,t=16,n=!1){let r=0;for(let t of e){let e=Bs(t,n);r+=e??((t.codePointAt(0)??0)>=11904?1:.6)}return r*t}function Us(e,t){let n=e.split(/(\s+|<br>)/),r=[],i=[],a=``;for(let e of n){i.push(e);let n=i.join(` `).trim();Hs(n.replace(/\s+/g,` `))>t||e===`<br>`?(i.pop(),r.push(i.join(` `).trim()),i=e===`<br>`?[``]:[e],a=e):a=n}return r.push(a),r.map(e=>e.replace(/\s+/g,` `))}function Ws(e){return e.filter(e=>e!==``).length}function Gs(e,t=Vs.padding){return(e===0?0:Vs.firstLineHeight+(e-1)*Vs.lineHeight)+Vs.textPad+t}function Ks(e,t,n=Vs.padding){return Gs(Ws(Us(e,t)),n)}function qs(e){return e!==void 0&&e>=0&&e<=1e5?e:void 0}function Js(e){return e%Vs.colorLimit-1}function Ys(e,t,n,r,i){return e?{x1:Math.min(e.x1,t),y1:Math.min(e.y1,n),x2:Math.max(e.x2,r),y2:Math.max(e.y2,i)}:{x1:t,y1:n,x2:r,y2:i}}function Xs(e){let{periods:t,sections:n}=e,r={...Vs,leftMargin:qs(e.config?.leftMargin)??Vs.leftMargin,viewBoxPadding:qs(e.config?.padding)??Vs.viewBoxPadding},i=!e.config?.disableMulticolor,a=n.length>0,o=[],s=[],c=0;for(let e of n)c=Math.max(c,Ks(e,r.nodeWidth)+r.padding);let l=t.length>0?r.periodFloor:0,u=0;for(let e of t){let t=0;for(let n of e.events)t+=Ks(n,r.nodeWidth);e.events.length>0&&(t+=(e.events.length-1)*r.eventGap),u=Math.max(u,t)}let d,f=(e,t)=>{o.push(e),d=Ys(d,e.x,e.y,e.x+e.width,e.y+e.height);for(let n of e.lines){let r=Hs(n);d=Ys(d,e.x+t/2-r/2,e.y,e.x+t/2+r/2,e.y)}},p=(e,t,n,i,a)=>{let o=t,c=i,p=l;for(let t of e){let e=Us(t.label,r.nodeWidth),i=Math.max(Gs(Ws(e)),p);p=Math.max(p,i),f({kind:`period`,x:o,y:n,width:r.nodeWidth+2*r.padding,height:i,lines:e,colorClass:Js(c),padding:r.padding},r.nodeWidth+2*r.padding);let l=n+200;for(let e of t.events){let t=Us(e,r.nodeWidth),n=Math.max(Gs(Ws(t)),r.eventFloor);f({kind:`event`,x:o,y:l,width:r.nodeWidth+2*r.padding,height:n,lines:t,colorClass:Js(c),padding:r.padding},r.nodeWidth+2*r.padding),l+=r.eventGap+n}let m=o+95,h={x1:m,y1:n+p,x2:m,y2:n+p+100+u+100};s.push(h),d=Ys(d,h.x1,h.y1,h.x2,h.y2),o+=r.columnWidth,a&&c++}},m=50+r.leftMargin;if(a){let e=m;n.forEach((n,i)=>{let a=t.filter(e=>e.section===n),o=Math.max(a.length,1),s=Us(n,r.columnWidth*o-50);f({kind:`section`,x:e,y:50,width:r.columnWidth*o-50+2*r.padding,height:Math.max(Gs(Ws(s)),c),lines:s,colorClass:Js(i),padding:r.padding},r.columnWidth*o-50+2*r.padding),p(a,e,100+c,i,!1),e+=r.columnWidth*o})}else p(t,m,50,0,i);let h=d?d.x2-d.x1:0,g=a?c+l+150:l+100;return Zs(e,o,s,{x1:r.leftMargin,y1:g,x2:h+3*r.leftMargin,y2:g},h)}function Zs(e,t,n,r,i){let a={...Vs,leftMargin:qs(e.config?.leftMargin)??Vs.leftMargin,viewBoxPadding:qs(e.config?.padding)??Vs.viewBoxPadding},o;for(let e of t){o=Ys(o,e.x,e.y,e.x+e.width,e.y+e.height);for(let t of e.lines){let n=Hs(t);o=Ys(o,e.x+e.width/2-n/2,e.y,e.x+e.width/2+n/2,e.y)}}for(let e of n)o=Ys(o,e.x1,e.y1,e.x2,e.y2);o=Ys(o,r.x1,r.y1,r.x2,r.y2);let s;if(e.title){let t=i/2-a.leftMargin;s={text:e.title,x:t,y:20,fontSize:a.titleFontSize};let n=Hs(e.title,a.titleFontSize,!0);o=Ys(o,t,20-a.titleAscent,t+n,20+a.titleDescent)}let c=o.x1-a.viewBoxPadding,l=o.y1-a.viewBoxPadding,u=e=>({...e,x:e.x-c,y:e.y-l});return{direction:e.direction,width:o.x2-o.x1+2*a.viewBoxPadding,height:o.y2-o.y1+2*a.viewBoxPadding,...s?{title:u(s)}:{},nodes:t.map(u),connectors:n.map(e=>({x1:e.x1-c,y1:e.y1-l,x2:e.x2-c,y2:e.y2-l})),axis:{x1:r.x1-c,y1:r.y1-l,x2:r.x2-c,y2:r.y2-l}}}var Y={nodeWidth:200,padding:5,eventWidth:300,eventGap:10,sectionTaskGap:20,taskAxisGap:20,taskVerticalGap:30,eventAxisGap:50,axisTopOffset:32,axisBottomPadding:28};function Qs(e){let{periods:t,sections:n}=e,r={...Vs,leftMargin:qs(e.config?.leftMargin)??Vs.leftMargin,viewBoxPadding:qs(e.config?.padding)??Vs.viewBoxPadding},i=!e.config?.disableMulticolor,a=[],o=[],s=n.length>0,c=Y.nodeWidth+2*Y.padding,l=Y.eventWidth+2*Y.padding,u=c+Y.taskAxisGap,d=l+Y.eventAxisGap,f=50+r.leftMargin+u,p=Math.max(50,u+d-2*Y.padding),m=(e,t)=>Ks(e,t,Y.padding),h=0;for(let e of n)h=Math.max(h,m(e,p));let g=t.length>0?Gs(1,Y.padding):0,_=0;for(let e of t){let t=0;for(let n of e.events)t+=m(n,Y.eventWidth);e.events.length>0&&(t+=(e.events.length-1)*Y.eventGap),_=Math.max(_,t)}let v=Math.max(g,_)+Y.taskVerticalGap,y=(e,t,n,r)=>{let i=t,s=n,u=g;for(let t of e){let e=Us(t.label,Y.nodeWidth),n=Math.max(Gs(Ws(e),Y.padding),u);u=Math.max(u,n),a.push({kind:`period`,x:f-Y.taskAxisGap-c,y:i,width:c,height:n,lines:e,colorClass:Js(s),padding:Y.padding});let d=i;for(let e of t.events){let t=Us(e,Y.eventWidth),n=Gs(Ws(t),Y.padding),r=f+Y.eventAxisGap;a.push({kind:`event`,x:r,y:d,width:l,height:n,lines:t,colorClass:Js(s),padding:Y.padding}),o.push({x1:f,y1:d+n/2,x2:r,y2:d+n/2}),d+=n+Y.eventGap}i+=v,r&&s++}},b=50;s?n.forEach((e,n)=>{let r=t.filter(t=>t.section===e),i=Us(e,p),o=Math.max(Gs(Ws(i),Y.padding),h);a.push({kind:`section`,x:f-u,y:b,width:p+2*Y.padding,height:o,lines:i,colorClass:Js(n),padding:Y.padding}),y(r,b+o+Y.sectionTaskGap,n,!1),b+=o+Y.sectionTaskGap+v*Math.max(r.length,1)-(r.length>0?Y.taskVerticalGap*2:0)}):y(t,b,0,i);let x;for(let e of a){x=Ys(x,e.x,e.y,e.x+e.width,e.y+e.height);for(let t of e.lines){let n=Hs(t);x=Ys(x,e.x+e.width/2-n/2,e.y,e.x+e.width/2+n/2,e.y)}}for(let e of o)x=Ys(x,e.x1,e.y1,e.x2,e.y2);let S=x?x.x2-x.x1:0,C=x?x.y2:0;return Zs(e,a,o,{x1:f,y1:50-Y.axisTopOffset,x2:f,y2:(x?C:0)+Y.axisBottomPadding},S)}function $s(e){return e.direction===`TD`?Qs(e):Xs(e)}function X(e){return String(Math.round(e*100)/100)}function ec(t,n,r){let i=[...new Set(t.nodes.map(e=>e.colorClass))].sort((e,t)=>e-t),a=i.map(e=>` --timeline-color-${e+1}: ${vo(e+1,n.accent,n.bg)};`),o=i.map(e=>` .section-${e} path { fill: color-mix(in srgb, var(--timeline-color-${e+1}) 30%, var(--bg)); }\n .section-${e} line { stroke: var(--timeline-color-${e+1}); stroke-width: 3; }`),s=(0,e.paletteClass)(a);return{css:`${(0,e.styleOpenTag)(r)}
|
|
125
|
+
.timeline-node text { fill: var(--_text); font-size: 16px; }
|
|
126
|
+
.timeline-title { fill: var(--_text); font-weight: bold; }
|
|
127
|
+
.lineWrapper line { stroke: var(--fg); }
|
|
128
|
+
.timeline-arrow { fill: var(--fg); stroke: var(--fg); }${a.length>0?`\n .${s} {\n${a.join(`
|
|
129
|
+
`)}\n }`:``}
|
|
130
|
+
${o.join(`
|
|
131
|
+
`)}
|
|
132
|
+
</style>`,cls:s}}function tc(t,n){let{width:r,height:i}=t,a=`M0 ${X(i-5)} v${X(-i+10)} q0,-5,5,-5 h${X(r-10)} q5,0,5,5 v${X(i-5)} H0 Z`,o=t.lines.map((t,n)=>`<tspan x="0" dy="${n===0?`1em`:`1.1em`}">${(0,e.escapeXml)(t)}</tspan>`).join(``);return`<g class="${n}" transform="translate(${X(t.x)}, ${X(t.y)})"><g class="timeline-node section-${t.colorClass}"><g><path class="node-bkg" d="${a}"/><line class="node-line-${t.colorClass}" x1="0" y1="${X(i)}" x2="${X(r)}" y2="${X(i)}"/></g><g transform="translate(${X(r/2)}, ${X(t.padding/2)})"><text dy="1em" alignment-baseline="middle" dominant-baseline="middle" text-anchor="middle">${o}</text></g></g></g>`}function nc(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[],{css:u,cls:d}=ec(t,n,c.nonce);l.push(Cr((0,e.withRootClass)((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),d),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(u);let f=t.direction===`LR`;f&&l.push(`<defs><marker id="timeline-arrowhead" refX="5" refY="2" markerWidth="6" markerHeight="4" orient="auto"><path class="timeline-arrow" d="M 0,0 V 4 L6,2 Z"/></marker></defs>`);for(let e of t.nodes)l.push(tc(e,e.kind===`section`?`sectionWrapper`:e.kind===`period`?`taskWrapper`:`eventWrapper`));let p=f?` marker-end="url(#timeline-arrowhead)"`:``;for(let e of t.connectors)l.push(`<g class="lineWrapper"><line x1="${X(e.x1)}" y1="${X(e.y1)}" x2="${X(e.x2)}" y2="${X(e.y2)}" stroke-width="2"${p} stroke-dasharray="5,5"/></g>`);t.title&&l.push(`<text x="${X(t.title.x)}" y="${X(t.title.y)}" font-size="${t.title.fontSize}" font-weight="bold" class="timeline-title">${(0,e.escapeXml)(t.title.text)}</text>`);let m=t.axis;return l.push(`<g class="lineWrapper"><line x1="${X(m.x1)}" y1="${X(m.y1)}" x2="${X(m.x2)}" y2="${X(m.y2)}" stroke-width="4"${p}/></g>`),l.push(`</svg>`),l.join(`
|
|
133
|
+
`)}var rc=2048,ic=[569,569,727,1139,1139,1821,1366,391,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,569,569,1196,1196,1196,1139,2079,1366,1366,1479,1479,1366,1251,1593,1479,569,1024,1366,1139,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,569,569,569,961,1139,682,1139,1139,1024,1139,1139,569,1139,1139,455,455,1024,455,1706,1139,1139,1139,1139,682,1024,569,1139,1024,1479,1024,1024,1024,684,532,684,1196],ac=[569,682,971,1139,1139,1821,1479,487,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,682,682,1196,1196,1196,1251,1992,1479,1479,1479,1479,1366,1251,1593,1479,569,1139,1479,1251,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,682,569,682,1196,1139,682,1139,1251,1139,1251,1139,682,1251,1251,569,569,1139,569,1821,1251,1251,1251,1251,797,1139,682,1251,1139,1593,1139,1139,1024,801,573,801,1196];function oc(e,t){let n=e.codePointAt(0);if(!(n<32||n>126))return(t?ac:ic)[n-32]/rc}var Z={width:216,diagramMarginX:50,diagramMarginY:10,shapeMargin:50,shapePadding:20,shapeInRow:4,boundaryInRow:2,nextLinePaddingX:0,screenWidth:1440,nameSize:14,typeSize:10.5,descrSize:11.5,messageSize:12,boundarySize:14,nameLine:15.35,typeLine:15.72,descrLine:17.1,descrExtraLine:12.48,textScale:.922,boundaryLabelHeight:18,boundaryTypeHeight:16.1,boundaryDescrHeight:14.4,rootHeadingHeight:47,titleExtra:60,cornerRadius:12,strokeWidth:2,personRx:.177,personRxMaxOfHeight:.45,personHeadRatio:.23,personHeadMin:16,personHeadMax:56,personHeadOverlap:.27,dbTrim:3.91,queueExtra:10},sc=Z.width-2*Z.shapePadding;function cc(e,t,n){let r=[];for(let i of e.split(`
|
|
134
|
+
`)){let e=``;for(let a of i.split(/\s+/).filter(Boolean)){let i=e?`${e} ${a}`:a;e&&mc(i,n,400)>t?(r.push(e),e=a):e=i}r.push(e)}return r}function lc(e,t){let n=Math.min(Math.max(e*Z.personHeadRatio,Z.personHeadMin),Z.personHeadMax),r=n*(2-Z.personHeadOverlap),i=t===void 0?1/0:t-r;return{rx:Math.min(e*Z.personRx,i*Z.personRxMaxOfHeight),headRadius:n,pillTop:r}}function uc(e,t){return e*Z.nameLine+Z.typeLine+dc(t)}function dc(e){return e===0?0:Z.descrLine+(e-1)*Z.descrExtraLine}function fc(e){let t=e/2;return{rx:t,ry:t/(2.5+e/50)}}function pc(e){let t=e/2;return{rx:t/(2.5+e/50),ry:t}}function mc(e,t,n){let r=0;for(let i of e){let e=oc(i,n>=600);r+=e===void 0?k(i,t,n)*Z.textScale:e*t}return r}function hc(e,t,n,r){let i=uc(t,n),a=i+2*Z.shapePadding,o=Math.max(Z.width,r+2*Z.shapePadding);if(e.kind===`person`)return{width:o,height:lc(o).pillTop+a,textHeight:i};if(e.shape===`db`){let{ry:e}=fc(o);return{width:o,height:a+2*e-Z.dbTrim,textHeight:i}}if(e.shape===`queue`){let e=i+Z.queueExtra,{rx:t}=pc(e);return{width:o+3*t,height:e,textHeight:i}}return{width:o,height:a,textHeight:i}}function gc(e){let t=`#ffffff`;if(e.external)switch(e.kind){case`person`:return{fill:`#686868`,stroke:`#8a8a8a`,text:t};case`system`:return{fill:`#999999`,stroke:`#8a8a8a`,text:t};case`container`:return{fill:`#b3b3b3`,stroke:`#a6a6a6`,text:t};case`component`:return{fill:`#cccccc`,stroke:`#bfbfbf`,text:t}}switch(e.kind){case`person`:return{fill:`#08427b`,stroke:`#073b6f`,text:t};case`system`:return{fill:`#1168bd`,stroke:`#3c7fc0`,text:t};case`container`:return{fill:`#438dd5`,stroke:`#3c7fc0`,text:t};case`component`:return{fill:`#85bbf0`,stroke:`#78a8d8`,text:t}}}var _c=Z.messageSize+5;function vc(e){return e.labelLines??(0,t.c4RelLabelLines)(e)}function yc(e){let t=e.labelPosition;return t?vc(e).map((n,r,i)=>({cx:e.technology!==void 0&&r===i.length-1&&e.technologyX!==void 0?e.technologyX:t.x,cy:t.y+r*_c,w:mc(n,Z.messageSize,400),h:Z.messageSize})):[]}function bc(){return{next:{cnt:0}}}function xc(e,t,n,r,i){e.next.startx=e.startx=t,e.next.stopx=e.stopx=n,e.next.starty=e.starty=r,e.next.stopy=e.stopy=i}function Sc(e,t,n,r){let i=e[t];e[t]=i===void 0?n:r(n,i)}function Cc(e,t){e.next.cnt+=1;let n=Z.shapeMargin,r=e.next.startx===e.next.stopx?e.next.stopx+n:e.next.stopx+n*2,i=r+t.width,a=e.next.starty+n*2,o=a+t.height;(r>=e.widthLimit||i>=e.widthLimit||e.next.cnt>Z.shapeInRow)&&(r=e.next.startx+n+Z.nextLinePaddingX,a=e.next.stopy+n*2,e.next.stopx=i=r+t.width,e.next.starty=e.next.stopy,e.next.stopy=o=a+t.height,e.next.cnt=1),t.x=r,t.y=a,Sc(e,`startx`,r,Math.min),Sc(e,`starty`,a,Math.min),Sc(e,`stopx`,i,Math.max),Sc(e,`stopy`,o,Math.max),Sc(e.next,`startx`,r,Math.min),Sc(e.next,`starty`,a,Math.min),Sc(e.next,`stopx`,i,Math.max),Sc(e.next,`stopy`,o,Math.max)}function wc(e){let n=cc(e.label,sc,Z.nameSize),r=e.description?cc(e.description,sc,Z.descrSize):[],i=Math.max(...n.map(e=>mc(e,Z.nameSize,700)),mc((0,t.c4TypeLine)(e),Z.typeSize,400),...r.map(e=>mc(e,Z.descrSize,400)));return{el:e,nameLines:n,descriptionLines:r,x:0,y:0,...hc(e,n.length,r.length,i)}}function Tc(e){let t=new Set,n=new Map(e.elements.map(e=>[e.alias,e])),r=e=>{let i=e.elementAliases.flatMap(e=>{t.add(e);let r=n.get(e);return r?[r]:[]});return{alias:e.alias,boundary:e,elements:i,children:e.children.map(r)}},i=e.boundaries.map(r);return{alias:`global`,elements:e.elements.filter(e=>!t.has(e.alias)),children:i}}function Ec(e){let n=new Map,r=[],i=Z.diagramMarginX,a=Z.diagramMarginY,o=(e,t)=>{for(let r of t){let t=wc(r);n.set(r.alias,t),Cc(e,t)}e.stopx+=Z.shapeMargin,e.stopy+=Z.shapeMargin},s=(e,n,c)=>{let l=bc();l.widthLimit=e.widthLimit/Math.min(Z.boundaryInRow,n.length);for(let[u,d]of n.entries()){let n=d.boundary,f=0,p=f+8;f=p+Z.boundaryLabelHeight;let m;n&&(0,t.c4BoundaryTypeLine)(n)&&(m=f+5,f=m+Z.boundaryTypeHeight);let h;if(n?.description&&(h=f+20,f=h+Z.boundaryDescrHeight),n||(f=Z.rootHeadingHeight),u===0||u%Z.boundaryInRow===0){let t=e.startx+Z.diagramMarginX,n=e.stopy+Z.diagramMarginY+f;xc(l,t,t,n,n)}else{let e=l.stopx===l.startx?l.startx:l.stopx+Z.diagramMarginX;xc(l,e,e,l.starty,l.starty)}if(d.elements.length>0&&o(l,d.elements),d.children.length>0&&s(l,d.children,c+1),n){let e=l.stopx-l.startx,t=l.stopy-l.starty;e===0&&(e=Z.width,l.stopx=l.startx+e),t===0&&(t=f+Z.shapeMargin),r.push({alias:n.alias,label:n.label,...n.type?{type:n.type}:{},...n.description?{description:n.description}:{},x:l.startx,y:l.starty,width:e,height:t,depth:c,labelY:p,...m===void 0?{}:{typeY:m},...h===void 0?{}:{descrY:h}})}e.stopy=Math.max(l.stopy+Z.shapeMargin,e.stopy),e.stopx=Math.max(l.stopx+Z.shapeMargin,e.stopx),i=Math.max(i,e.stopx),a=Math.max(a,e.stopy)}},c=bc();return xc(c,Z.diagramMarginX,Z.diagramMarginX,Z.diagramMarginY,Z.diagramMarginY),c.widthLimit=Z.screenWidth,s(c,[e],-1),{elements:n,boundaries:r,maxX:i,maxY:a}}function Dc(e,t){let n=e.x+e.width/2,r=e.y+e.height/2,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(i===0&&a===0)return{x:n,y:r};let c,l;if(Math.abs(a)*o>Math.abs(i)*s){let e=a<0?-s:s;c=e*i/a,l=e}else{let e=i<0?-o:o;c=e,l=e*a/i}return{x:n+c,y:r+l}}function Oc(e,t){let n=lc(e.width,e.height),r=e.x+e.width/2,i=e.y+e.height/2,a=e.width,o=e.height,s=-o/2+n.headRadius,c=-o/2+n.pillTop,l=n.rx,u=(e,t,n,r,i,a)=>Array.from({length:r},(o,s)=>{let c=(i+s*(a-i)/(r-1))*Math.PI/180;return{x:e-n*Math.cos(c),y:t-n*Math.sin(c)}}),d=Math.asin(Math.min(1,(c-s)/n.headRadius))*180/Math.PI,f=[...u(0,s,n.headRadius,24,180+d,-d),...u(-a/2+l,c+l,l,12,90,0),...u(-a/2+l,o/2-l,l,12,360,270),...u(a/2-l,o/2-l,l,12,270,180),...u(a/2-l,c+l,l,12,180,90)];return Ac({x:r,y:i},t,f.map(e=>({x:r+e.x,y:i+e.y})))}function kc(e,t,n,r){let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o;if(s!==0&&c!==0&&s*c>0)return;let l=r.y-n.y,u=n.x-r.x,d=r.x*n.y-n.x*r.y,f=l*e.x+u*e.y+d,p=l*t.x+u*t.y+d;if(f!==0&&p!==0&&f*p>0)return;let m=i*u-l*a;if(m===0)return;let h=Math.abs(m/2),g=a*d-u*o,_=g<0?(g-h)/m:(g+h)/m;return g=l*o-i*d,{x:_,y:g<0?(g-h)/m:(g+h)/m}}function Ac(e,t,n){let r,i=1/0;return n.forEach((a,o)=>{let s=kc(e,t,a,n[(o+1)%n.length]);if(!s)return;let c=Math.hypot(s.x-t.x,s.y-t.y);c<i&&(r=s,i=c)}),r??e}var jc=1e-6;function Mc(e,t){let n=Dc(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=fc(e.width),s=n.x-r,c=Math.abs(s)<e.width/2-jc||Math.abs(Math.abs(s)-e.width/2)<=jc&&Math.abs(n.y-i)>e.height/2-o;if(a===0||!c)return n;let l=o*o*(1-s*s/(a*a)),u=o-(l>0?Math.sqrt(l):l);return t.y-i>0&&(u=-u),{x:n.x,y:n.y+u}}function Nc(e,t){let n=Dc(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=pc(e.height),s=n.y-i,c=Math.abs(s)<e.height/2-jc||Math.abs(Math.abs(s)-e.height/2)<=jc&&Math.abs(n.x-r)>e.width/2-a;if(o===0||!c)return n;let l=a*a*(1-s*s/(o*o)),u=a-Math.sqrt(Math.abs(l));return t.x-r>0&&(u=-u),{x:n.x+u,y:n.y}}function Pc(e,t){let n=e.el;return n?.kind===`person`?Oc(e,t):n?.shape===`db`?Mc(e,t):n?.shape===`queue`?Nc(e,t):Dc(e,t)}var Fc=e=>({x:e.x+e.width/2,y:e.y+e.height/2});function Ic(e,n,r,i){let a=r.get(e.from),o=r.get(e.to),s=Pc(a,Fc(o)),c=Pc(o,Fc(a)),l=c.x-s.x,u=c.y-s.y,d=e=>({x:e.x,y:e.y+i}),f={...e,points:[d(s),d(c)]};if(n>0&&(f.curve=d({x:s.x+l/2-l/4,y:s.y+u/2})),(0,t.c4RelLabelLines)(e).length>0){let n={x:Math.min(s.x,c.x)+Math.abs(l)/2,y:Math.min(s.y,c.y)+Math.abs(u)/2},r=(0,t.c4RelLabelLines)(e)[0],i=e.label!==``||e.index!==void 0?mc(r??``,Z.messageSize,400):0;if(f.labelPosition=d({x:n.x+i/2,y:n.y}),e.technology){let t=mc(`[${e.technology}]`,Z.messageSize,400);f.technologyX=n.x+Math.max(i,t)/2}}return f}var Lc=2,Rc=6,zc=2,Bc=[0,14,-14,28,-28],Vc=[.75,.55,.4],Hc=1e3,Uc=100,Wc=10,Gc=2,Kc=5,qc=4,Jc=e=>({x0:e.cx-e.w/2,x1:e.cx+e.w/2,y0:e.cy-e.h/2,y1:e.cy+e.h/2}),Yc=(e,t)=>e.x0<t.x1+Lc&&e.x1>t.x0-Lc&&e.y0<t.y1+Lc&&e.y1>t.y0-Lc;function Xc(e){let t=e.points[0],n=e.points[e.points.length-1],r=e.curve,i=Math.hypot(n.x-t.x,n.y-t.y),a=Math.max(1,Math.ceil(i/qc));return Array.from({length:a+1},(e,i)=>{let o=i/a;if(!r)return{x:t.x+(n.x-t.x)*o,y:t.y+(n.y-t.y)*o};let s=1-o;return{x:s*s*t.x+2*s*o*r.x+o*o*n.x,y:s*s*t.y+2*s*o*r.y+o*o*n.y}})}function Zc(e){return e.flatMap(e=>{let n=(e,t,n,r,i)=>({x0:e-i,x1:t+i,y0:n-i,y1:r+i,weight:Uc}),r=(t,r,i,a)=>{let o=mc(t,i,a),s=e.x+e.width/2;return n(s-o/2,s+o/2,e.y+r-i/2,e.y+r+i/2,Kc)},i=(0,t.c4BoundaryTypeLine)({...e,elementAliases:[],children:[]});return[n(e.x,e.x+e.width,e.y,e.y,Gc),n(e.x,e.x+e.width,e.y+e.height,e.y+e.height,Gc),n(e.x,e.x,e.y,e.y+e.height,Gc),n(e.x+e.width,e.x+e.width,e.y,e.y+e.height,Gc),r(e.label,e.labelY,Z.boundarySize+2,700),...i?[r(i,e.typeY,Z.boundarySize,400)]:[],...e.description?[r(e.description,e.descrY,Z.boundarySize-2,400)]:[]]})}function Qc(e,t){return yc({...e,labelLines:t.lines,labelPosition:t.position,...t.technologyX===void 0?{}:{technologyX:t.technologyX}}).map(Jc)}function $c(e,n,r,i){let a=e.points[0],o=e.points[e.points.length-1],s=e.labelPosition;if(!s||!a||!o)return;let c=o.x-a.x,l=o.y-a.y,u=Math.hypot(c,l),d=(0,t.c4RelLabelLines)(e),f=e.label!==``||e.index!==void 0,p=f?mc(d[0],Z.messageSize,400):0,m=s.x-p/2,h=[{variant:{lines:d,position:s,...e.technologyX===void 0?{}:{technologyX:e.technologyX}},cost:0}];if(f){let t=e.technology?[`[${e.technology}]`]:[],n=new Set([d.join(`
|
|
135
|
+
`)]);Vc.forEach((e,r)=>{let i=cc(d[0],p*e,Z.messageSize),a=[...i,...t].join(`
|
|
136
|
+
`);if(n.has(a))return;n.add(a);let o=Math.max(...i.map(e=>mc(e,Z.messageSize,400)));h.push({variant:{lines:[...i,...t],position:{x:m+o/2,y:s.y}},cost:25*(r+1)})})}let g=u===0?0:c/u,_=u===0?0:l/u,v=u/2+Math.max(...Bc)+Lc,y=h.flatMap(t=>Qc(e,t.variant)),b={x0:Math.min(...y.map(e=>e.x0))-v,x1:Math.max(...y.map(e=>e.x1))+v,y0:Math.min(...y.map(e=>e.y0))-v,y1:Math.max(...y.map(e=>e.y1))+v},x=e=>e.x0<b.x1&&e.x1>b.x0&&e.y0<b.y1&&e.y1>b.y0,S=[...n,...i].filter(x),C=Math.max(zc,u/200),w=r.filter(e=>x({x0:Math.min(...e.map(e=>e.x)),x1:Math.max(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),y1:Math.max(...e.map(e=>e.y))})),T=w.map(e=>({x0:Math.min(...e.map(e=>e.x)),x1:Math.max(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),y1:Math.max(...e.map(e=>e.y))})),E,D=e=>E?.penalty===0&&e>=E.cost;for(let{variant:t,cost:n}of h){let r=Qc(e,t);for(let e of Bc)if(!D(n+2*Math.abs(e)))for(let i=0;i<=u/2&&!D(n+2*Math.abs(e)+i);i+=C)for(let a of i===0?[1]:[1,-1]){let o=a*i,s={x:o*g-e*_,y:o*_+e*g},c=r.map(e=>({x0:e.x0+s.x,x1:e.x1+s.x,y0:e.y0+s.y,y1:e.y1+s.y})),l=0,u=E?.penalty??1/0;for(let e of c){if(l>u)break;for(let t of S)if(Yc(e,t)&&(l+=t.weight),l>u)break;if(l>u)break;for(let[t,n]of w.entries()){let r=T[t];r.x1<=e.x0||r.x0>=e.x1||r.y1<=e.y0||r.y0>=e.y1||n.some(t=>t.x>e.x0&&t.x<e.x1&&t.y>e.y0&&t.y<e.y1)&&(l+=Wc)}}let d=n+i+2*Math.abs(e);(!E||l<E.penalty||l===E.penalty&&d<E.cost)&&(E={v:t,at:s,penalty:l,cost:d})}}let{v:O,at:k}=E;e.labelPosition={x:O.position.x+k.x,y:O.position.y+k.y},O.lines!==d&&(e.labelLines=O.lines),O.technologyX===void 0?delete e.technologyX:e.technologyX=O.technologyX+k.x,i.push(...yc(e).map(e=>({...Jc(e),weight:Uc})))}function el(e,t={}){if(e.elements.length===0&&e.boundaries.length===0){let t={variant:e.variant,width:0,height:0,elements:[],boundaries:[],relationships:[]};if(e.title){let n=2*Z.diagramMarginY+Z.titleExtra;t.title=e.title,t.width=Math.ceil(2*Z.diagramMarginX+mc(e.title,16,400)),t.height=n,t.titlePosition={x:Z.diagramMarginX,y:n/2}}return t}let n=Ec(Tc(e)),r=e.title?Z.titleExtra:0,i=Z.diagramMarginY+r,a=e.elements.flatMap(e=>{let t=n.elements.get(e.alias);return t?[{...e,x:t.x,y:t.y+i,width:t.width,height:t.height,nameLines:t.nameLines,descriptionLines:t.descriptionLines}]:[]}),o=[...n.boundaries].sort((e,t)=>e.depth-t.depth).map(e=>({...e,y:e.y+i})),s=new Map;for(let e of n.elements.values())s.set(e.el.alias,e);for(let e of n.boundaries)s.set(e.alias,e);let c=e.relationships.map((e,t)=>Ic(e,t,s,i)),l=[...a.map(e=>({x0:e.x-Rc,x1:e.x+e.width+Rc,y0:e.y-Rc,y1:e.y+e.height+Rc,weight:Hc})),...Zc(o)],u=c.map(Xc),d=[];c.forEach((e,t)=>$c(e,l,u.filter((e,n)=>n!==t),d));let f=n.maxX+Z.diagramMarginX,p=n.maxY+Z.diagramMarginY+r,m={variant:e.variant,width:f,height:p,elements:a,boundaries:o,relationships:c};return e.title&&(m.title=e.title,m.titlePosition={x:(n.maxX-Z.diagramMarginX)/2-4*Z.diagramMarginX,y:Z.diagramMarginY+Z.diagramMarginY+i}),m}function tl(t,n,r=`Inter`,i=!1,a=j,o,s,c,l={}){let u=[];u.push(Cr((0,e.svgOpenTag)(t.width,t.height,n,i,s??t.title,c,void 0,l.styleAttribute,l.description),o)),u.push((0,e.buildStyleBlock)(r,!1,l.nonce,l.bodyFont)),t.title&&t.titlePosition&&u.push(e.f`<text class="c4-title" x="${t.titlePosition.x}" y="${t.titlePosition.y}" dy="${F}" `+e.f`font-size="16" fill="var(--_text)">${(0,e.escapeXml)(t.title)}</text>`);for(let e of t.boundaries)u.push(rl(e));for(let e of t.elements)u.push(il(e));for(let e of t.relationships)u.push(fl(e));for(let e of t.relationships)u.push(pl(e));return u.push(`</svg>`),u.filter(Boolean).join(`
|
|
137
|
+
`)}function nl(t,n,r,i,a){return e.f` <text x="${n}" y="${r}" text-anchor="middle" dy="${F}" font-size="${i}" `+e.f`${a}>${(0,e.escapeXml)(t)}</text>`}function rl(n){let r=[];r.push(e.f`<g class="c4-boundary" data-id="${(0,e.escapeAttr)(n.alias)}" data-label="${(0,e.escapeAttr)(n.label)}" data-depth="${n.depth}">`),r.push(e.f` <rect x="${n.x}" y="${n.y}" width="${n.width}" height="${n.height}" rx="2.5" ry="2.5" `+`fill="none" stroke="var(--_text)" stroke-width="1" stroke-dasharray="7,7" />`);let i=n.x+n.width/2;r.push(nl(n.label,i,n.y+(n.labelY??8),Z.boundarySize+2,`font-weight="700" fill="var(--_text)"`));let a=(0,t.c4BoundaryTypeLine)({alias:n.alias,label:n.label,...n.type?{type:n.type}:{},elementAliases:[],children:[]});return a&&n.typeY!==void 0&&r.push(nl(a,i,n.y+n.typeY,Z.boundarySize,`fill="var(--_text)"`)),n.description&&n.descrY!==void 0&&r.push(nl(n.description,i,n.y+n.descrY,Z.boundarySize-2,`fill="var(--_text)"`)),r.push(`</g>`),r.join(`
|
|
138
|
+
`)}function il(n){let r=gc(n),{x:i,y:a,width:o,height:s}=n,c=i+o/2,l=uc(n.nameLines.length,n.descriptionLines.length),u=[];u.push(e.f`<g class="c4-element" data-id="${(0,e.escapeAttr)(n.alias)}" data-kind="${n.kind}" data-shape="${n.shape}" `+e.f`data-external="${n.external}" data-label="${(0,e.escapeAttr)(n.label)}">`);let d,f=c;if(n.kind===`person`)u.push(...ol(n,r)),d=a+lc(o).pillTop+Z.shapePadding;else if(n.shape===`db`){u.push(...sl(n,r));let{ry:e}=fc(o);d=a+(2*e+s)/2-l/2}else if(n.shape===`queue`){u.push(...cl(n,r));let{rx:e}=pc(s);f=c-e,d=a+s/2-l/2}else u.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" rx="${Z.cornerRadius}" ry="${Z.cornerRadius}" `+e.f`fill="${r.fill}" stroke="${r.stroke}" stroke-width="${Z.strokeWidth}" />`),d=a+Z.shapePadding;let p=d;for(let t of n.nameLines)u.push(nl(t,f,p+Z.nameLine/2,Z.nameSize,e.f`font-weight="700" fill="${r.text}"`)),p+=Z.nameLine;return u.push(nl((0,t.c4TypeLine)(n),f,p+Z.typeLine/2,Z.typeSize,e.f`fill="${r.text}"`)),p+=Z.typeLine,n.descriptionLines.forEach((t,n)=>{u.push(nl(t,f,p+Z.descrLine/2+n*Z.descrExtraLine,Z.descrSize,e.f`fill="${r.text}"`))}),p+=dc(n.descriptionLines.length),u.push(`</g>`),u.join(`
|
|
139
|
+
`)}function al(t){let{x:n,y:r,width:i,height:a}=t,{rx:o,headRadius:s,pillTop:c}=lc(i,a),l=n+i/2,u=r+c,d=r+a,f=Math.sqrt(Math.max(0,s*s-(u-(r+s))**2));return e.f`M ${n+o} ${u} H ${l-f} A ${s} ${s} 0 1 1 ${l+f} ${u} `+e.f`H ${n+i-o} A ${o} ${o} 0 0 1 ${n+i} ${u+o} V ${d-o} `+e.f`A ${o} ${o} 0 0 1 ${n+i-o} ${d} H ${n+o} `+e.f`A ${o} ${o} 0 0 1 ${n} ${d-o} V ${u+o} `+e.f`A ${o} ${o} 0 0 1 ${n+o} ${u} Z`}function ol(t,n){return[e.f` <path class="c4-person-shape" d="${al(t)}" fill="${n.fill}" stroke="${n.stroke}" stroke-width="${Z.strokeWidth}" />`]}function sl(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=fc(a),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${Z.strokeWidth}"`;return[e.f` <path d="M ${r} ${i+c} L ${r} ${i+o-c} A ${s} ${c} 0 0 0 ${r+a} ${i+o-c} L ${r+a} ${i+c} Z" ${l} />`,e.f` <ellipse cx="${r+s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function cl(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=pc(o),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${Z.strokeWidth}"`;return[e.f` <path d="M ${r+a-s} ${i} H ${r+s} A ${s} ${c} 0 0 0 ${r+s} ${i+o} H ${r+a-s} Z" ${l} />`,e.f` <ellipse cx="${r+a-s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function ll(t,n){let r=t.x-n.x,i=t.y-n.y,a=Math.hypot(r,i);if(a===0)return``;let o=r/a,s=i/a,c=t.x-o*10,l=t.y-s*10;return e.f`<polygon class="c4-arrowhead" points="${t.x},${t.y} ${c-s*5},${l+o*5} ${c+s*5},${l-o*5}" `+`fill="var(--_text)" />`}var ul=3,dl=1;function fl(t){let[n,r]=[t.points[0],t.points[t.points.length-1]];if(!n||!r||n===r)return``;let i=[`class="c4-relationship"`,e.f`data-from="${(0,e.escapeAttr)(t.from)}"`,e.f`data-to="${(0,e.escapeAttr)(t.to)}"`];t.label&&i.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.technology&&i.push(e.f`data-technology="${(0,e.escapeAttr)(t.technology)}"`);let a=t.curve?e.f`M ${n.x},${n.y} Q ${t.curve.x},${t.curve.y} ${r.x},${r.y}`:e.f`M ${n.x},${n.y} L ${r.x},${r.y}`,o=e.f`<path ${i.join(` `)} d="${a}" fill="none" stroke="var(--_text)" stroke-width="1" />`,s=t.curve??n,c=t.curve??r,l=ll(r,s),u=ll(n,c);return[o,...t.bidirectional?[l,u]:[t.reversed?u:l]].filter(Boolean).join(`
|
|
140
|
+
`)}function pl(t){let n=vc(t),r=yc(t);if(r.length===0)return``;let i=[e.f`<g class="c4-relationship-label" data-from="${(0,e.escapeAttr)(t.from)}" data-to="${(0,e.escapeAttr)(t.to)}">`],a=Math.min(...r.map(e=>e.cx-e.w/2))-ul,o=Math.max(...r.map(e=>e.cx+e.w/2))+ul,s=r[0].cy-r[0].h/2-dl,c=r[r.length-1],l=c.cy+c.h/2+dl;return i.push(e.f` <rect class="c4-label-plate" x="${a}" y="${s}" width="${o-a}" height="${l-s}" rx="2" ry="2" fill="var(--bg)" />`),n.forEach((e,a)=>{let o=t.technology!==void 0&&a===n.length-1,s=r[a];i.push(nl(e,s.cx,s.cy,Z.messageSize,o?`font-style="italic" fill="var(--_text)"`:`fill="var(--_text)"`))}),i.push(`</g>`),i.join(`
|
|
141
|
+
`)}var Q={titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,defaultWidth:1200},ml=Q.barHeight+Q.barGap,hl={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:26298e5};function gl(e,n={}){let r=n.width??Q.defaultWidth,i=e.tasks,a=i.filter(e=>!e.vert),o=[];for(let e of a)o.includes(e.section)||o.push(e.section);let s=e=>{let t=o.indexOf(e);return(t<0?0:t)%Q.numberSectionStyles},c=new Map,l=new Map,u=2*Q.topPadding;if(e.displayMode===`compact`){let e=0;for(let n of o){let r=a.filter(e=>e.section===n),i=(0,t.packGanttSection)(r,e,c)+1;e+=i,u+=i*ml,l.set(n,i)}}else{for(let e of a)c.set(e,e.order);u+=a.length*ml;for(let e of o)l.set(e,a.filter(t=>t.section===e).length)}let d=(u-2*Q.topPadding)/ml,f=e=>e.vert?-1:c.get(e)??e.order,p=r-Q.leftPadding-Q.rightPadding,m=i.length?Math.min(...i.map(e=>e.start)):0,h=i.length?Math.max(...i.map(e=>e.end)):0,g=e=>Math.round(h===m?p/2:(e-m)/(h-m)*p),_=[...i].sort((e,t)=>e.start>t.start?1:e.start<t.start?-1:0).sort((e,t)=>e.vert===t.vert?0:e.vert?1:-1).map(e=>{let t=f(e),n=g(e.start),i=g(e.end),a=g(e.renderEnd??e.end),o=n+Q.leftPadding,c=a-n,l=t*ml+Q.topPadding,u=Q.barHeight;e.milestone?(o=n+Q.leftPadding+.5*(i-n)-.5*Q.barHeight,c=Q.barHeight):e.vert&&(c=.08*Q.barHeight),e.vert&&(l=Q.gridLineStartPadding,u=d*ml+Q.barHeight*2);let p=n+Q.leftPadding+.5*(i-n),m=t*ml+Q.topPadding+.5*Q.barHeight,h=k(e.label,Q.fontSize,400),_=n,v=a;e.milestone&&(_+=.5*(i-n)-.5*Q.barHeight,v=_+Q.barHeight);let y,b=`middle`,x=null,S=i;e.milestone&&(S=n+Q.barHeight);let C=h>(e.vert?0:v-_),w=h>S-n;y=e.vert?n+Q.leftPadding:C?v+h+1.5*Q.leftPadding>r?_+Q.leftPadding-5:v+Q.leftPadding+5:(v-_)/2+_+Q.leftPadding,w&&(S+h+1.5*Q.leftPadding>r?(x=`left`,b=`end`):(x=`right`,b=`start`));let T=e.vert?Q.gridLineStartPadding+d*ml+60:t*ml+Q.barHeight/2+(Q.fontSize/2-2)+Q.topPadding;return{id:e.id,x:o,y:l,width:c,height:u,originX:p,originY:m,sectionStyle:s(e.section),task:e,text:{text:e.label,x:y,y:T,anchor:b,outside:x}}}),v=new Set,y=[];for(let e of _){if(e.task.vert)continue;let t=f(e.task);v.has(t)||(v.add(t),y.push({y:t*ml+Q.topPadding-2,width:r-Q.rightPadding/2,height:ml,sectionStyle:e.sectionStyle}))}let b=[];if((e.excludes.length>0||e.includes.length>0)&&i.length){let n=864e5;if(h-m<=1830*n){let r=n=>(0,t.isExcludedDate)(e,n),i=null;for(let e=m;e<=h;e+=n)r(e)?i?i.end=e:i={start:e,end:e}:i&&=(b.push(x(i)),null)}}function x(e){let n=864e5,r=e=>Math.floor(e/n)*n,i=g(r(e.start)),a=g(r(e.end)+n-1);return{id:(0,t.formatD3Time)(e.start,`%Y-%m-%d`),x:i+Q.leftPadding,y:Q.gridLineStartPadding,width:a-i,height:u-Q.topPadding-Q.gridLineStartPadding}}let S=e.axisFormat||(e.dateFormat===`D`?`%d`:`%Y-%m-%d`),C=e.tickInterval;C&&i.length&&Math.ceil((h-m)/(C.every*hl[C.unit]))>1e4&&(C=void 0);let w=-u+Q.topPadding+Q.gridLineStartPadding,T=n=>({x:Q.leftPadding,y:n===`bottom`?u-50:Q.topPadding,position:n,tickSize:w,rangeEnd:p,ticks:i.length?(0,t.timeTicks)(m,h,C,e.weekday).map(e=>({x:g(e)+.5,label:(0,t.formatD3Time)(e,S)})):[]}),E=[T(`bottom`)];e.topAxis&&E.push(T(`top`));let D=[],O=0;for(let e of o){let t=l.get(e);D.push({lines:e.split(/<br\s*\/?>|\n/i),y:t*ml/2+O*ml+Q.topPadding,sectionStyle:s(e)}),O+=t}let A={width:r,height:u,excludeRanges:b,axes:E,rows:y,tasks:_,sectionLabels:D};if(e.title&&(A.title={text:e.title,x:r/2,y:Q.titleTopMargin}),e.todayMarker!==`off`&&i.length){let t=n.now??Date.now(),r=g(t);t>=m&&t<=h&&(A.today={x:r+Q.leftPadding,y1:Q.titleTopMargin,y2:u-Q.titleTopMargin,style:e.todayMarker.replace(/,/g,`;`)})}return A}function $(e){return String(Math.round(e*100)/100)}function _l(e){return e.split(`;`).map(e=>e.split(`:`).map(e=>e.trim())).filter(([e,t])=>e!==void 0&&t!==void 0&&/^(?:stroke(?:-width|-dasharray|-opacity|-linecap)?|opacity)$/.test(e)&&/^[\w#.%() -]+$/.test(t)).map(([e,t])=>`${e}: ${t};`).join(` `)}function vl(n,r){let i=`var(--accent, ${t.CHART_ACCENT_FALLBACK})`,a=(e,t,n=`var(--bg)`)=>`color-mix(in srgb, ${e} ${t}%, ${n})`,o=a(i,75,`var(--fg)`),s=(e,t)=>` ${[0,1,2,3].map(t=>`.${e}${t}`).join(`,`)} { ${t} }`,c=[`doneText`,`doneCritText`].flatMap(e=>[0,1,2,3].flatMap(t=>[`.${e}${t}.taskTextOutsideLeft`,`.${e}${t}.taskTextOutsideRight`])).join(`,`);return`${(0,e.styleOpenTag)(r)}
|
|
142
|
+
.exclude-range { fill: ${a(`var(--fg)`,8)}; }
|
|
143
|
+
.section { stroke: none; opacity: 0.2; }
|
|
144
|
+
.section0 { fill: ${i}; }
|
|
145
|
+
.section2 { fill: #fff400; }
|
|
146
|
+
.section1, .section3 { fill: var(--bg); opacity: 0.2; }
|
|
147
|
+
.sectionTitle { text-anchor: start; fill: var(--_text); }
|
|
148
|
+
.grid .tick { stroke: ${a(`var(--fg)`,22)}; opacity: 0.8; shape-rendering: crispEdges; }
|
|
149
|
+
.grid .tick text { fill: var(--_text); stroke: none; }
|
|
150
|
+
.grid path { stroke-width: 0; }
|
|
151
|
+
.today { fill: none; stroke: red; stroke-width: 2px; }
|
|
152
|
+
${n?` .today-custom { ${n} }\n`:``} .task { stroke-width: 2; }
|
|
153
|
+
.taskText { text-anchor: middle; }
|
|
154
|
+
.taskTextOutsideRight { fill: var(--_text); text-anchor: start; }
|
|
155
|
+
.taskTextOutsideLeft { fill: var(--_text); text-anchor: end; }
|
|
156
|
+
.task.clickable { cursor: pointer; }
|
|
157
|
+
.taskText.clickable, .taskTextOutsideLeft.clickable, .taskTextOutsideRight.clickable { cursor: pointer; fill: #003163 !important; font-weight: bold; }
|
|
158
|
+
${s(`taskText`,`fill: #fff;`)}
|
|
159
|
+
${s(`task`,`fill: ${i}; stroke: ${o};`)}
|
|
160
|
+
${s(`taskTextOutside`,`fill: var(--_text);`)}
|
|
161
|
+
${s(`active`,`fill: ${a(i,35)}; stroke: ${o};`)}
|
|
162
|
+
${s(`activeText`,`fill: var(--fg) !important;`)}
|
|
163
|
+
${s(`done`,`stroke: ${a(`var(--fg)`,50)}; fill: ${a(`var(--fg)`,20)}; stroke-width: 2;`)}
|
|
164
|
+
${s(`doneText`,`fill: var(--fg) !important;`)}
|
|
165
|
+
${c} { fill: var(--_text) !important; }
|
|
166
|
+
${s(`crit`,`stroke: #ff8888; fill: red; stroke-width: 2;`)}
|
|
167
|
+
${s(`activeCrit`,`stroke: #ff8888; fill: ${a(i,35)}; stroke-width: 2;`)}
|
|
168
|
+
${s(`doneCrit`,`stroke: #ff8888; fill: ${a(`var(--fg)`,20)}; stroke-width: 2; cursor: pointer; shape-rendering: crispEdges;`)}
|
|
169
|
+
.milestone { transform: rotate(45deg) scale(0.8, 0.8); }
|
|
170
|
+
.milestoneText { font-style: italic; }
|
|
171
|
+
${s(`doneCritText`,`fill: var(--fg) !important;`)}
|
|
172
|
+
.vert { stroke: ${a(i,60,`var(--fg)`)}; }
|
|
173
|
+
.vertText { font-size: 15px; text-anchor: middle; fill: ${a(i,60,`var(--fg)`)} !important; }
|
|
174
|
+
${s(`activeCritText`,`fill: var(--fg) !important;`)}
|
|
175
|
+
.titleText { text-anchor: middle; font-size: 18px; fill: var(--_text); }
|
|
176
|
+
</style>`}function yl(e,t){let n=``;return e.active?n=e.crit?` activeCrit`:` active`:e.done?n=e.crit?` doneCrit`:` done`:e.crit&&(n=` crit`),n.length===0&&(n=` task`),e.milestone&&(n=` milestone ${n}`),e.vert&&(n=` vert ${n}`),`task${n}${t} ${e.classes.join(` `)}`.trimEnd()}function bl(e){let t=e.task,n=e.sectionStyle,r=``;t.active&&(r=t.crit?`activeCritText${n}`:`activeText${n}`),t.done?r+=t.crit?` doneCritText${n}`:` doneText${n}`:t.crit&&(r+=` critText${n}`),t.milestone&&(r+=` milestoneText`),t.vert&&(r+=` vertText`);let i=e.text.outside===`left`?`taskTextOutsideLeft taskTextOutside${n}`:e.text.outside===`right`?`taskTextOutsideRight taskTextOutside${n}`:`taskText taskText${n}`;return[t.classes.join(` `),i,r].join(` `).replace(/\s+/g,` `).trim()}function xl(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(Cr((0,e.svgOpenTag)(t.width,t.height,n,i,o,s,void 0,c.styleAttribute,c.description),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(vl(t.today?_l(t.today.style):``,c.nonce)),l.push(`<g class="exclude-ranges">`);for(let e of t.excludeRanges)l.push(`<rect data-date="${e.id}" x="${$(e.x)}" y="${$(e.y)}" width="${$(e.width)}" height="${$(e.height)}" class="exclude-range"/>`);l.push(`</g>`);for(let n of t.axes){let t=n.position===`bottom`?1:-1;l.push(`<g class="grid" transform="translate(${n.x}, ${n.y})" fill="none" font-size="10" text-anchor="middle">`,`<path class="domain" stroke="currentColor" d="M0.5,${t*n.tickSize}V0.5H${n.rangeEnd+.5}V${t*n.tickSize}"/>`);for(let r of n.ticks)l.push(`<g class="tick" opacity="1" transform="translate(${$(r.x)},0)"><line stroke="currentColor" y2="${t*n.tickSize}"/><text fill="currentColor" y="${t*3}" dy="${t===1?`1em`:`0em`}" font-size="10" text-anchor="middle">${(0,e.escapeXml)(r.label)}</text></g>`);l.push(`</g>`)}l.push(`<g class="rows">`);for(let e of t.rows)l.push(`<rect x="0" y="${$(e.y)}" width="${$(e.width)}" height="${e.height}" class="section section${e.sectionStyle}"/>`);l.push(`</g>`),l.push(`<g class="tasks">`);for(let n of t.tasks)l.push(`<rect data-task="${(0,e.escapeXml)(n.id)}" rx="3" ry="3" x="${$(n.x)}" y="${$(n.y)}" width="${$(n.width)}" height="${$(n.height)}" transform-origin="${$(n.originX)}px ${$(n.originY)}px" class="${(0,e.escapeXml)(yl(n.task,n.sectionStyle))}"/>`);for(let n of t.tasks)l.push(`<text data-task="${(0,e.escapeXml)(n.id)}" font-size="${Q.fontSize}" x="${$(n.text.x)}" y="${$(n.text.y)}" class="${(0,e.escapeXml)(bl(n))}">${(0,e.escapeXml)(n.text.text)}</text>`);l.push(`</g>`),l.push(`<g class="section-titles">`);for(let n of t.sectionLabels){let t=-(n.lines.length-1)/2,r=n.lines.map((t,n)=>`<tspan alignment-baseline="central" x="10"${n>0?` dy="1em"`:``}>${(0,e.escapeXml)(t)}</tspan>`).join(``);n.lines.every(e=>e===``)||l.push(`<text dy="${t}em" x="10" y="${$(n.y)}" font-size="${Q.sectionFontSize}" class="sectionTitle sectionTitle${n.sectionStyle}">${r}</text>`)}if(l.push(`</g>`),t.today){let e=t.today,n=_l(e.style)?` today-custom`:``;l.push(`<g class="today"><line x1="${$(e.x)}" x2="${$(e.x)}" y1="${e.y1}" y2="${$(e.y2)}" class="today${n}"/></g>`)}return t.title&&l.push(`<text x="${$(t.title.x)}" y="${t.title.y}" class="titleText">${(0,e.escapeXml)(t.title.text)}</text>`),l.push(`</svg>`),l.join(`
|
|
177
|
+
`)}var Sl=200,Cl=42.5,wl=41.5,Tl=17,El=24.5,Dl=120,Ol=`3`,kl=t=>(0,e.measureTextWidth)(t,j.nodeLabel,M.nodeLabel);function Al(e){let t=[];for(let n of e.split(`
|
|
178
|
+
`)){let e=``;for(let r of n.split(/\s+/).filter(Boolean)){let n=e?`${e} ${r}`:r;e&&kl(n)>Dl?(t.push(e),e=r):e=n}t.push(e)}return t}var jl=(e,t)=>{if(!e)return t;let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}};function Ml(e,t){let n=new Map([...t.keys()].map(e=>[e,e])),r=e=>{let t=e;for(;n.get(t)!==t;)t=n.get(t);return t};for(let t of e.edges)n.has(t.source)&&n.has(t.target)&&n.set(r(t.source),r(t.target));let i=new Map;for(let e of t.keys()){let t=r(e);i.set(t,[...i.get(t)??[],e])}let a=0;for(let e of i.values()){let n=Math.min(...e.map(e=>t.get(e)[0])),r=Math.max(...e.map(e=>t.get(e)[0]));for(let r of e)t.get(r)[0]+=a-n;a+=r-n+1}}function Nl(e,t){for(let n of e){if(n.nodeIds.includes(t))return[n.id];let e=Nl(n.children,t);if(e.length>0)return[...e,n.id]}return[]}function Pl(e,t,n){let r=[0];for(let i=t;i<n;i++){let t=0;for(let[n,r]of e.values())(n<=i!=n<=i+1||r>=i!=r>=i+1)&&t++;r.push(r[r.length-1]+Sl+wl*Math.max(0,t-1))}return r}function Fl(e,t=I.padding){let n=e.direction===`LR`||e.direction===`RL`,r=new Map;for(let[t,i]of e.nodes){let e=i.gridLayer??0,a=i.gridOrder??0;r.set(t,n?[e,a]:[a,e])}Ml(e,r);let i=new Map,a=new Map;for(let[t,[n,o]]of r)for(let r of Nl(e.subgraphs,t)){let e=i.get(r)??[n,n],t=a.get(r)??[o,o];i.set(r,[Math.min(e[0],n),Math.max(e[1],n)]),a.set(r,[Math.min(t[0],o),Math.max(t[1],o)])}let o=[...r.values()].map(e=>e[0]),s=[...r.values()].map(e=>e[1]),c=Math.min(...o),l=Math.min(...s),u=Pl(i,c,Math.max(...o)),d=Pl(a,l,Math.max(...s)),f=[],p=new Map,m=new Map;for(let[t,n]of e.nodes){let[i,a]=r.get(t),o=n.shape===`junction`?2:80,s=u[i-c]-o/2,h=d[a-l]-o/2,g={x:s,y:h,width:o,height:o};m.set(t,g);let _=n.icon===void 0?[]:Al(n.label),v=Math.max(0,..._.map(kl)),y=Math.max(0,(v-o)/2);p.set(t,n.shape===`junction`?{x:s+o/2-40,y:h+o/2-40,width:80,height:80}:{x:s-y,y:h,width:o+y*2,height:o+Tl}),f.push({id:t,label:n.icon===void 0?n.label:_.join(`
|
|
179
|
+
`),shape:n.icon===void 0?n.shape:`rectangle`,icon:n.icon,...g,className:e.classAssignments.get(t),interaction:e.interactions.get(t)})}let h=e=>{let t=e.children.map(h),n=(e,t)=>({x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}),r;for(let t of e.nodeIds)r=jl(r,p.get(t));let i;for(let e of t)i=jl(i,e);let a=[...r?[n(r,Cl)]:[],...i?[n(i,wl)]:[]].reduce((e,t)=>jl(e,t),void 0)??{x:-42.5,y:-42.5,width:Cl*2,height:Cl*2};return m.set(e.id,a),{id:e.id,label:e.label,...a,children:t,...e.icon===void 0?{}:{icon:e.icon},...e.architecture?{architecture:!0}:{}}},g=e.subgraphs.map(h),_=e.edges.map(e=>{let t=m.get(e.source),n=m.get(e.target);return{source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:Ll(t,n),inlineStyle:{"stroke-width":Ol}}}),v=1/0,y=1/0,b=-1/0,x=-1/0;for(let e of p.values())v=Math.min(v,e.x),y=Math.min(y,e.y),b=Math.max(b,e.x+e.width),x=Math.max(x,e.y+e.height);for(let e of f)e.icon!==void 0&&(x=Math.max(x,e.y+e.height+El));for(let e of m.values())v=Math.min(v,e.x),y=Math.min(y,e.y),b=Math.max(b,e.x+e.width),x=Math.max(x,e.y+e.height);let S=t-v,C=t-y,w=e=>{e.x+=S,e.y+=C,e.children.forEach(w)};for(let e of f)e.x+=S,e.y+=C;g.forEach(w);for(let e of _)e.points=e.points.map(e=>({x:e.x+S,y:e.y+C}));return{width:b-v+t*2,height:x-y+t*2,nodes:f,edges:_,groups:g}}var Il=(e,t,n,r)=>{let i=Math.max(e,n),a=Math.min(t,r);return i<a||i===a&&e===t?(i+a)/2:void 0};function Ll(e,t){let n=Il(e.y,e.y+e.height,t.y,t.y+t.height);if(n!==void 0){let[r,i]=e.x<=t.x?[e,t]:[t,e],a=[{x:r.x+r.width,y:n},{x:i.x,y:n}];return r===e?a:a.reverse()}let r=Il(e.x,e.x+e.width,t.x,t.x+t.width);if(r!==void 0){let[n,i]=e.y<=t.y?[e,t]:[t,e],a=[{x:r,y:n.y+n.height},{x:r,y:i.y}];return n===e?a:a.reverse()}let i=e.y+e.height/2,a=t.x+t.width/2;return[{x:t.x>e.x?e.x+e.width:e.x,y:i},{x:a,y:i},{x:a,y:t.y>e.y?t.y:t.y+t.height}]}var Rl={type:`xychart`,parse:t.parseXYChart,layoutForSvg:Ga,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return ro(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},zl={type:`sequence`,parse:t.parseSequenceDiagram,layoutForSvg:va,renderSvg(e,t){return ya(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function Bl(e){return(e.interactivity??`static`)!==`none`}function Vl(e){return(e.interactivity??`static`)===`full`}var Hl={type:`class`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).classLayout;return{...(0,t.parseClassDiagram)(n),...i&&{layout:i}}},layoutForSvg:Zr,renderSvg(e,t,n){return ri(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,Bl(n),t.emit)}},Ul={type:`er`,parse(n,r){let i=(0,e.extractInitConfig)(r.split(/\r\n?|\n/)).erLayout;return{...(0,t.parseErDiagram)(n),...i&&{layout:i}}},layoutForSvg(t,n){return Ni((0,e.withDirectionOverride)(t,n.direction),n)},renderSvg(e,t){return Ii(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},Wl={type:`flowchart`,parse:(e,n)=>(0,t.parseMermaid)(n),layoutForSvg(t,n){return{graph:qt((0,e.withDirectionOverride)(t,n.direction),n),curve:n.curve??`linear`}},renderSvg(e,t,n){return an(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,Vl(n),Bl(n),t.title,t.decorative,t.emit)}},Gl={type:`c4`,parse:t.parseC4Diagram,layoutForSvg(e,t){return el(e,t)},renderSvg(e,t){return tl(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},Kl={xychart:Rl,er:Ul,sequence:zl,class:Hl,flowchart:Wl,architecture:{type:`architecture`,parse:t.parseArchitecture,layoutForSvg(n,r){return{graph:Fl((0,e.withDirectionOverride)((0,t.architectureToGraph)(n),r.direction),r.padding),curve:`linear`}},renderSvg:Wl.renderSvg},c4:Gl,pie:{type:`pie`,parse:(e,n)=>(0,t.parsePieChart)(n),layoutForSvg:(e,t)=>go(t.honorThemeVariables?e:{...e,sliceColors:void 0},t),renderSvg(e,t){return bo(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},quadrant:{type:`quadrant`,parse:(e,n)=>(0,t.parseQuadrantChart)(n),layoutForSvg:(e,t)=>wo(t.honorThemeVariables?e:{...e,themeColors:void 0}),renderSvg(e,t){return ko(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},mindmap:{type:`mindmap`,parse:(e,n)=>(0,t.parseMindmap)(n),layoutForSvg:e=>As(e),renderSvg(e,t){return Is(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},gantt:{type:`gantt`,parse:(e,n)=>(0,t.parseGantt)(n),layoutForSvg:e=>gl(e),renderSvg(e,t){return xl(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}},timeline:{type:`timeline`,parse:(e,n)=>(0,t.parseTimeline)(n),layoutForSvg:e=>$s(e),renderSvg(e,t){return nc(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}}},ql=54,Jl=18,Yl=-25;function Xl(t,n){let r=/<svg [^>]*>/.exec(t)[0],[,i,a]=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(r),o=Number(i),s=Number(a),c=Math.max(0,Math.ceil(((0,e.measureTextWidth)(n,Jl,400)-o)/2)),l=o+2*c,u=s+ql,d=r.replace(/viewBox="[^"]*"/,`viewBox="${-c} -54 ${l} ${u}"`).replace(/ width="[^"]*"/,` width="${l}"`).replace(/ height="[^"]*"/,` height="${u}"`),f=`<text x="${o/2}" y="${Yl}" text-anchor="middle" font-size="${Jl}" fill="var(--_text)" class="front-matter-title">${(0,e.escapeXml)(n)}</text>`;return t.replace(r,d).replace(/<\/svg>\s*$/,`${f}\n</svg>`)}function Zl(t){return{bg:t.bg??e.DEFAULTS.bg,fg:t.fg??e.DEFAULTS.fg,line:t.line,accent:t.accent,muted:t.muted??(t.bg||t.fg?void 0:e.DEFAULTS.muted),surface:t.surface,border:t.border}}function Ql(t={}){return(0,e.themeStyleDeclarations)(Zl(t),t.transparent)}function $l(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute,bodyFont:a(e)}}function eu(e,t={}){let{svg:n,colors:r}=ru(e,t),i=tu(n);return t.resolveColors?Rr(i,r):i}function tu(e){let t=new Set(Array.from(e.matchAll(/\sid="([^"]+)"/g),e=>e[1]??``));if(t.size===0)return e;let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=`zm${(n>>>0).toString(36)}-`,i=e=>t.has(e)&&!e.startsWith(`zm-`)?r+e:e;return e.replace(/(\sid=")([^"]+)"/g,(e,t,n)=>`${t}${i(n)}"`).replace(/url\(#([^)]+)\)/g,(e,t)=>`url(#${i(t)})`).replace(/(href=")#([^"]+)"/g,(e,t,n)=>`${t}#${i(n)}"`)}function nu(t){let r=(0,e.extractAccessibility)((0,n.decodeXML)(t)).text;Kl[(0,e.detectDiagramType)(r)].parse((0,e.splitStatements)(r),r)}function ru(t,r){(0,e.checkLimit)(`maxInputLength`,t.length,r.limits),(0,e.checkLineLength)(t,r.limits);let i=(0,e.extractAccessibility)((0,n.decodeXML)(t)),a=i.text,o=r.font??`Inter`;(0,e.setMonospaceMetrics)((0,e.isMonospaceFont)(o));let s=r.transparent??!1,c=ne(r.fontSizes),l=(0,e.detectDiagramType)(a),u=r.embedSource?t:void 0,d=r.title??i.accTitle,f=r.decorative,p={...$l(r),description:i.accDescr},m=(0,e.splitStatements)(a),h=Kl[l],g=h.parse(m,a);l===`c4`&&i.accTitle&&(g.title=i.accTitle.replace(/\s+/g,` `));let _=g;_.nodes instanceof Map&&Array.isArray(_.edges)&&(0,e.checkGraphSize)(_.nodes.size,_.edges.length,r.limits);let v=h.layoutForSvg(g,r),y=Zl(r.honorThemeVariables?(0,e.applyThemeVariables)(r,g.initConfig):r),b={colors:y,font:o,transparent:s,fontSizes:c,embedSource:u,title:d,decorative:f,emit:p},x=h.renderSvg(v,b,r);return i.frontMatterTitle&&(x=Xl(x,i.frontMatterTitle)),{svg:x,colors:y}}async function iu(e,t={}){return t.embedFont===`subset`&&await i(),eu(e,t)}var au=eu,ou=iu;exports.ACTOR_LABEL_OFFSET=Xi,exports.ARROW_HEAD=ae,exports.ASYMMETRIC_NOTCH=ie,exports.CLS=z,exports.ELK_DIRECTION_FALLBACK=le,exports.ElkNotRegisteredError=v,exports.FONT_SIZES=j,exports.FONT_WEIGHTS=M,exports.GROUP_HEADER_CONTENT_PAD=re,exports.INLINE_CENTERED_EDGE_LABEL=me,exports.MINDMAP=gs,exports.MONO_FONT=ee,exports.MONO_FONT_STACK=te,exports.NODE_PADDING=N,exports.PIE=G,exports.QUADRANT=xo,exports.SELF_LOOP_CONTROL=Ki,exports.SELF_LOOP_EXTENT=qi,exports.SELF_LOOP_HEIGHT=Ji,exports.STROKE_WIDTHS=P,exports.TEXT_BASELINE_SHIFT=F,exports.TIMELINE=Vs,exports.baseElkLayoutOptions=fe,exports.boxLabelHeight=Yi,exports.buildElkEdge=ge,exports.buildElkEdgeLabel=he,exports.buildElkLeafNode=pe,exports.buildSvgStyleBlock=oe,exports.classBackEdges=Jr,exports.classNoteId=Ur,exports.clipEdgeToShape=qe,exports.convertToElkFormat=Yt,exports.createLayoutCache=C,exports.directionToElk=ue,exports.elkLayoutSync=E,exports.elkPadding=de,exports.estimateMonoTextWidth=A,exports.estimateTextWidth=k,exports.evaluateCssColorValue=Mr,exports.extractEdgeLabelPosition=dt,exports.extractEdgePoints=ut,exports.formatTickLabels=eo,exports.hasLabelBelowIcon=ea,exports.layoutClassDiagramSync=Zr,exports.layoutErDiagramSync=Ni,exports.layoutFlowchartSync=qt,exports.layoutGraphSync=Kt,exports.layoutMindmap=As,exports.layoutPieChart=go,exports.layoutQuadrantChart=wo,exports.layoutSequenceDiagram=va,exports.layoutTimeline=$s,exports.layoutXYChart=Ga,exports.loadEmbeddedFont=i,Object.defineProperty(exports,"niceTickValues",{enumerable:!0,get:function(){return e.niceTickValues}}),exports.pieColorValue=vo,exports.pointsToPath=p,exports.registerElk=y,exports.renderClassSvg=ri,exports.renderErSvg=Ii,exports.renderMermaid=ou,exports.renderMermaidSVG=eu,exports.renderMermaidSVGAsync=iu,exports.renderMermaidSync=au,exports.renderMindmapSvg=Is,exports.renderPieSvg=bo,exports.renderQuadrantSvg=ko,exports.renderSequenceSvg=ya,exports.renderSvg=an,exports.renderTimelineSvg=nc,exports.renderXYChartSvg=ro,exports.resolveCssColors=Rr,exports.resolveFontSizes=ne,exports.smoothCurvePath=oo,exports.straightLinePath=ao,exports.themeCssVariables=Ql,exports.timelineTextWidth=Hs,exports.validateMermaid=nu,exports.withDataSrc=Cr,exports.wrapTimelineText=Us,exports.xLabelStep=Za;
|