@zombie-mermaid/svg-renderer 5.14.0 → 5.14.1

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/dist/index.cjs CHANGED
@@ -5,20 +5,20 @@ 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 D(t,n,r){return(0,e.measureTextWidth)(t,n,r)}function O(e,t){return e.length*t*.6}var k=`'JetBrains Mono'`,A=`${k}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,j={nodeLabel:13,edgeLabel:11,groupHeader:12};function M(e){return{nodeLabel:e?.nodeLabel??j.nodeLabel,edgeLabel:e?.edgeLabel??j.edgeLabel,groupHeader:e?.groupHeader??j.groupHeader}}var N={nodeLabel:500,edgeLabel:400,groupHeader:600},ee=12,te=12,P={horizontal:20,vertical:10,diamondExtra:24},F={outerBox:1,innerBox:.75,connector:1},I=`0.35em`,L={width:8,height:5};function R(t,n,r,i){return(0,e.buildStyleBlock)(t,n?{family:T,faceCss:E}:!1,r,i)}var z={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!0,thoroughness:3,fontSizes:j},ne={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,c4:`DOWN`};function re(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 ie(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 ae(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":ie(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function oe(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var se={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function ce(t,n){let r=(0,e.measureMultilineText)(t,n.fontSize,N.edgeLabel),i={text:t,width:r.width+8,height:r.height+6};return n.layoutOptions&&(i.layoutOptions={...n.layoutOptions}),i}function le(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[ce(e.label,e.labelStyle)]),t}var ue={"state-start":`FIRST`},de={"elk.layered.cycleBreaking.strategy":`MODEL_ORDER`,"elk.layered.compaction.postCompaction.strategy":`NONE`};function fe(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var B={top:44,left:16,bottom:16,right:16},pe={top:16,left:16,bottom:16,right:16};function me(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}var he=new WeakMap;function ge(t,n){let r=he.get(t);return r||(r=fe(t)||Ce(t.subgraphs)?new Set:(0,e.findBackEdgeIndexes)(t,n?.walkOrder,n?.feedbackEdges??(0,e.subgraphFeedbackEdges)(t)),he.set(t,r)),r}function _e(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 ve(e){return re(e,ne.flowchart)}function ye(e){return{...ae(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 be(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:se}}function xe(t,n,r,i){let a=(0,e.measureMultilineText)(n,i,N.nodeLabel),o=a.width+P.horizontal*2,s=a.height+P.vertical*2;if(r===`diamond`){let e=Math.max(o,s)+P.diamondExtra;o=e,s=e}if(r===`circle`||r===`doublecircle`){let e=Math.ceil(Math.sqrt(o*o+s*s))+8;o=r===`doublecircle`?e+12:e,s=o}return r===`hexagon`&&(o+=P.horizontal),(r===`trapezoid`||r===`trapezoid-alt`||r===`parallelogram`||r===`parallelogram-alt`)&&(o+=P.horizontal),r===`asymmetric`&&(o+=12),r===`cylinder`&&(s+=14),r===`state-start`||r===`state-end`||n===``&&r===`diamond`?{width:28,height:28}:n===``&&r===`fork-join`?{width:70,height:10}:(o=Math.max(o,60),s=Math.max(s,36),{width:o,height:s})}var Se=` root`;function Ce(e){for(let t of e)if(t.direction!==void 0||Ce(t.children))return!0;return!1}function we(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)we(n,t)}function Te(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 Ee(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function De(e,t,n){let r=t,i=new Set,a=new Set;for(let t of e.subgraphs)a.add(t.id),ke(t,i,a);let o=Ae(e.subgraphs),s=Te(e.subgraphs),c=e=>e?s.get(e)??[]:[],l=new Map;l.set(null,[]);let u=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=o.get(n.source),i=o.get(n.target);if(r&&r===i){let e=l.get(r)??[];l.set(r,e),e.push({index:t,edge:n})}else!r&&!i?l.get(null).push({index:t,edge:n}):u.push({index:t,edge:n,srcChain:c(r),tgtChain:c(i)})}let d=Ce(e.subgraphs),f=[],p=[],m={...ye({direction:ve(e.direction),nodeSpacing:r.nodeSpacing,layerSpacing:r.layerSpacing,padding:r.padding}),"elk.layered.thoroughness":String(z.thoroughness),"elk.layered.highDegreeNodes.treatment":`false`,"elk.layered.compaction.postCompaction.strategy":(e.subgraphs.length===0||me(e))&&!n?.forceNodeOrder?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...me(e)?{"elk.spacing.edgeEdge":`40`}:{},...n?.forceNodeOrder?{"elk.layered.crossingMinimization.forceNodeModelOrder":`true`}:{},...fe(e)?de:{},"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":d?`SEPARATE`:`INCLUDE_CHILDREN`},h=new Map,g=new Map;function _(e,t){let n=h.get(e)??new Set;h.set(e,n),n.add(t)}function v(e,t){let n=g.get(e)??[];g.set(e,n),n.push(t)}if(d)for(let{index:e,edge:t,srcChain:n,tgtChain:i}of u){let a=Ee(n,i),o=t.source;if(n.length>a){for(let r=n.length-1;r>=a;r--){let i=n[r],a=`${i}_out_${e}`;_(i,a);let o=r===n.length-1?t.source:`${n[r+1]}_out_${e}`;v(i,{id:`e${e}_s${r}`,sources:[o],targets:[a]})}o=`${n[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}`;_(r,a);let o=n===i.length-1?t.target:`${i[n+1]}_in_${e}`;v(r,{id:`e${e}_t${n}`,sources:[a],targets:[o]})}s=`${i[a]}_in_${e}`}v(a>0?n[a-1]:Se,le({id:`e${e}`,source:o,target:s,label:t.label,labelStyle:be(r)}))}for(let[t,o]of e.nodes)if(!i.has(t)&&!a.has(t)){let i=xe(t,o.label,o.shape,r.fontSizes.nodeLabel),a=n?.fixedWidths?.get(t);a!==void 0&&(i.width=a);let s=oe(t,i,o.label),c=fe(e)?ue[o.shape]:void 0;c!==void 0&&(s.layoutOptions={"elk.layered.layering.layerConstraint":c}),f.push(s)}let y=fe(e),b=f.length,x=y?e.subgraphs:[...e.subgraphs].reverse();for(let t of x)f.push(Oe(t,e,r,l,h,g,e.direction));if(y&&e.subgraphs.length>0){let t=f.map((t,n)=>{if(n<b)return _e(e,new Set([t.id]));let r=e.subgraphs[n-b],i=_e(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return we(r,a),_e(e,a)}),n=f.map((e,t)=>t).sort((e,n)=>t[e]-t[n]||e-n).map(e=>f[e]);f.splice(0,f.length,...n)}let S=ge(e,n),C=n?.feedbackEdges,w=l.get(null),T=C?.size?[...w.filter(e=>C.has(e.index)),...w.filter(e=>!C.has(e.index))]:w;for(let{index:e,edge:t}of T){if(t.source===t.target||n?.detachedEdges?.has(e))continue;let i=le({id:`e${e}`,source:S.has(e)?t.target:t.source,target:S.has(e)?t.source:t.target,label:t.label,labelStyle:be(r)});n?.looseEdges?.has(e)&&(i.layoutOptions={...i.layoutOptions,"elk.layered.priority.straightness":`0`}),p.push(i)}if(d)for(let e of g.get(Se)??[])p.push(e);else for(let{index:e,edge:t}of u)p.push(le({id:`e${e}`,source:S.has(e)?t.target:t.source,target:S.has(e)?t.source:t.target,label:t.label,labelStyle:be(r)}));return{id:`root`,layoutOptions:m,children:f,edges:p}}function Oe(t,n,r,i,a,o,s){let c=t.direction!==void 0&&(0,e.subgraphDirectionIsHonored)(t,n)?t.direction:s,l=ye({direction:ve(c),nodeSpacing:r.nodeSpacing,layerSpacing:r.layerSpacing,padding:t.region?pe:B}),u,d=a.get(t.id);d&&d.size>0&&(u=[...d].map(e=>({id:e})));let f=[];for(let e of t.nodeIds){let t=n.nodes.get(e);if(t){let n=xe(e,t.label,t.shape,r.fontSizes.nodeLabel);f.push(oe(e,n,t.label))}}let p=t.children.some(e=>e.region)?t.children:[...t.children].reverse();for(let e of p)f.push(Oe(e,n,r,i,a,o,c));let m=[],h=i.get(t.id)??[],g=ge(n);for(let{index:e,edge:t}of h)t.source!==t.target&&m.push(le({id:`e${e}`,source:g.has(e)?t.target:t.source,target:g.has(e)?t.source:t.target,label:t.label,labelStyle:be(r)}));for(let e of o.get(t.id)??[])m.push(e);return{id:t.id,layoutOptions:l,labels:t.label?[{text:t.label}]:void 0,ports:u,children:f,edges:m}}function ke(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),ke(r,t,n)}function Ae(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 je(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]=Me(e[0],e[1],t);else{let n=e.length-1;r[n]=Me(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 Me(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?Pe(t,c,a)??a:Pe(t,a,o)??a:t<=r?Pe(t,s,c)??s:Pe(t,o,s)??s}{let t=e.y;return l>0?t<=i?Ne(t,a,c)??c:Ne(t,c,s)??c:t<=i?Ne(t,a,o)??o:Ne(t,o,s)??o}}function Ne(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 Pe(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 Fe=12;function Ie(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=z.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))}}if(l.size===0)return;let u=r?`x`:`y`,d=(e,t,n,r)=>{let i=e[t],a=i[u];i[u]+=r;let[o,s,c]=[1,2,3].map(r=>e[t+r*n]);if(o[u]===a)o[u]+=r;else if(s&&c&&s[u]===o[u]){let e=Math.sign(o[u]-a),t=o[u]+e*Math.max(0,Fe-e*(o[u]-i[u]));e*(c[u]-t)>0&&(o[u]=s[u]=t)}};for(let e of t){let{points:t}=e;if(t.length<2)continue;let n=l.get(e.source),r=l.get(e.target);n!=null&&d(t,0,1,n),r!=null&&d(t,t.length-1,-1,r)}}var Le=.5;function Re(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+Le,r=e.x+e.width-Le,i=e.y+Le,a=e.y+e.height-Le;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function ze(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(...ze(e,t,i.children)));return r}function Be(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(ze(t,n,r).map(e=>e.id)),u=ze(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 Ve=2;function He(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)<=Ve)return!0}return!1}function Ue(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(He(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=Be(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}];Re(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(He(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=Be(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}];Re(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(He(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=Be(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}];Re(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(He(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=Be(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}];Re(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 We=1.5,Ge=.01;function Ke(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)<Ge&&Math.abs(i.x-a.x)<Ge&&Math.abs(r.y-i.y)<Ge&&Math.abs(r.x-i.x)<=We&&Math.abs(r.x-i.x)>=Ge,s=Math.abs(e.y-r.y)<Ge&&Math.abs(i.y-a.y)<Ge&&Math.abs(r.x-i.x)<Ge&&Math.abs(r.y-i.y)<=We&&Math.abs(r.y-i.y)>=Ge;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 qe(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 Je(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 Ye=16,Xe=28,Ze=18,Qe=28,$e=10;function et(e,t){let n=e.x+e.width,r=e.y+e.height/2,i=Math.min(Qe,e.height*.6)/2,a=Xe+t*Ze,o=[];for(let e=0;e<=Ye;e++){let t=Math.PI*e/Ye;o.push({x:n+a*Math.sin(t),y:r-i*Math.cos(t)})}return{points:o,labelPosition:{x:n+a+$e,y:r}}}function tt(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}=et(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:pt(i,e),id:a.id,animate:a.animate})}}function nt(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(...nt(n.children));return t}function rt(e,t,n=!1){let r=[],i=[],a=[],o=new Set;for(let e of t.subgraphs)ft(e,o);it(e,t,o,r,a,0,0);let s=nt(a);st(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),Ie(r,i,t.direction);let c=new Map(r.map(e=>[e.id,e]));tt(t,c,i),n&&Ue(i,r,a,t.direction);for(let e of i){e.points=Ke(e.points);let t=c.get(e.source),n=c.get(e.target);t&&(e.points=je(e.points,t,!0)),n&&(e.points=je(e.points,n,!1))}let l=e.width??800,u=e.height??600,d=L.width,f=z.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 it(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 e=[];it(c,n,r,i,e,t,l);let o=dt(n.subgraphs,c.id);a.push({id:c.id,label:o?.label??``,x:t,y:l,width:u,height:d,children:e,...o?.region?{region:!0}:{}})}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.shape,x:t,y:l,width:u,height:d,inlineStyle:r,className:a,interaction:n.interactions.get(c.id)})}c.children&&c.children.length>0&&it(c,n,r,i,a,t,l)}}}function at(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 ot(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 st(e,t,n,r,i,a){let o=new Map;ct(e,o,0,0);let s=new Map;ut(e,s,0,0,o);let c=0;for(let[e,r]of s){let i=t.edges[e];if(!i)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??ot(o));let f=lt(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=ot(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:ge(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:pt(e,t),id:i.id,animate:i.animate})}}function ct(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;ct(i,t,n+e,r+a)}}function lt(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 ut(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=at(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=qe(a,l,u),f=Je(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)ut(a,t,n+(a.x??0),r+(a.y??0),i)}function dt(e,t){for(let n of e){if(n.id===t)return n;let e=dt(n.children,t);if(e)return e}}function ft(e,t){t.add(e.id);for(let n of e.children)ft(n,t)}function pt(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=10,ht=14,gt=14,_t=10,vt=24,yt=400,bt=new Set([`rectangle`,`rounded`,`subroutine`]);function xt(e){let t=e===`TD`||e===`TB`||e===`BT`,n=e===`BT`||e===`RL`?-1:1;return{span:e=>{let[r,i]=t?[e.y,e.y+e.height]:[e.x,e.x+e.width],a=n*r,o=n*i;return{a0:Math.min(a,o),a1:Math.max(a,o),c0:t?e.x:e.y,c1:t?e.x+e.width:e.y+e.height}},toPoint:({a:e,c:r})=>t?{x:r,y:n*e}:{x:n*e,y:r}}}function St(e,t,n){let r=Math.min(e.a,t.a),i=Math.max(e.a,t.a),a=Math.min(e.c,t.c),o=Math.max(e.c,t.c);return i>n.a0&&r<n.a1&&o>n.c0&&a<n.c1}var Ct=(e,t)=>({a0:e.a0-t,a1:e.a1+t,c0:e.c0-t,c1:e.c1+t});function wt(e,t){let n=e.span({x:t.x,y:t.y,width:0,height:0});return{a:n.a0,c:n.c0}}function Tt(e,t,n){let r=e.c===t.c;for(let i=1;i<n.length;i++){let a=n[i-1],o=n[i];if(a.c===o.c===r){if(r){let n=Math.abs(e.c-a.c),r=Math.min(Math.max(e.a,t.a),Math.max(a.a,o.a))-Math.max(Math.min(e.a,t.a),Math.min(a.a,o.a));if(n<ht&&r>0)return!0}else{let n=Math.abs(e.a-a.a),r=Math.min(Math.max(e.c,t.c),Math.max(a.c,o.c))-Math.max(Math.min(e.c,t.c),Math.min(a.c,o.c));if(n<ht&&r>0)return!0}}}return!1}function Et(e){let t=[];for(let n of e){let e=t[t.length-1];e&&e.a===n.a&&e.c===n.c||t.push(n)}for(let e=t.length-2;e>0;e--){let n=t[e-1],r=t[e],i=t[e+1];(n.a===r.a&&r.a===i.a||n.c===r.c&&r.c===i.c)&&t.splice(e,1)}return t}var Dt=e=>{let t=0;for(let n=1;n<e.length;n++)t+=Math.abs(e[n].a-e[n-1].a)+Math.abs(e[n].c-e[n-1].c);return t};function Ot(e,t,n,r,i,a=[]){let o=xt(i),s=o.span(e),c=o.span(t),l=s.a1<=c.a0,u=c.a1<=s.a0;if(!l&&!u)return;let d=o.span(r),f={a0:d.a0+_t,a1:d.a1-_t,c0:d.c0+_t,c1:d.c1-_t},p=a.map(e=>e.map(e=>wt(o,e))),m=n.map(e=>Ct(o.span(e),mt)),h=e=>(e.c0+e.c1)/2,g=e=>(e.a0+e.a1)/2,_=e=>bt.has(e.shape),v=e=>{for(let t of e)if(t.a<f.a0||t.a>f.a1||t.c<f.c0||t.c>f.c1)return!1;for(let t=1;t<e.length;t++){let n=e[t-1],r=e[t];if(n.a!==r.a&&n.c!==r.c||m.some(e=>St(n,r,e))||St(n,r,s)||St(n,r,c)||p.some(e=>Tt(n,r,e)))return!1}return!0},y=new Set([h(s),h(c),f.c0,f.c1]);for(let e of m)y.add(e.c0-1),y.add(e.c1+1);for(let e of[s,c])y.add(e.c0-mt),y.add(e.c1+mt);let b=(e,t,n)=>_(e)?n>=t.c0+4&&n<=t.c1-4:Math.abs(n-h(t))<.5,x=[];if(l){let n=(c.a0-s.a1)/2,r=s.a1+Math.min(gt,n),i=c.a0-Math.min(gt,n);for(let n of y){b(e,s,n)&&b(t,c,n)&&x.push([{a:s.a1,c:n},{a:c.a0,c:n}]),x.push([{a:s.a1,c:h(s)},{a:r,c:h(s)},{a:r,c:n},{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}]),b(t,c,n)&&x.push([{a:s.a1,c:h(s)},{a:r,c:h(s)},{a:r,c:n},{a:c.a0,c:n}]),b(e,s,n)&&x.push([{a:s.a1,c:n},{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}]);let a=n>=s.c1?s.c1:n<=s.c0?s.c0:void 0;if(a!==void 0){let e=b(t,c,n)?[{a:c.a0,c:n}]:[{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}];x.push([{a:g(s),c:a},{a:g(s),c:n},...e])}}}else for(let t of y){let n=t>=c.c1?c.c1:t<=c.c0?c.c0:void 0;if(n===void 0)continue;b(e,s,t)&&x.push([{a:s.a0,c:t},{a:g(c),c:t},{a:g(c),c:n}]);let r=n===c.c1?s.c1:s.c0;x.push([{a:g(s),c:r},{a:g(s),c:t},{a:g(c),c:t},{a:g(c),c:n}])}let S,C=1/0;for(let t of x){let n=Et(t);if(n.length<2||!v(n))continue;let r=e.shape===`diamond`&&n[0].a===s.a1?yt:0,i=Dt(n)+vt*(n.length-2)+r;i<C&&(S=n,C=i)}return S?.map(o.toPoint)}function kt(e){let t={x:e[0].x,y:e[0].y},n=-1;for(let r=1;r<e.length;r++){let i=e[r-1],a=e[r],o=Math.abs(a.x-i.x)+Math.abs(a.y-i.y);o>n&&(n=o,t={x:(i.x+a.x)/2,y:(i.y+a.y)/2})}return t}var At=`__zm_spine__`,jt=8,Mt=6,Nt=12,Pt=4,Ft=4,It=.25,Lt=.02,Rt=40,zt=e=>e===`TD`||e===`TB`||e===`BT`,Bt=e=>e.startsWith(At);function Vt(e){return e.flatMap(e=>[e,...Vt(e.children)])}function V(e){let t=new Set(e.nodeIds);for(let n of e.children)for(let e of V(n))t.add(e);return t}function Ht(e){if(e.subgraphs.length===0||fe(e)||Ce(e.subgraphs))return!1;for(let t of e.nodes.keys())if(Bt(t))return!1;for(let t of e.edges)if(!e.nodes.has(t.source)||!e.nodes.has(t.target))return!1;let t=Vt(e.subgraphs);return!t.some(t=>e.nodes.has(t.id))&&t.every(t=>[...V(t)].some(t=>e.nodes.has(t)))}function Ut(e,t){let n=zt(t),r=e=>n?[e.y,e.y+e.height]:[e.x,e.x+e.width],i=[...e].sort((e,t)=>{let[n,i]=r(e),[a,o]=r(t);return(n+i)/2-(a+o)/2}),a=[];for(let e of i){let[t,n]=r(e),i=a[a.length-1];i&&t<i.end?(i.end=Math.min(i.end,n),i.ids.push(e.id)):a.push({end:n,ids:[e.id]})}(t===`BT`||t===`RL`)&&a.reverse();let o=new Map;return a.forEach((e,t)=>e.ids.forEach(e=>o.set(e,t))),o}function Wt(e,t,n){let r={ghosts:[],edges:[]};for(let i of e){let e=[...V(i)].filter(e=>t.has(e));if(e.length===0)continue;let a=e.map(e=>t.get(e)),o=Math.min(...a),s=Math.max(...a),c=new Map;for(let a=o;a<=s;a++){let o=e.filter(e=>t.get(e)===a).sort((e,t)=>n(e)-n(t));if(o.length>0)c.set(a,o[0]);else{let e=`${At}${i.id}__${a}`;r.ghosts.push({id:e,subgraph:i.id}),c.set(a,e)}}for(let e=o;e<s;e++){let t=c.get(e),n=c.get(e+1);!Bt(t)&&!Bt(n)||r.edges.push({source:t,target:n,style:`invisible`,hasArrowStart:!1,hasArrowEnd:!1})}}return r}function Gt(e,t,n,r=()=>!1,i=()=>!1){let a=e=>{let n=[...V(e)].filter(e=>t.has(e)).map(e=>t.get(e));return n.length>0?[Math.min(...n),Math.max(...n)]:void 0},o=e=>{let t=[...V(e)].filter(e=>n.has(e)).map(e=>n.get(e));return t.reduce((e,t)=>e+t,0)/t.length},s=e.map(e=>({sg:e,at:a(e)})).filter(e=>!!e.at).sort((e,t)=>e.at[0]-t.at[0]),c=[],l=-1/0;for(let{sg:e,at:t}of s){let n=c[c.length-1];n&&t[0]<=l?(n.push(e),l=Math.max(l,t[1])):(c.push([e]),l=t[1])}for(let t of c){if(t.length<2||t.some((e,n)=>t.slice(n+1).some(t=>r(e,t))))continue;let a=t.some(e=>e.region)||t.some((e,n)=>t.slice(n+1).some(t=>i(e,t)))?-1:1,s=[...t].sort((t,n)=>a*(e.indexOf(n)-e.indexOf(t))),c=t.map(o).sort((e,t)=>e-t),l=s.map((e,t)=>c[t]-o(e));s.forEach((e,t)=>{for(let r of V(e))n.has(r)&&n.set(r,n.get(r)+l[t])})}for(let a of e)Gt(a.children,t,n,r,i)}function Kt(e,t,n,r,i){let a=new Map(t);for(let t of r){let r=V(t);for(let e of i.get(t.id)??[])r.add(e);let o=[...r].filter(e=>a.has(e)),s=o.filter(e=>n.has(e));if(s.length===0)continue;let c=Math.min(...s.map(e=>n.get(e))),l=Math.max(...s.map(e=>n.get(e))),u=o.map(e=>a.get(e)),d=Math.min(...u),f=Math.max(...u),p=(d+f)/2,m=0;for(let t of e){if(r.has(t)||Bt(t))continue;let e=n.get(t);if(e===void 0||e<c||e>l)continue;m++;let i=a.get(t);a.set(t,i<=p?Math.min(i,d)-1-m*.001:Math.max(i,f)+1+m*.001)}}let o=new Map(e.map((e,t)=>[e,t]));return[...e].sort((e,t)=>a.get(e)-a.get(t)||o.get(e)-o.get(t))}var qt=(e,t)=>t>=Math.min(...e)&&t<=Math.max(...e);function Jt(t,n,r){let i=t=>{let a=t.children.map(i),o=[...[...V(t)].flatMap(e=>{let t=n.get(e);return t?[t]:[]}),...a],s=t.region?pe:B,c=Math.min(...o.map(e=>e.x))-s.left,l=Math.min(...o.map(e=>e.y))-s.top,u=Math.max(...o.map(e=>e.x+e.width))+s.right,d=Math.max(...o.map(e=>e.y+e.height))+s.bottom,f=t.region?0:(0,e.measureMultilineText)(t.label,r.groupHeader,N.groupHeader).width+24;return{id:t.id,label:t.label,x:c,y:l,width:Math.max(u-c,f),height:d-l,children:a,...t.region?{region:!0}:{}}};return t.map(i)}var Yt=e=>e.flatMap(e=>[e,...Yt(e.children)]);function Xt(e,t,n,r,i,a){let o=zt(r),s=new Map(Vt(t).map(e=>[e.id,V(e)])),c=new Map,l=!1,u=[],d=e=>o?[e.x,e.x+e.width]:[e.y,e.y+e.height],f=e=>o?[e.y,e.y+e.height]:[e.x,e.x+e.width],p=([e,t],[n,r])=>Math.max(0,Math.min(t,r)-Math.max(e,n)),m=e=>({x:e.x-Rt,y:e.y-Rt,width:e.width+80,height:e.height+80}),h=(e,t)=>p(f(e),f(t))>0?p(d(e),d(t)):0,g=Yt(e),_=new Map(g.map(e=>[e,m(e)])),v=(e,t,n,r)=>{let i=p(d(e),d(t)),a=p(f(e),f(t));if(i<=0||a<=0)return;let s=i<=a,c=s===o,l=e=>c?e.x:e.y,m=e=>c?e.x+e.width:e.y+e.height,h=e=>(l(e)+m(e))/2,g=h(n)<=h(r)?n:r;u.push({axis:c?`x`:`y`,amount:s?i:a,after:m(g)})};for(let e of g){let t=s.get(e.id),r=[...t].filter(e=>a.has(e)).map(e=>a.get(e)),o=new Set(r);for(let[s,u]of n){if(t.has(s))continue;if(o.has(a.get(s))||!qt(r,a.get(s))){v(_.get(e),u,e,u);continue}let n=h(_.get(e),u);n<=0||(i.has(e.id)?c.set(e.id,Math.max(c.get(e.id)??0,n)):l=!0)}}let y=(e,t)=>Yt(e.children).includes(t);for(let e=0;e<g.length;e++)for(let t=e+1;t<g.length;t++){let n=g[e],r=g[t];y(n,r)||y(r,n)||v(_.get(n),r,n,r)}return{penetration:c,stuck:l,requests:u}}function Zt(t,n,r){let i=[...t.nodes.keys()],a={...t,subgraphs:[]},o=(0,e.subgraphFeedbackEdges)(t),s=n(a,{feedbackEdges:o}),c=Ut(s.nodes,t.direction),l=zt(t.direction),u=new Map(s.nodes.map(e=>[e.id,e])),d=e=>{let t=u.get(e);return l?t.x:t.y},f=Vt(t.subgraphs),p=Wt(f,c,d),m=new Map;for(let e of p.ghosts)m.set(e.subgraph,[...m.get(e.subgraph)??[],e.id]);let h=new Map(s.nodes.map(e=>[e.id,d(e.id)]));Gt(t.subgraphs,c,h,(e,n)=>{let r=V(e),i=V(n),a=(e,n)=>t.edges.some(t=>e.has(t.source)&&n.has(t.target));return a(r,i)&&a(i,r)},(n,r)=>(0,e.subgraphsTied)(t,n,r));for(let e of p.ghosts){let t=[...V(f.find(t=>t.id===e.subgraph))].filter(e=>h.has(e)).map(e=>h.get(e));h.set(e.id,t.reduce((e,t)=>e+t,0)/t.length)}let g=new Map(t.nodes);for(let e of p.ghosts)g.set(e.id,{id:e.id,label:` `,shape:`rectangle`});let _=Kt([...g.keys()],h,c,f,m),v={...a,nodes:new Map(_.map(e=>[e,g.get(e)])),edges:[...t.edges,...p.edges]},y=new Set(p.edges.map((e,n)=>t.edges.length+n)),b=e=>{let a=new Map,s=new Map;for(let l=0;;l++){let u=new Map(p.ghosts.map(e=>[e.id,jt+(a.get(e.subgraph)??0)])),d=n(v,{fixedWidths:u,looseEdges:y,detachedEdges:e,walkOrder:i,feedbackEdges:o,forceNodeOrder:!0}),h=new Map(d.nodes.filter(e=>!Bt(e.id)).map(e=>[e.id,e])),g=Jt(t.subgraphs,h,r),_=Xt(g,t.subgraphs,h,t.direction,new Set(m.keys()),c),{penetration:b,stuck:x}=_;if(x)return;if(b.size===0){for(let e=0;_.requests.length>0;e++){if(e===Nt)return;en(_.requests.reduce((e,t)=>t.amount>e.amount?t:e),[...h.values()],d.edges),g=Jt(t.subgraphs,h,r),_=Xt(g,t.subgraphs,h,t.direction,new Set(m.keys()),c)}let n=$t(t,e,h,g,f);return n&&rn(d,[...h.values()],g,n,t.direction)}if(l===Mt)return;for(let[e,t]of b){let n=a.get(e)??0,r=s.get(e),i=r?(r.overlap-t)/(n-r.width):0,o=i>Lt?i:It;s.set(e,{width:n,overlap:t}),a.set(e,n+t/o+Ft)}}},x=Qt(t,p,c,f);return(x.size>0?b(x):void 0)??b(new Set)}function Qt(e,t,n,r){let i=r.map(e=>{let t=V(e);return{inside:t,layers:new Set([...t].filter(e=>n.has(e)).map(e=>n.get(e)))}}),a=e=>{let t=n.get(e.source),r=n.get(e.target);return t===void 0||r===void 0||e.source===e.target?!1:i.some(({inside:n,layers:i})=>n.has(e.source)&&n.has(e.target)&&Array.from({length:Math.max(0,Math.abs(r-t)-1)},(e,n)=>Math.min(t,r)+1+n).some(e=>!i.has(e)))},o=new Set;e.edges.forEach((e,t)=>{a(e)&&o.add(t)});let s=new Map,c=e=>{e.source!==e.target&&(s.set(e.source,(s.get(e.source)??0)+1),s.set(e.target,(s.get(e.target)??0)+1))};e.edges.forEach((e,t)=>{o.has(t)||c(e)}),t.edges.forEach(c);for(let t of[...o]){let n=e.edges[t];(!s.get(n.source)||!s.get(n.target))&&o.delete(t)}return o}function $t(e,t,n,r,i){let a=new Map(Yt(r).map(e=>[e.id,e])),o=[];for(let r of t){let t=e.edges[r],s=n.get(t.source),c=n.get(t.target),l=i.filter(e=>{let n=V(e);return n.has(t.source)&&n.has(t.target)}).sort((e,t)=>V(e).size-V(t).size)[0],u=l&&a.get(l.id);if(!s||!c||!u)return;let d=Ot(s,c,[...n.values()].filter(e=>e!==s&&e!==c),u,e.direction,o.map(e=>e.points));if(!d)return;o.push({source:t.source,target:t.target,label:t.label,style:t.style,hasArrowStart:t.hasArrowStart,hasArrowEnd:t.hasArrowEnd,points:d,labelPosition:t.label?kt(d):void 0,inlineStyle:pt(r,e),id:t.id,animate:t.animate})}return o}function en(e,t,n){let{axis:r,amount:i,after:a}=e,o=i+Pt,s=t.filter(e=>e[r]>=a),c=Math.min(...s.map(e=>e[r]));for(let e of s)e[r]+=o;let l=e=>{e[r]>=c&&(e[r]+=o)};for(let e of n)e.points.forEach(l),e.labelPosition&&l(e.labelPosition)}var tn=8;function nn(e,t,n,r){let i=zt(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)<tn&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?tn:-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}}function rn(e,t,n,r,i){let a=[...e.edges.filter(e=>!Bt(e.source)&&!Bt(e.target)),...r],o=Yt(n);nn(a,t,o,i);let s=[...t.map(e=>e.x),...o.map(e=>e.x),...a.flatMap(e=>e.points.map(e=>e.x))],c=[...t.map(e=>e.y),...o.map(e=>e.y),...a.flatMap(e=>e.points.map(e=>e.y))],l=z.padding-Math.min(...s),u=z.padding-Math.min(...c);for(let e of t)e.x+=l,e.y+=u;for(let e of o)e.x+=l,e.y+=u;for(let e of a){for(let t of e.points)t.x+=l,t.y+=u;e.labelPosition&&(e.labelPosition.x+=l,e.labelPosition.y+=u)}let d=0,f=0;for(let e of t)d=Math.max(d,e.x+e.width+z.padding),f=Math.max(f,e.y+e.height+z.padding);for(let e of o)d=Math.max(d,e.x+e.width+z.padding),f=Math.max(f,e.y+e.height+z.padding);for(let e of a){for(let t of e.points)d=Math.max(d,t.x+L.width+z.padding),f=Math.max(f,t.y+L.width+z.padding);e.labelPosition&&(d=Math.max(d,e.labelPosition.x+60+z.padding),f=Math.max(f,e.labelPosition.y+20+z.padding))}return{...e,nodes:t,edges:a,groups:n,width:d,height:f}}var an=12,on=8,sn=4;function cn(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=ln(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 ln(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<on&&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,an)),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)),un(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<sn;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 un(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 dn=28,fn=18,pn=10,mn=32;function hn(t,n={}){let r={...z,...n,fontSizes:M(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,N.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:B.bottom,axisEnd:B.top,crossStart:B.left,crossEnd:B.right}:{axisStart:B.top,axisEnd:B.bottom,crossStart:B.left,crossEnd:B.right}:{axisStart:a?B.right:B.left,axisEnd:a?B.left:B.right,crossStart:B.top,crossEnd:B.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=xe(e,n.label,n.shape,r.fontSizes.nodeLabel);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)+pn));return dn+(t.length-1)*fn+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,N.groupHeader).width,d=l.axisSize+v.axisStart+v.axisEnd,f=l.crossSize+v.crossStart+v.crossEnd,p=i?0:u+mn,m=i?u+mn: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=cn(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=(e,t,n)=>{for(let[r,i]of e.routes)T.set(r,{mids:i.mids.map(e=>({axis:e.axis+t,cross:e.cross+n})),label:i.label&&{axis:i.label.axis+t,cross:i.label.cross+n}});let r=[];for(let i of e.members){let a=e.at.get(i),s=e.sizes.get(i),c={axis:t+a.axis,cross:n+a.cross,...s};w.set(i,c);let l=e.inner.get(i);if(l){let e=o.get(i),t=E(l,c.axis+l.inset.axis,c.cross+l.inset.cross);r.push({id:i,label:e.label,x:0,y:0,width:0,height:0,children:t,...e.region?{region:!0}:{}})}}return r},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 te=l.map(n=>{let r=t.nodes.get(n);return{id:n,label:r.label,shape:r.shape,...j(w.get(n)),inlineStyle:(0,e.resolveNodeStyle)(n,t),className:t.classAssignments.get(n),interaction:t.interactions.get(n)}}),P=new Map(te.map(e=>[e.id,e])),F=[];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=Ke(gn(u.map(A)));o&&d.reverse();let f=P.get(e.source),p=P.get(e.target);f&&(d=je(d,f,!0)),p&&(d=je(d,p,!1)),F.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:pt(n,t),id:e.id,animate:e.animate})}),tt(t,P,F);let I=(i?C.crossSize:C.axisSize)+O*2,R=(i?C.axisSize:C.crossSize)+O*2;for(let e of F){for(let t of e.points)I=Math.max(I,t.x+L.width+O),R=Math.max(R,t.y+L.width+O);e.labelPosition&&(I=Math.max(I,e.labelPosition.x+60+O),R=Math.max(R,e.labelPosition.y+20+O))}return{width:I,height:R,nodes:te,edges:F,groups:D}}function gn(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 _n(e,t={}){return vn(e,t)}function vn(e,t,n){let r={...z,...t,fontSizes:M(t.fontSizes)};return rt(w(De(e,r,n),t.layoutCache),e,r.mergeEdges)}function yn(t,n={}){let r=(0,e.withoutOwnClusterEdges)(t);if(n.layout===`simple`&&!fe(r))return hn(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'.`);if(Ht(r)){let e=Zt(r,(e,t)=>vn(e,n,t),M(n.fontSizes));if(e)return e}return _n(r,n)}function bn(e,t={}){return De(e,{...z,...t,fontSizes:M(t.fontSizes)})}var xn=12,Sn=2;function Cn(e){return e.flatMap(e=>[e,...Cn(e.children)])}function wn(t,n){let r=n.groupHeader+16;return Cn(t).filter(e=>e.label!==``).map(t=>{let i=(0,e.measureMultilineText)(t.label,n.groupHeader,N.groupHeader);return{x:t.x+xn-Sn,y:t.y+r/2-i.height/2-Sn,width:i.width+4,height:i.height+4}})}function Tn(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+Sn,y:e.y+Sn,width:e.width-4,height:e.height-4}}function Dn(e,t){let n=e.points,r=t.map(En);for(let e=0;e+1<n.length;e++)if(r.some(t=>Tn(n[e],n[e+1],t)))return!0;return!1}function On(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 kn(e,t,n){let r=`zm-title-gap-${On(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(Dr((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(jn(f.nonce)),p.push(`<defs>`),p.push(Mn());let h=new Set;for(let e of t.edges)e.inlineStyle?.stroke&&h.add(e.inlineStyle.stroke);for(let e of h)p.push(Nn(e));let g=wn(t.groups,a),_=new Set(t.edges.filter(e=>Dn(e,g))),v;if(_.size>0){let e=kn(g,t.width,t.height);v=e.id,p.push(e.markup)}p.push(`</defs>`);for(let e of t.groups)p.push(In(e,r,a));for(let e of t.edges)p.push(Ln(e,o,c,_.has(e)?v:void 0));for(let e of t.edges)e.label&&p.push(zn(e,r,a));for(let e of t.nodes)p.push(Un(e,r,a,l));return p.push(`</svg>`),p.join(`
8
+ }`;function D(t,n,r){return(0,e.measureTextWidth)(t,n,r)}function O(e,t){return e.length*t*.6}var k=`'JetBrains Mono'`,ee=`${k}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,A={nodeLabel:13,edgeLabel:11,groupHeader:12};function j(e){return{nodeLabel:e?.nodeLabel??A.nodeLabel,edgeLabel:e?.edgeLabel??A.edgeLabel,groupHeader:e?.groupHeader??A.groupHeader}}var M={nodeLabel:500,edgeLabel:400,groupHeader:600},te=12,ne=12,N={horizontal:20,vertical:10,diamondExtra:24},P={outerBox:1,innerBox:.75,connector:1},F=`0.35em`,I={width:8,height:5};function L(t,n,r,i){return(0,e.buildStyleBlock)(t,n?{family:T,faceCss:E}:!1,r,i)}var R={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!0,thoroughness:3,fontSizes:A},re={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,c4:`DOWN`};function ie(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 ae(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 z(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":ae(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function B(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var oe={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function se(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 ce(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[se(e.label,e.labelStyle)]),t}var le={"state-start":`FIRST`},ue={"elk.layered.cycleBreaking.strategy":`MODEL_ORDER`,"elk.layered.compaction.postCompaction.strategy":`NONE`};function de(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var V={top:44,left:16,bottom:16,right:16},fe={top:16,left:16,bottom:16,right:16};function pe(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}var me=new WeakMap;function he(t,n){let r=me.get(t);return r||(r=de(t)||Se(t.subgraphs)?new Set:(0,e.findBackEdgeIndexes)(t,n?.walkOrder,n?.feedbackEdges??(0,e.subgraphFeedbackEdges)(t)),me.set(t,r)),r}function ge(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 _e(e){return ie(e,re.flowchart)}function ve(e){return{...z(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 ye(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:oe}}function be(t,n,r,i){let a=(0,e.measureMultilineText)(n,i,M.nodeLabel),o=a.width+N.horizontal*2,s=a.height+N.vertical*2;if(r===`diamond`){let e=Math.max(o,s)+N.diamondExtra;o=e,s=e}if(r===`circle`||r===`doublecircle`){let e=Math.ceil(Math.sqrt(o*o+s*s))+8;o=r===`doublecircle`?e+12:e,s=o}return r===`hexagon`&&(o+=N.horizontal),(r===`trapezoid`||r===`trapezoid-alt`||r===`parallelogram`||r===`parallelogram-alt`)&&(o+=N.horizontal),r===`asymmetric`&&(o+=12),r===`cylinder`&&(s+=14),r===`state-start`||r===`state-end`||n===``&&r===`diamond`?{width:28,height:28}:n===``&&r===`fork-join`?{width:70,height:10}:(o=Math.max(o,60),s=Math.max(s,36),{width:o,height:s})}var xe=` root`;function Se(e){for(let t of e)if(t.direction!==void 0||Se(t.children))return!0;return!1}function Ce(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)Ce(n,t)}function we(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 Te(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function Ee(e,t,n){let r=t,i=new Set,a=new Set;for(let t of e.subgraphs)a.add(t.id),Oe(t,i,a);let o=ke(e.subgraphs),s=we(e.subgraphs),c=e=>e?s.get(e)??[]:[],l=new Map;l.set(null,[]);let u=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=o.get(n.source),i=o.get(n.target);if(r&&r===i){let e=l.get(r)??[];l.set(r,e),e.push({index:t,edge:n})}else!r&&!i?l.get(null).push({index:t,edge:n}):u.push({index:t,edge:n,srcChain:c(r),tgtChain:c(i)})}let d=Se(e.subgraphs),f=[],p=[],m={...ve({direction:_e(e.direction),nodeSpacing:r.nodeSpacing,layerSpacing:r.layerSpacing,padding:r.padding}),"elk.layered.thoroughness":String(R.thoroughness),"elk.layered.highDegreeNodes.treatment":`false`,"elk.layered.compaction.postCompaction.strategy":(e.subgraphs.length===0||pe(e))&&!n?.forceNodeOrder?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...pe(e)?{"elk.spacing.edgeEdge":`40`}:{},...n?.forceNodeOrder?{"elk.layered.crossingMinimization.forceNodeModelOrder":`true`}:{},...de(e)?ue:{},"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":d?`SEPARATE`:`INCLUDE_CHILDREN`},h=new Map,g=new Map;function _(e,t){let n=h.get(e)??new Set;h.set(e,n),n.add(t)}function v(e,t){let n=g.get(e)??[];g.set(e,n),n.push(t)}if(d)for(let{index:e,edge:t,srcChain:n,tgtChain:i}of u){let a=Te(n,i),o=t.source;if(n.length>a){for(let r=n.length-1;r>=a;r--){let i=n[r],a=`${i}_out_${e}`;_(i,a);let o=r===n.length-1?t.source:`${n[r+1]}_out_${e}`;v(i,{id:`e${e}_s${r}`,sources:[o],targets:[a]})}o=`${n[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}`;_(r,a);let o=n===i.length-1?t.target:`${i[n+1]}_in_${e}`;v(r,{id:`e${e}_t${n}`,sources:[a],targets:[o]})}s=`${i[a]}_in_${e}`}v(a>0?n[a-1]:xe,ce({id:`e${e}`,source:o,target:s,label:t.label,labelStyle:ye(r)}))}for(let[t,o]of e.nodes)if(!i.has(t)&&!a.has(t)){let i=be(t,o.label,o.shape,r.fontSizes.nodeLabel),a=n?.fixedWidths?.get(t);a!==void 0&&(i.width=a);let s=B(t,i,o.label),c=de(e)?le[o.shape]:void 0;c!==void 0&&(s.layoutOptions={"elk.layered.layering.layerConstraint":c}),f.push(s)}let y=de(e),b=f.length,x=y?e.subgraphs:[...e.subgraphs].reverse();for(let t of x)f.push(De(t,e,r,l,h,g,e.direction));if(y&&e.subgraphs.length>0){let t=f.map((t,n)=>{if(n<b)return ge(e,new Set([t.id]));let r=e.subgraphs[n-b],i=ge(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return Ce(r,a),ge(e,a)}),n=f.map((e,t)=>t).sort((e,n)=>t[e]-t[n]||e-n).map(e=>f[e]);f.splice(0,f.length,...n)}let S=he(e,n),C=n?.feedbackEdges,w=l.get(null),T=C?.size?[...w.filter(e=>C.has(e.index)),...w.filter(e=>!C.has(e.index))]:w;for(let{index:e,edge:t}of T){if(t.source===t.target||n?.detachedEdges?.has(e))continue;let i=ce({id:`e${e}`,source:S.has(e)?t.target:t.source,target:S.has(e)?t.source:t.target,label:t.label,labelStyle:ye(r)});n?.looseEdges?.has(e)&&(i.layoutOptions={...i.layoutOptions,"elk.layered.priority.straightness":`0`}),p.push(i)}if(d)for(let e of g.get(xe)??[])p.push(e);else for(let{index:e,edge:t}of u)p.push(ce({id:`e${e}`,source:S.has(e)?t.target:t.source,target:S.has(e)?t.source:t.target,label:t.label,labelStyle:ye(r)}));return{id:`root`,layoutOptions:m,children:f,edges:p}}function De(t,n,r,i,a,o,s){let c=t.direction!==void 0&&(0,e.subgraphDirectionIsHonored)(t,n)?t.direction:s,l=ve({direction:_e(c),nodeSpacing:r.nodeSpacing,layerSpacing:r.layerSpacing,padding:t.region?fe:V}),u,d=a.get(t.id);d&&d.size>0&&(u=[...d].map(e=>({id:e})));let f=[];for(let e of t.nodeIds){let t=n.nodes.get(e);if(t){let n=be(e,t.label,t.shape,r.fontSizes.nodeLabel);f.push(B(e,n,t.label))}}let p=t.children.some(e=>e.region)?t.children:[...t.children].reverse();for(let e of p)f.push(De(e,n,r,i,a,o,c));let m=[],h=i.get(t.id)??[],g=he(n);for(let{index:e,edge:t}of h)t.source!==t.target&&m.push(ce({id:`e${e}`,source:g.has(e)?t.target:t.source,target:g.has(e)?t.source:t.target,label:t.label,labelStyle:ye(r)}));for(let e of o.get(t.id)??[])m.push(e);return{id:t.id,layoutOptions:l,labels:t.label?[{text:t.label}]:void 0,ports:u,children:f,edges:m}}function Oe(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),Oe(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 Ae(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?Ne(t,c,a)??a:Ne(t,a,o)??a:t<=r?Ne(t,s,c)??s:Ne(t,o,s)??s}{let t=e.y;return l>0?t<=i?Me(t,a,c)??c:Me(t,c,s)??c:t<=i?Me(t,a,o)??o:Me(t,o,s)??o}}function Me(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 Ne(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 Pe=12;function Fe(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))}}if(l.size===0)return;let u=r?`x`:`y`,d=(e,t,n,r)=>{let i=e[t],a=i[u];i[u]+=r;let[o,s,c]=[1,2,3].map(r=>e[t+r*n]);if(o[u]===a)o[u]+=r;else if(s&&c&&s[u]===o[u]){let e=Math.sign(o[u]-a),t=o[u]+e*Math.max(0,Pe-e*(o[u]-i[u]));e*(c[u]-t)>0&&(o[u]=s[u]=t)}};for(let e of t){let{points:t}=e;if(t.length<2)continue;let n=l.get(e.source),r=l.get(e.target);n!=null&&d(t,0,1,n),r!=null&&d(t,t.length-1,-1,r)}}var Ie=.5;function Le(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+Ie,r=e.x+e.width-Ie,i=e.y+Ie,a=e.y+e.height-Ie;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function Re(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(...Re(e,t,i.children)));return r}function ze(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(Re(t,n,r).map(e=>e.id)),u=Re(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 Be=2;function Ve(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)<=Be)return!0}return!1}function He(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(Ve(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=ze(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}];Le(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(Ve(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=ze(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}];Le(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(Ve(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=ze(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}];Le(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(Ve(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=ze(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}];Le(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 Ue=1.5,We=.01;function Ge(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)<We&&Math.abs(i.x-a.x)<We&&Math.abs(r.y-i.y)<We&&Math.abs(r.x-i.x)<=Ue&&Math.abs(r.x-i.x)>=We,s=Math.abs(e.y-r.y)<We&&Math.abs(i.y-a.y)<We&&Math.abs(r.x-i.x)<We&&Math.abs(r.y-i.y)<=Ue&&Math.abs(r.y-i.y)>=We;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 Ke(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 qe(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 Je=16,Ye=28,Xe=18,Ze=28,Qe=10;function $e(e,t){let n=e.x+e.width,r=e.y+e.height/2,i=Math.min(Ze,e.height*.6)/2,a=Ye+t*Xe,o=[];for(let e=0;e<=Je;e++){let t=Math.PI*e/Je;o.push({x:n+a*Math.sin(t),y:r-i*Math.cos(t)})}return{points:o,labelPosition:{x:n+a+Qe,y:r}}}function et(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}=$e(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:pt(i,e),headColor:ft(e),id:a.id,animate:a.animate})}}function tt(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(...tt(n.children));return t}function nt(e,t,n=!1){let r=[],i=[],a=[],o=new Set;for(let e of t.subgraphs)dt(e,o);rt(e,t,o,r,a,0,0);let s=tt(a);ot(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),Fe(r,i,t.direction);let c=new Map(r.map(e=>[e.id,e]));et(t,c,i),n&&He(i,r,a,t.direction);for(let e of i){e.points=Ge(e.points);let t=c.get(e.source),n=c.get(e.target);t&&(e.points=Ae(e.points,t,!0)),n&&(e.points=Ae(e.points,n,!1))}let l=e.width??800,u=e.height??600,d=I.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 rt(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 e=[];rt(c,n,r,i,e,t,l);let o=ut(n.subgraphs,c.id);a.push({id:c.id,label:o?.label??``,x:t,y:l,width:u,height:d,children:e,...o?.region?{region:!0}:{}})}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.shape,x:t,y:l,width:u,height:d,inlineStyle:r,className:a,interaction:n.interactions.get(c.id)})}c.children&&c.children.length>0&&rt(c,n,r,i,a,t,l)}}}function it(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 at(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 ot(e,t,n,r,i,a){let o=new Map;st(e,o,0,0);let s=new Map;lt(e,s,0,0,o);let c=0;for(let[e,r]of s){let i=t.edges[e];if(!i)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??at(o));let f=ct(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=at(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:he(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:pt(e,t),headColor:ft(t),id:i.id,animate:i.animate})}}function st(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;st(i,t,n+e,r+a)}}function ct(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 lt(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=it(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=Ke(a,l,u),f=qe(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)lt(a,t,n+(a.x??0),r+(a.y??0),i)}function ut(e,t){for(let n of e){if(n.id===t)return n;let e=ut(n.children,t);if(e)return e}}function dt(e,t){t.add(e.id);for(let n of e.children)dt(n,t)}function ft(e){return pt(-1,e)?.stroke}function pt(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=10,ht=14,gt=14,_t=10,vt=24,yt=400,bt=new Set([`rectangle`,`rounded`,`subroutine`]);function xt(e){let t=e===`TD`||e===`TB`||e===`BT`,n=e===`BT`||e===`RL`?-1:1;return{span:e=>{let[r,i]=t?[e.y,e.y+e.height]:[e.x,e.x+e.width],a=n*r,o=n*i;return{a0:Math.min(a,o),a1:Math.max(a,o),c0:t?e.x:e.y,c1:t?e.x+e.width:e.y+e.height}},toPoint:({a:e,c:r})=>t?{x:r,y:n*e}:{x:n*e,y:r}}}function St(e,t,n){let r=Math.min(e.a,t.a),i=Math.max(e.a,t.a),a=Math.min(e.c,t.c),o=Math.max(e.c,t.c);return i>n.a0&&r<n.a1&&o>n.c0&&a<n.c1}var Ct=(e,t)=>({a0:e.a0-t,a1:e.a1+t,c0:e.c0-t,c1:e.c1+t});function wt(e,t){let n=e.span({x:t.x,y:t.y,width:0,height:0});return{a:n.a0,c:n.c0}}function Tt(e,t,n){let r=e.c===t.c;for(let i=1;i<n.length;i++){let a=n[i-1],o=n[i];if(a.c===o.c===r){if(r){let n=Math.abs(e.c-a.c),r=Math.min(Math.max(e.a,t.a),Math.max(a.a,o.a))-Math.max(Math.min(e.a,t.a),Math.min(a.a,o.a));if(n<ht&&r>0)return!0}else{let n=Math.abs(e.a-a.a),r=Math.min(Math.max(e.c,t.c),Math.max(a.c,o.c))-Math.max(Math.min(e.c,t.c),Math.min(a.c,o.c));if(n<ht&&r>0)return!0}}}return!1}function Et(e){let t=[];for(let n of e){let e=t[t.length-1];e&&e.a===n.a&&e.c===n.c||t.push(n)}for(let e=t.length-2;e>0;e--){let n=t[e-1],r=t[e],i=t[e+1];(n.a===r.a&&r.a===i.a||n.c===r.c&&r.c===i.c)&&t.splice(e,1)}return t}var Dt=e=>{let t=0;for(let n=1;n<e.length;n++)t+=Math.abs(e[n].a-e[n-1].a)+Math.abs(e[n].c-e[n-1].c);return t};function Ot(e,t,n,r,i,a=[]){let o=xt(i),s=o.span(e),c=o.span(t),l=s.a1<=c.a0,u=c.a1<=s.a0;if(!l&&!u)return;let d=o.span(r),f={a0:d.a0+_t,a1:d.a1-_t,c0:d.c0+_t,c1:d.c1-_t},p=a.map(e=>e.map(e=>wt(o,e))),m=n.map(e=>Ct(o.span(e),mt)),h=e=>(e.c0+e.c1)/2,g=e=>(e.a0+e.a1)/2,_=e=>bt.has(e.shape),v=e=>{for(let t of e)if(t.a<f.a0||t.a>f.a1||t.c<f.c0||t.c>f.c1)return!1;for(let t=1;t<e.length;t++){let n=e[t-1],r=e[t];if(n.a!==r.a&&n.c!==r.c||m.some(e=>St(n,r,e))||St(n,r,s)||St(n,r,c)||p.some(e=>Tt(n,r,e)))return!1}return!0},y=new Set([h(s),h(c),f.c0,f.c1]);for(let e of m)y.add(e.c0-1),y.add(e.c1+1);for(let e of[s,c])y.add(e.c0-mt),y.add(e.c1+mt);let b=(e,t,n)=>_(e)?n>=t.c0+4&&n<=t.c1-4:Math.abs(n-h(t))<.5,x=[];if(l){let n=(c.a0-s.a1)/2,r=s.a1+Math.min(gt,n),i=c.a0-Math.min(gt,n);for(let n of y){b(e,s,n)&&b(t,c,n)&&x.push([{a:s.a1,c:n},{a:c.a0,c:n}]),x.push([{a:s.a1,c:h(s)},{a:r,c:h(s)},{a:r,c:n},{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}]),b(t,c,n)&&x.push([{a:s.a1,c:h(s)},{a:r,c:h(s)},{a:r,c:n},{a:c.a0,c:n}]),b(e,s,n)&&x.push([{a:s.a1,c:n},{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}]);let a=n>=s.c1?s.c1:n<=s.c0?s.c0:void 0;if(a!==void 0){let e=b(t,c,n)?[{a:c.a0,c:n}]:[{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}];x.push([{a:g(s),c:a},{a:g(s),c:n},...e])}}}else for(let t of y){let n=t>=c.c1?c.c1:t<=c.c0?c.c0:void 0;if(n===void 0)continue;b(e,s,t)&&x.push([{a:s.a0,c:t},{a:g(c),c:t},{a:g(c),c:n}]);let r=n===c.c1?s.c1:s.c0;x.push([{a:g(s),c:r},{a:g(s),c:t},{a:g(c),c:t},{a:g(c),c:n}])}let S,C=1/0;for(let t of x){let n=Et(t);if(n.length<2||!v(n))continue;let r=e.shape===`diamond`&&n[0].a===s.a1?yt:0,i=Dt(n)+vt*(n.length-2)+r;i<C&&(S=n,C=i)}return S?.map(o.toPoint)}function kt(e){let t={x:e[0].x,y:e[0].y},n=-1;for(let r=1;r<e.length;r++){let i=e[r-1],a=e[r],o=Math.abs(a.x-i.x)+Math.abs(a.y-i.y);o>n&&(n=o,t={x:(i.x+a.x)/2,y:(i.y+a.y)/2})}return t}var At=`__zm_spine__`,jt=8,Mt=6,Nt=12,Pt=4,Ft=4,It=.25,Lt=.02,Rt=40,zt=e=>e===`TD`||e===`TB`||e===`BT`,Bt=e=>e.startsWith(At);function Vt(e){return e.flatMap(e=>[e,...Vt(e.children)])}function H(e){let t=new Set(e.nodeIds);for(let n of e.children)for(let e of H(n))t.add(e);return t}function Ht(e){if(e.subgraphs.length===0||de(e)||Se(e.subgraphs))return!1;for(let t of e.nodes.keys())if(Bt(t))return!1;for(let t of e.edges)if(!e.nodes.has(t.source)||!e.nodes.has(t.target))return!1;let t=Vt(e.subgraphs);return!t.some(t=>e.nodes.has(t.id))&&t.every(t=>[...H(t)].some(t=>e.nodes.has(t)))}function Ut(e,t){let n=zt(t),r=e=>n?[e.y,e.y+e.height]:[e.x,e.x+e.width],i=[...e].sort((e,t)=>{let[n,i]=r(e),[a,o]=r(t);return(n+i)/2-(a+o)/2}),a=[];for(let e of i){let[t,n]=r(e),i=a[a.length-1];i&&t<i.end?(i.end=Math.min(i.end,n),i.ids.push(e.id)):a.push({end:n,ids:[e.id]})}(t===`BT`||t===`RL`)&&a.reverse();let o=new Map;return a.forEach((e,t)=>e.ids.forEach(e=>o.set(e,t))),o}function Wt(e,t,n){let r={ghosts:[],edges:[]};for(let i of e){let e=[...H(i)].filter(e=>t.has(e));if(e.length===0)continue;let a=e.map(e=>t.get(e)),o=Math.min(...a),s=Math.max(...a),c=new Map;for(let a=o;a<=s;a++){let o=e.filter(e=>t.get(e)===a).sort((e,t)=>n(e)-n(t));if(o.length>0)c.set(a,o[0]);else{let e=`${At}${i.id}__${a}`;r.ghosts.push({id:e,subgraph:i.id}),c.set(a,e)}}for(let e=o;e<s;e++){let t=c.get(e),n=c.get(e+1);!Bt(t)&&!Bt(n)||r.edges.push({source:t,target:n,style:`invisible`,hasArrowStart:!1,hasArrowEnd:!1})}}return r}function Gt(e,t,n,r=()=>!1,i=()=>!1){let a=e=>{let n=[...H(e)].filter(e=>t.has(e)).map(e=>t.get(e));return n.length>0?[Math.min(...n),Math.max(...n)]:void 0},o=e=>{let t=[...H(e)].filter(e=>n.has(e)).map(e=>n.get(e));return t.reduce((e,t)=>e+t,0)/t.length},s=e.map(e=>({sg:e,at:a(e)})).filter(e=>!!e.at).sort((e,t)=>e.at[0]-t.at[0]),c=[],l=-1/0;for(let{sg:e,at:t}of s){let n=c[c.length-1];n&&t[0]<=l?(n.push(e),l=Math.max(l,t[1])):(c.push([e]),l=t[1])}for(let t of c){if(t.length<2||t.some((e,n)=>t.slice(n+1).some(t=>r(e,t))))continue;let a=t.some(e=>e.region)||t.some((e,n)=>t.slice(n+1).some(t=>i(e,t)))?-1:1,s=[...t].sort((t,n)=>a*(e.indexOf(n)-e.indexOf(t))),c=t.map(o).sort((e,t)=>e-t),l=s.map((e,t)=>c[t]-o(e));s.forEach((e,t)=>{for(let r of H(e))n.has(r)&&n.set(r,n.get(r)+l[t])})}for(let a of e)Gt(a.children,t,n,r,i)}function Kt(e,t,n,r,i){let a=new Map(t);for(let t of r){let r=H(t);for(let e of i.get(t.id)??[])r.add(e);let o=[...r].filter(e=>a.has(e)),s=o.filter(e=>n.has(e));if(s.length===0)continue;let c=Math.min(...s.map(e=>n.get(e))),l=Math.max(...s.map(e=>n.get(e))),u=o.map(e=>a.get(e)),d=Math.min(...u),f=Math.max(...u),p=(d+f)/2,m=0;for(let t of e){if(r.has(t)||Bt(t))continue;let e=n.get(t);if(e===void 0||e<c||e>l)continue;m++;let i=a.get(t);a.set(t,i<=p?Math.min(i,d)-1-m*.001:Math.max(i,f)+1+m*.001)}}let o=new Map(e.map((e,t)=>[e,t]));return[...e].sort((e,t)=>a.get(e)-a.get(t)||o.get(e)-o.get(t))}var qt=(e,t)=>t>=Math.min(...e)&&t<=Math.max(...e);function Jt(t,n,r){let i=t=>{let a=t.children.map(i),o=[...[...H(t)].flatMap(e=>{let t=n.get(e);return t?[t]:[]}),...a],s=t.region?fe:V,c=Math.min(...o.map(e=>e.x))-s.left,l=Math.min(...o.map(e=>e.y))-s.top,u=Math.max(...o.map(e=>e.x+e.width))+s.right,d=Math.max(...o.map(e=>e.y+e.height))+s.bottom,f=t.region?0:(0,e.measureMultilineText)(t.label,r.groupHeader,M.groupHeader).width+24;return{id:t.id,label:t.label,x:c,y:l,width:Math.max(u-c,f),height:d-l,children:a,...t.region?{region:!0}:{}}};return t.map(i)}var Yt=e=>e.flatMap(e=>[e,...Yt(e.children)]);function Xt(e,t,n,r,i,a){let o=zt(r),s=new Map(Vt(t).map(e=>[e.id,H(e)])),c=new Map,l=!1,u=[],d=e=>o?[e.x,e.x+e.width]:[e.y,e.y+e.height],f=e=>o?[e.y,e.y+e.height]:[e.x,e.x+e.width],p=([e,t],[n,r])=>Math.max(0,Math.min(t,r)-Math.max(e,n)),m=e=>({x:e.x-Rt,y:e.y-Rt,width:e.width+80,height:e.height+80}),h=(e,t)=>p(f(e),f(t))>0?p(d(e),d(t)):0,g=Yt(e),_=new Map(g.map(e=>[e,m(e)])),v=(e,t,n,r)=>{let i=p(d(e),d(t)),a=p(f(e),f(t));if(i<=0||a<=0)return;let s=i<=a,c=s===o,l=e=>c?e.x:e.y,m=e=>c?e.x+e.width:e.y+e.height,h=e=>(l(e)+m(e))/2,g=h(n)<=h(r)?n:r;u.push({axis:c?`x`:`y`,amount:s?i:a,after:m(g)})};for(let e of g){let t=s.get(e.id),r=[...t].filter(e=>a.has(e)).map(e=>a.get(e)),o=new Set(r);for(let[s,u]of n){if(t.has(s))continue;if(o.has(a.get(s))||!qt(r,a.get(s))){v(_.get(e),u,e,u);continue}let n=h(_.get(e),u);n<=0||(i.has(e.id)?c.set(e.id,Math.max(c.get(e.id)??0,n)):l=!0)}}let y=(e,t)=>Yt(e.children).includes(t);for(let e=0;e<g.length;e++)for(let t=e+1;t<g.length;t++){let n=g[e],r=g[t];y(n,r)||y(r,n)||v(_.get(n),r,n,r)}return{penetration:c,stuck:l,requests:u}}function Zt(t,n,r){let i=[...t.nodes.keys()],a={...t,subgraphs:[]},o=(0,e.subgraphFeedbackEdges)(t),s=n(a,{feedbackEdges:o}),c=Ut(s.nodes,t.direction),l=zt(t.direction),u=new Map(s.nodes.map(e=>[e.id,e])),d=e=>{let t=u.get(e);return l?t.x:t.y},f=Vt(t.subgraphs),p=Wt(f,c,d),m=new Map;for(let e of p.ghosts)m.set(e.subgraph,[...m.get(e.subgraph)??[],e.id]);let h=new Map(s.nodes.map(e=>[e.id,d(e.id)]));Gt(t.subgraphs,c,h,(e,n)=>{let r=H(e),i=H(n),a=(e,n)=>t.edges.some(t=>e.has(t.source)&&n.has(t.target));return a(r,i)&&a(i,r)},(n,r)=>(0,e.subgraphsTied)(t,n,r));for(let e of p.ghosts){let t=[...H(f.find(t=>t.id===e.subgraph))].filter(e=>h.has(e)).map(e=>h.get(e));h.set(e.id,t.reduce((e,t)=>e+t,0)/t.length)}let g=new Map(t.nodes);for(let e of p.ghosts)g.set(e.id,{id:e.id,label:` `,shape:`rectangle`});let _=Kt([...g.keys()],h,c,f,m),v={...a,nodes:new Map(_.map(e=>[e,g.get(e)])),edges:[...t.edges,...p.edges]},y=new Set(p.edges.map((e,n)=>t.edges.length+n)),b=e=>{let a=new Map,s=new Map;for(let l=0;;l++){let u=new Map(p.ghosts.map(e=>[e.id,jt+(a.get(e.subgraph)??0)])),d=n(v,{fixedWidths:u,looseEdges:y,detachedEdges:e,walkOrder:i,feedbackEdges:o,forceNodeOrder:!0}),h=new Map(d.nodes.filter(e=>!Bt(e.id)).map(e=>[e.id,e])),g=Jt(t.subgraphs,h,r),_=Xt(g,t.subgraphs,h,t.direction,new Set(m.keys()),c),{penetration:b,stuck:x}=_;if(x)return;if(b.size===0){for(let e=0;_.requests.length>0;e++){if(e===Nt)return;en(_.requests.reduce((e,t)=>t.amount>e.amount?t:e),[...h.values()],d.edges),g=Jt(t.subgraphs,h,r),_=Xt(g,t.subgraphs,h,t.direction,new Set(m.keys()),c)}let n=$t(t,e,h,g,f);return n&&rn(d,[...h.values()],g,n,t.direction)}if(l===Mt)return;for(let[e,t]of b){let n=a.get(e)??0,r=s.get(e),i=r?(r.overlap-t)/(n-r.width):0,o=i>Lt?i:It;s.set(e,{width:n,overlap:t}),a.set(e,n+t/o+Ft)}}},x=Qt(t,p,c,f);return(x.size>0?b(x):void 0)??b(new Set)}function Qt(e,t,n,r){let i=r.map(e=>{let t=H(e);return{inside:t,layers:new Set([...t].filter(e=>n.has(e)).map(e=>n.get(e)))}}),a=e=>{let t=n.get(e.source),r=n.get(e.target);return t===void 0||r===void 0||e.source===e.target?!1:i.some(({inside:n,layers:i})=>n.has(e.source)&&n.has(e.target)&&Array.from({length:Math.max(0,Math.abs(r-t)-1)},(e,n)=>Math.min(t,r)+1+n).some(e=>!i.has(e)))},o=new Set;e.edges.forEach((e,t)=>{a(e)&&o.add(t)});let s=new Map,c=e=>{e.source!==e.target&&(s.set(e.source,(s.get(e.source)??0)+1),s.set(e.target,(s.get(e.target)??0)+1))};e.edges.forEach((e,t)=>{o.has(t)||c(e)}),t.edges.forEach(c);for(let t of[...o]){let n=e.edges[t];(!s.get(n.source)||!s.get(n.target))&&o.delete(t)}return o}function $t(e,t,n,r,i){let a=new Map(Yt(r).map(e=>[e.id,e])),o=[];for(let r of t){let t=e.edges[r],s=n.get(t.source),c=n.get(t.target),l=i.filter(e=>{let n=H(e);return n.has(t.source)&&n.has(t.target)}).sort((e,t)=>H(e).size-H(t).size)[0],u=l&&a.get(l.id);if(!s||!c||!u)return;let d=Ot(s,c,[...n.values()].filter(e=>e!==s&&e!==c),u,e.direction,o.map(e=>e.points));if(!d)return;o.push({source:t.source,target:t.target,label:t.label,style:t.style,hasArrowStart:t.hasArrowStart,hasArrowEnd:t.hasArrowEnd,points:d,labelPosition:t.label?kt(d):void 0,inlineStyle:pt(r,e),headColor:ft(e),id:t.id,animate:t.animate})}return o}function en(e,t,n){let{axis:r,amount:i,after:a}=e,o=i+Pt,s=t.filter(e=>e[r]>=a),c=Math.min(...s.map(e=>e[r]));for(let e of s)e[r]+=o;let l=e=>{e[r]>=c&&(e[r]+=o)};for(let e of n)e.points.forEach(l),e.labelPosition&&l(e.labelPosition)}var tn=8;function nn(e,t,n,r){let i=zt(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)<tn&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?tn:-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}}function rn(e,t,n,r,i){let a=[...e.edges.filter(e=>!Bt(e.source)&&!Bt(e.target)),...r],o=Yt(n);nn(a,t,o,i);let s=[...t.map(e=>e.x),...o.map(e=>e.x),...a.flatMap(e=>e.points.map(e=>e.x))],c=[...t.map(e=>e.y),...o.map(e=>e.y),...a.flatMap(e=>e.points.map(e=>e.y))],l=R.padding-Math.min(...s),u=R.padding-Math.min(...c);for(let e of t)e.x+=l,e.y+=u;for(let e of o)e.x+=l,e.y+=u;for(let e of a){for(let t of e.points)t.x+=l,t.y+=u;e.labelPosition&&(e.labelPosition.x+=l,e.labelPosition.y+=u)}let d=0,f=0;for(let e of t)d=Math.max(d,e.x+e.width+R.padding),f=Math.max(f,e.y+e.height+R.padding);for(let e of o)d=Math.max(d,e.x+e.width+R.padding),f=Math.max(f,e.y+e.height+R.padding);for(let e of a){for(let t of e.points)d=Math.max(d,t.x+I.width+R.padding),f=Math.max(f,t.y+I.width+R.padding);e.labelPosition&&(d=Math.max(d,e.labelPosition.x+60+R.padding),f=Math.max(f,e.labelPosition.y+20+R.padding))}return{...e,nodes:t,edges:a,groups:n,width:d,height:f}}var an=12,on=8,sn=4;function cn(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=ln(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 ln(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<on&&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,an)),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)),un(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<sn;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 un(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 dn=28,fn=18,pn=10,mn=32;function hn(t,n={}){let r={...R,...n,fontSizes:j(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: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=be(e,n.label,n.shape,r.fontSizes.nodeLabel);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)+pn));return dn+(t.length-1)*fn+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,M.groupHeader).width,d=l.axisSize+v.axisStart+v.axisEnd,f=l.crossSize+v.crossStart+v.crossEnd,p=i?0:u+mn,m=i?u+mn: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=cn(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=(e,t,n)=>{for(let[r,i]of e.routes)T.set(r,{mids:i.mids.map(e=>({axis:e.axis+t,cross:e.cross+n})),label:i.label&&{axis:i.label.axis+t,cross:i.label.cross+n}});let r=[];for(let i of e.members){let a=e.at.get(i),s=e.sizes.get(i),c={axis:t+a.axis,cross:n+a.cross,...s};w.set(i,c);let l=e.inner.get(i);if(l){let e=o.get(i),t=E(l,c.axis+l.inset.axis,c.cross+l.inset.cross);r.push({id:i,label:e.label,x:0,y:0,width:0,height:0,children:t,...e.region?{region:!0}:{}})}}return r},D=E(C,0,0),O=r.padding,k=C.axisSize,ee=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}},A=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,A(w.get(t.id))),te(t.children)};te(D);let ne=l.map(n=>{let r=t.nodes.get(n);return{id:n,label:r.label,shape:r.shape,...A(w.get(n)),inlineStyle:(0,e.resolveNodeStyle)(n,t),className:t.classAssignments.get(n),interaction:t.interactions.get(n)}}),N=new Map(ne.map(e=>[e.id,e])),P=[];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=Ge(gn(u.map(ee)));o&&d.reverse();let f=N.get(e.source),p=N.get(e.target);f&&(d=Ae(d,f,!0)),p&&(d=Ae(d,p,!1)),P.push({source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:d,labelPosition:r.label&&ee(r.label),inlineStyle:pt(n,t),headColor:ft(t),id:e.id,animate:e.animate})}),et(t,N,P);let F=(i?C.crossSize:C.axisSize)+O*2,L=(i?C.axisSize:C.crossSize)+O*2;for(let e of P){for(let t of e.points)F=Math.max(F,t.x+I.width+O),L=Math.max(L,t.y+I.width+O);e.labelPosition&&(F=Math.max(F,e.labelPosition.x+60+O),L=Math.max(L,e.labelPosition.y+20+O))}return{width:F,height:L,nodes:ne,edges:P,groups:D}}function gn(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 _n(e,t={}){return vn(e,t)}function vn(e,t,n){let r={...R,...t,fontSizes:j(t.fontSizes)};return nt(w(Ee(e,r,n),t.layoutCache),e,r.mergeEdges)}function yn(t,n={}){let r=(0,e.withoutOwnClusterEdges)(t);if(n.layout===`simple`&&!de(r))return hn(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'.`);if(Ht(r)){let e=Zt(r,(e,t)=>vn(e,n,t),j(n.fontSizes));if(e)return e}return _n(r,n)}function bn(e,t={}){return Ee(e,{...R,...t,fontSizes:j(t.fontSizes)})}var xn=12,Sn=2;function Cn(e){return e.flatMap(e=>[e,...Cn(e.children)])}function wn(t,n){let r=n.groupHeader+16;return Cn(t).filter(e=>e.label!==``).map(t=>{let i=(0,e.measureMultilineText)(t.label,n.groupHeader,M.groupHeader);return{x:t.x+xn-Sn,y:t.y+r/2-i.height/2-Sn,width:i.width+4,height:i.height+4}})}function Tn(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+Sn,y:e.y+Sn,width:e.width-4,height:e.height-4}}function Dn(e,t){let n=e.points,r=t.map(En);for(let e=0;e+1<n.length;e++)if(r.some(t=>Tn(n[e],n[e+1],t)))return!0;return!1}function On(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 kn(e,t,n){let r=`zm-title-gap-${On(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=A,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(Or((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(jn(f.nonce)),p.push(`<defs>`),p.push(Mn());let h=new Set;for(let e of t.edges)e.headColor&&h.add(e.headColor);for(let e of h)p.push(Nn(e));let g=wn(t.groups,a),_=new Set(t.edges.filter(e=>Dn(e,g))),v;if(_.size>0){let e=kn(g,t.width,t.height);v=e.id,p.push(e.markup)}p.push(`</defs>`);for(let e of t.groups)p.push(Ln(e,r,a));for(let e of t.edges)p.push(Rn(e,o,c,_.has(e)?v:void 0));for(let e of t.edges)e.label&&p.push(Bn(e,r,a));for(let e of t.nodes)p.push(Wn(e,r,a,l));return p.push(`</svg>`),p.join(`
10
10
  `)}function jn(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 Mn(){return Pn(`var(--_arrow)`,``)}function Nn(t){return Pn((0,e.escapeAttr)(t),e.f`-${Fn(t)}`)}function Pn(t,n){let r=L.width,i=L.height,a=r-1,o=e.f`fill="${t}" stroke="${t}" stroke-width="0.75" stroke-linejoin="round"`,s=e.f`<polygon points="0 0, ${r} ${i/2}, 0 ${i}" ${o} />`,c=(t,n)=>e.f` <marker id="${t}" markerWidth="${r}" markerHeight="${i}" refX="${a}" refY="${i/2}" orient="${n}">`+e.f`\n ${s}`+`
12
- </marker>`;return c(e.f`arrowhead${n}`,`auto`)+`
13
- `+c(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function Fn(e){return e.replace(/[^a-zA-Z0-9]/g,e=>e.charCodeAt(0).toString(16))}function In(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="${F.outerBox}" stroke-dasharray="6 4" />`);for(let e of t.children)a.push(In(e,n,r));return a.push(`</g>`),a.join(`
14
- `)}a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`),a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${F.outerBox}" />`),a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${i}" `+e.f`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${F.outerBox}" />`),a.push(` `+(0,e.renderMultilineText)(t.label,t.x+12,t.y+i/2,r.groupHeader,e.f`font-size="${r.groupHeader}" font-weight="${N.groupHeader}" fill="var(--_text-sec)"`));for(let e of t.children)a.push(In(e,n,r));return a.push(`</g>`),a.join(`
15
- `)}function Ln(t,n,r=!0,i){if(t.points.length<2)return``;let a=r&&(t.animate??!1),o=n!==`linear`,s=t.style===`invisible`,c=t.style===`dotted`?` stroke-dasharray="4 4"`:``,l=t.style===`thick`?F.connector*2:F.connector,u=s?`none`:(0,e.escapeAttr)(t.inlineStyle?.stroke??`var(--_line)`),f=(0,e.escapeAttr)(t.inlineStyle?.[`stroke-width`]??String(l)),p=t.inlineStyle?.stroke?e.f`-${Fn(t.inlineStyle.stroke)}`:``,m=``;s||(t.hasArrowEnd&&(m+=e.f` marker-end="url(#arrowhead${p})"`),t.hasArrowStart&&(m+=e.f` marker-start="url(#arrowhead-start${p})"`));let h=[e.f`class="edge${a?` 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&&h.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.id&&h.push(e.f`data-id="${(0,e.escapeAttr)(t.id)}"`);let g=a&&!c?` stroke-dasharray="8 6"`:``,_=o?e.f`d="${d(t.points,n)}"`:e.f`points="${Rn(t.points)}"`;return e.f`<${o?`path`:`polyline`} ${h.join(` `)} ${_} `+e.f`fill="none" stroke="${u}" `+e.f`stroke-width="${f}"${c}${g}${m}`+(i?e.f` mask="url(#${i})"`:``)+` />`}function Rn(t){return t.map(t=>e.f`${t.x},${t.y}`).join(` `)}function zn(t,n,r){if(!t.label)return``;let i=t.label,a=t.labelPosition??Vn(t.points),o=(0,e.measureMultilineText)(i,r.edgeLabel,N.edgeLabel),s=(0,e.renderMultilineTextWithBackground)(i,a.x,a.y,o.width,o.height,r.edgeLabel,8,e.f`text-anchor="middle" font-size="${r.edgeLabel}" font-weight="${N.edgeLabel}" fill="var(--_text-sec)"`,`rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1"`);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,`
16
- `)}\n`+`</g>`}function Bn(t,n){let r=t[n];if(!r)throw Error(e.f`edgeMidpoint: missing point at index ${n}`);return r}function Vn(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+=Hn(Bn(e,n-1),Bn(e,n));let n=t/2;for(let t=1;t<e.length;t++){let r=Bn(e,t-1),i=Bn(e,t),a=Hn(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 Hn(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Un(t,n,r,i=!0){let a=Wn(t),o=Tr(t,n,r),s=[],c=(0,e.sanitizeClassName)(t.className),l=c?e.f`node ${c}`:`node`,u=t.interaction,d=[e.f`class="${l}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`,e.f`data-shape="${t.shape}"`];s.push(e.f`<g ${d.join(` `)}>`);let f=i?(0,e.safeHref)(u?.href):void 0,p=f?` `:` `;if(f){let t=u?.target?e.f` target="${(0,e.escapeAttr)(u.target)}"`:``;s.push(e.f` <a href="${(0,e.escapeAttr)(f)}"${t}>`)}return i&&u?.tooltip&&s.push(e.f`${p}<title>${(0,e.escapeXml)(u.tooltip)}</title>`),s.push(e.f`${p}${a.replace(/\n/g,e.f`\n${p}`)}`),o&&s.push(e.f`${p}${o.replace(/\n/g,e.f`\n${p}`)}`),f&&s.push(` </a>`),s.push(`</g>`),s.join(`
17
- `)}function Wn(t){let{x:n,y:r,width:i,height:a,shape:o,inlineStyle:s}=t,c=(0,e.escapeAttr)(s?.fill??`var(--_node-fill)`),l=(0,e.escapeAttr)(s?.stroke??`var(--_node-stroke)`),u=(0,e.escapeAttr)(s?.[`stroke-width`]??String(F.innerBox));switch(o){case`diamond`:return Yn(n,r,i,a,c,l,u);case`rounded`:return Kn(n,r,i,a,c,l,u);case`stadium`:return qn(n,r,i,a,c,l,u);case`circle`:return Jn(n,r,i,a,c,l,u);case`subroutine`:return Xn(n,r,i,a,c,l,u);case`doublecircle`:return Zn(n,r,i,a,c,l,u);case`hexagon`:return Qn(n,r,i,a,c,l,u);case`cylinder`:return $n(n,r,i,a,c,l,u);case`asymmetric`:return er(n,r,i,a,c,l,u);case`trapezoid`:return tr(n,r,i,a,c,l,u);case`trapezoid-alt`:return nr(n,r,i,a,c,l,u);case`parallelogram`:return rr(n,r,i,a,c,l,u);case`parallelogram-alt`:return ir(n,r,i,a,c,l,u);case`state-start`:return Cr(n,r,i,a);case`state-end`:return wr(n,r,i,a);case`document`:return ar(n,r,i,a,c,l,u);case`stacked-document`:return or(n,r,i,a,c,l,u,!0);case`stacked-process`:return or(n,r,i,a,c,l,u,!1);case`card`:return sr(n,r,i,a,c,l,u);case`lined-process`:return cr(n,r,i,a,c,l,u);case`divided-process`:return lr(n,r,i,a,c,l,u);case`window-pane`:return ur(n,r,i,a,c,l,u);case`triangle`:return dr(n,r,i,a,c,l,u,!1);case`flipped-triangle`:return dr(n,r,i,a,c,l,u,!0);case`filled-circle`:return fr(n,r,i,a,l);case`crossed-circle`:return pr(n,r,i,a,c,l,u);case`fork-join`:return mr(n,r,i,a,l);case`note`:return hr(n,r,i,a,(0,e.escapeAttr)(s?.fill??`var(--bg)`),l,u);case`notched-pentagon`:return gr(n,r,i,a,c,l,u);case`sloped-rectangle`:return _r(n,r,i,a,c,l,u);case`flag`:return vr(n,r,i,a,c,l,u);case`bow-tie-rectangle`:return yr(n,r,i,a,c,l,u);case`half-rounded-rectangle`:return br(n,r,i,a,c,l,u);case`brace`:return xr(n,r,i,a,c,l,u,`left`);case`brace-right`:return xr(n,r,i,a,c,l,u,`right`);case`braces`:return xr(n,r,i,a,c,l,u,`both`);case`bolt`:return Sr(n,r,i,a,c,l,u);case`text`:case`anchor`:return``;default:return Gn(n,r,i,a,c,l,u)}}function Gn(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}" />`}function Kn(t,n,r,i,a,o,s){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="6" ry="6" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function qn(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 Jn(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 Yn(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 Xn(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 Zn(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 Qn(t,n,r,i,a,o,s){let c=i/4,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 $n(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 er(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 tr(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 nr(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 rr(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 ir(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 H(t,n,r){return e.f`fill="${t}" stroke="${n}" stroke-width="${r}"`}function ar(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}" ${H(a,o,s)} />`}function or(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`${H(a,o,s)} />`);return d.push(c?ar(t,n+10,l,u,a,o,s):e.f`<rect x="${t}" y="${n+10}" width="${l}" height="${u}" ${H(a,o,s)} />`),d.join(`
18
- `)}function sr(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}" ${H(a,o,s)} />`}function cr(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}" ${H(a,o,s)} />\n`+e.f`<line x1="${t+c}" y1="${n}" x2="${t+c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />`}function lr(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}" ${H(a,o,s)} />\n`+e.f`<line x1="${t}" y1="${c}" x2="${t+r}" y2="${c}" stroke="${o}" stroke-width="${s}" />`}function ur(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}" ${H(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 dr(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(` `)}" ${H(a,o,s)} />`}function fr(t,n,r,i,a){let o=Math.min(r,i)/2-2;return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="${o}" fill="${a}" stroke="${a}" />`}function pr(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}" ${H(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 mr(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 hr(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 gr(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}" ${H(a,o,s)} />`}function _r(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}" ${H(a,o,s)} />`}function vr(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}" ${H(a,o,s)} />`}function yr(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}" ${H(a,o,s)} />`}function br(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}" ${H(a,o,s)} />`}function xr(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(`
19
- `)}function Sr(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}" ${H(a,o,s)} />`}function Cr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2-2;return e.f`<circle cx="${a}" cy="${o}" r="${s}" fill="var(--_text)" stroke="none" />`}function wr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2-2,c=s-4;return e.f`<circle cx="${a}" cy="${o}" r="${s}" `+e.f`fill="none" stroke="var(--_text)" stroke-width="${F.innerBox*2}" />`+e.f`\n<circle cx="${a}" cy="${o}" r="${c}" fill="var(--_text)" stroke="none" />`}function Tr(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.y+t.height/2,o=(0,e.escapeAttr)(t.inlineStyle?.color??(0,e.getReadableTextColor)(t.inlineStyle?.fill,`var(--_text)`)),s=e.f`text-anchor="middle" font-size="${r.nodeLabel}" font-weight="${N.nodeLabel}" fill="${o}"`,c=t.inlineStyle?.[`font-family`];return c&&(s+=e.f` style="font-family: ${(0,e.escapeAttr)(c)};"`),(0,e.renderMultilineText)(t.label,i,a,r.nodeLabel,s)}function Er(t){return(0,e.escapeAttr)(t).replace(/\r/g,`&#13;`).replace(/\n/g,`&#10;`).replace(/\t/g,`&#9;`)}function Dr(t,n){return n===void 0?t:t.replace(`<svg `,e.f`<svg data-src="${Er(n)}" `)}var Or=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=Fr(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 kr(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 Ar(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 jr=`(?<![\\w-])(var|color-mix)\\(`;function Mr(e,t){let[n,...r]=Ar(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function Nr(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 Pr(t){let n=Ar(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=Nr(i),s=Nr(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 Fr(e,t){let n=``,r=0,i=new RegExp(jr,`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=kr(e,c);if(l===-1)break;let u=Fr(e.slice(c+1,l),t),d=o===`var`?Mr(u,t):Pr(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function Ir(e,t){let n=new Or;for(let[e,r]of Object.entries(t))n.declare(e,r);return Fr(e,n)}var Lr=/(--[\w-]+)\s*:\s*([^;{}]+)/g,Rr=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,zr=new Set([`data-src`]);function Br(e,t){Lr.lastIndex=0;let n;for(;(n=Lr.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function Vr(e,t){return e.replace(Rr,(e,n,r,i,a)=>{if(zr.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${Fr(a.slice(1,-1),t)}${o}`})}function Hr(e,t){let n=new Or;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&&Br(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&Br(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+=Fr(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:Vr(s,n),i=a+1}return r+e.slice(i)}var Ur=[.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],Wr=[.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 Gr(e){return e>=4352?1:.6}function Kr(e,t){let n=t?Wr:Ur,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:Gr(e)}return i*16}var U={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 qr(e){return`note ${e}`}function Jr(e){return`${e} link`}function Yr(e){return`namespace ${e}`}function Xr(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:Yr(i),name:a.name,classIds:e})}return r}function Zr(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 Qr(t){return(0,e.findBackEdges)(t.relationships.map(e=>({source:e.from,target:e.to})),t.classes.map(e=>e.id))}function $r(t,n,r){let i=new Map,a=new Map,o=M(n.fontSizes);for(let e of t.classes){if(r.has(e.id)){i.set(e.id,{width:D(e.label,o.nodeLabel,N.edgeLabel)+U.lollipopLabelPadX*2,height:U.lollipopLabelHeight,headerHeight:U.lollipopLabelHeight,attrHeight:0,methodHeight:0});continue}let t=e.annotation?U.headerBaseHeight+U.annotationHeight:U.headerBaseHeight,n=e.attributes.length>0?e.attributes.length*U.memberRowHeight+U.sectionPadY:U.emptySectionHeight,a=e.methods.length>0?e.methods.length*U.memberRowHeight+U.sectionPadY:U.emptySectionHeight,s=D(e.label,o.nodeLabel,N.nodeLabel),c=ai(e.attributes),l=ai(e.methods),u=Math.max(ii(e),s+U.boxPadX*2,c+U.boxPadX*2,l+U.boxPadX*2),d=t+n+a;i.set(e.id,{width:u,height:d,headerHeight:t,attrHeight:n,methodHeight:a})}let s=Xr(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=D(e.name,U.namespaceTitleFontSize,N.groupHeader)+U.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":ie({top:U.namespaceTitleHeight+U.namespacePad/2,left:U.namespacePad,bottom:U.namespacePad,right:U.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=oe(e,t),r=l.get(c.get(e)??``);r?.children?r.children.push(n):u.push(n)}let d={fontSize:o.edgeLabel},f=Qr(t),p=[];for(let[e,n]of t.relationships.entries()){let t=f.has(e);p.push(le({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=qr(n),i=(0,e.measureMultilineText)(r.text,o.edgeLabel,N.edgeLabel),s={width:i.width+U.notePadX*2,height:i.height+U.notePadY*2};a.set(t,s),u.push(oe(t,s)),r.forClass!==void 0&&m.has(r.forClass)&&p.push(le({id:Jr(t),source:t,target:r.forClass,labelStyle:d}))}return{elkGraph:{id:`root`,layoutOptions:{...ae({direction:re(t.direction,ne.class),nodeSpacing:U.nodeSpacing,layerSpacing:U.layerSpacing,padding:U.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 ei(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=Qr(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=qe(n,r.x,r.y),a=h.has(e)?i.reverse():i,s=Je(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=qr(e),r=g.get(n),a=i.get(n);if(!r||!a)throw Error(`Missing layout for note ${e}`);let o=y.get(Jr(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:qe(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 ti(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[],namespaces:[]};let n=Zr(e),{elkGraph:r,classSizes:i,noteSizes:a,namespaces:o}=$r(n.diagram,t,n.labels);return ei(w(r,t.layoutCache),e,i,a,o,n)}function ni(e){return e.length*Math.ceil(O(`M`,U.memberFontSize))}function ri(e){let t=e.isMethod?`${e.name}(${e.params||``})`:e.name;return`${e.visibility||``}${e.visibilitySpace?` `:``}${t}${e.isMethod&&e.type?` : ${e.type}`:``}`}function ii(e){let t=Kr(e.label,!0),n=e.annotation?Kr(`\u00ab${e.annotation}\u00bb`,!1):0,r=Math.max(0,...[...e.attributes,...e.methods].map(e=>Kr(ri(e),!1))),i=Math.max(t,n);return i/2+Math.max(i/2,r)+U.mermaidPad*2}function ai(e){if(e.length===0)return 0;let n=0;for(let r of e){let e=ni((0,t.formatClassMember)(r));e>n&&(n=e)}return n}var oi={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function si(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(Dr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,f,u.styleAttribute,u.description),o)),d.push(R(r,!0,u.nonce,u.bodyFont)),d.push(`<defs>`),d.push(li(t.relationships.some(e=>e.type===`lollipop`))),d.push(`</defs>`);for(let e of t.namespaces)d.push(ci(e));for(let e of t.relationships)d.push(gi(e));for(let e of t.notes)d.push(hi(e));for(let e of t.classes)d.push(ui(e,a,l));for(let e of t.relationships){let t=_i(e,a);t&&d.push(t)}for(let e of t.notes)d.push(mi(e,a));for(let e of t.relationships)d.push(bi(e,a));return d.push(`</svg>`),d.join(`
20
- `)}function ci(t){let{x:n,y:r,width:i,height:a}=t,o=U.namespaceTitleHeight,s=F.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+U.namespacePad}" y="${r+o/2}" dy="${I}" font-size="${U.namespaceTitleFontSize}" font-weight="${N.groupHeader}" fill="var(--_text-sec)">${wi(t.name)}</text>`,`</g>`].join(`
21
- `)}function li(e){return` <marker id="cls-inherit" markerWidth="12" markerHeight="10" refX="12" refY="5" orient="auto-start-reverse">
11
+ `)}function Mn(){return Fn(`var(--_arrow)`,``)}function Nn(t){return Fn((0,e.escapeAttr)(t),e.f`-${In(t)}`)}var Pn=3.5;function Fn(t,n){let r=10.5,i=12.8,a=e.f`fill="${t}" stroke="${t}" stroke-width="0.75" stroke-linejoin="round"`,o=e.f`<polygon points="0 0, ${r} ${i/2}, 0 ${i}" ${a} />`,s=(t,n)=>e.f` <marker id="${t}" markerWidth="${r}" markerHeight="${i}" refX="${9.5}" refY="${i/2}" markerUnits="userSpaceOnUse" orient="${n}">`+e.f`\n ${o}`+`
12
+ </marker>`;return s(e.f`arrowhead${n}`,`auto`)+`
13
+ `+s(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function In(e){return e.replace(/[^a-zA-Z0-9]/g,e=>e.charCodeAt(0).toString(16))}function Ln(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(Ln(e,n,r));return a.push(`</g>`),a.join(`
14
+ `)}a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`),a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${i}" `+e.f`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),a.push(` `+(0,e.renderMultilineText)(t.label,t.x+12,t.y+i/2,r.groupHeader,e.f`font-size="${r.groupHeader}" font-weight="${M.groupHeader}" fill="var(--_text-sec)"`));for(let e of t.children)a.push(Ln(e,n,r));return a.push(`</g>`),a.join(`
15
+ `)}function Rn(t,n,r=!0,i){if(t.points.length<2)return``;let a=r&&(t.animate??!1),o=n!==`linear`,s=t.style===`invisible`,c=t.style===`dotted`?` stroke-dasharray="2 2"`:``,l=t.style===`thick`?Pn:P.connector,u=s?`none`:(0,e.escapeAttr)(t.inlineStyle?.stroke??`var(--_line)`),f=(0,e.escapeAttr)(t.inlineStyle?.[`stroke-width`]??String(l)),p=t.headColor?e.f`-${In(t.headColor)}`:``,m=``;s||(t.hasArrowEnd&&(m+=e.f` marker-end="url(#arrowhead${p})"`),t.hasArrowStart&&(m+=e.f` marker-start="url(#arrowhead-start${p})"`));let h=[e.f`class="edge${a?` 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&&h.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.id&&h.push(e.f`data-id="${(0,e.escapeAttr)(t.id)}"`);let g=a&&!c?` stroke-dasharray="8 6"`:``,_=o?e.f`d="${d(t.points,n)}"`:e.f`points="${zn(t.points)}"`;return e.f`<${o?`path`:`polyline`} ${h.join(` `)} ${_} `+e.f`fill="none" stroke="${u}" `+e.f`stroke-width="${f}"${c}${g}${m}`+(i?e.f` mask="url(#${i})"`:``)+` />`}function zn(t){return t.map(t=>e.f`${t.x},${t.y}`).join(` `)}function Bn(t,n,r){if(!t.label)return``;let i=t.label,a=t.labelPosition??Hn(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,8,e.f`text-anchor="middle" font-size="${r.edgeLabel}" font-weight="${M.edgeLabel}" fill="var(--_text-sec)"`,`rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1"`);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,`
16
+ `)}\n`+`</g>`}function Vn(t,n){let r=t[n];if(!r)throw Error(e.f`edgeMidpoint: missing point at index ${n}`);return r}function Hn(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+=Un(Vn(e,n-1),Vn(e,n));let n=t/2;for(let t=1;t<e.length;t++){let r=Vn(e,t-1),i=Vn(e,t),a=Un(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 Un(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Wn(t,n,r,i=!0){let a=Gn(t),o=Er(t,n,r),s=[],c=(0,e.sanitizeClassName)(t.className),l=c?e.f`node ${c}`:`node`,u=t.interaction,d=[e.f`class="${l}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`,e.f`data-shape="${t.shape}"`];s.push(e.f`<g ${d.join(` `)}>`);let f=i?(0,e.safeHref)(u?.href):void 0,p=f?` `:` `;if(f){let t=u?.target?e.f` target="${(0,e.escapeAttr)(u.target)}"`:``;s.push(e.f` <a href="${(0,e.escapeAttr)(f)}"${t}>`)}return i&&u?.tooltip&&s.push(e.f`${p}<title>${(0,e.escapeXml)(u.tooltip)}</title>`),s.push(e.f`${p}${a.replace(/\n/g,e.f`\n${p}`)}`),o&&s.push(e.f`${p}${o.replace(/\n/g,e.f`\n${p}`)}`),f&&s.push(` </a>`),s.push(`</g>`),s.join(`
17
+ `)}function Gn(t){let{x:n,y:r,width:i,height:a,shape:o,inlineStyle:s}=t,c=(0,e.escapeAttr)(s?.fill??`var(--_node-fill)`),l=(0,e.escapeAttr)(s?.stroke??`var(--_node-stroke)`),u=(0,e.escapeAttr)(s?.[`stroke-width`]??String(P.innerBox));switch(o){case`diamond`:return Xn(n,r,i,a,c,l,u);case`rounded`:return qn(n,r,i,a,c,l,u);case`stadium`:return Jn(n,r,i,a,c,l,u);case`circle`:return Yn(n,r,i,a,c,l,u);case`subroutine`:return Zn(n,r,i,a,c,l,u);case`doublecircle`:return Qn(n,r,i,a,c,l,u);case`hexagon`:return $n(n,r,i,a,c,l,u);case`cylinder`:return er(n,r,i,a,c,l,u);case`asymmetric`:return tr(n,r,i,a,c,l,u);case`trapezoid`:return nr(n,r,i,a,c,l,u);case`trapezoid-alt`:return rr(n,r,i,a,c,l,u);case`parallelogram`:return ir(n,r,i,a,c,l,u);case`parallelogram-alt`:return ar(n,r,i,a,c,l,u);case`state-start`:return wr(n,r,i,a);case`state-end`:return Tr(n,r,i,a);case`document`:return or(n,r,i,a,c,l,u);case`stacked-document`:return sr(n,r,i,a,c,l,u,!0);case`stacked-process`:return sr(n,r,i,a,c,l,u,!1);case`card`:return cr(n,r,i,a,c,l,u);case`lined-process`:return lr(n,r,i,a,c,l,u);case`divided-process`:return ur(n,r,i,a,c,l,u);case`window-pane`:return dr(n,r,i,a,c,l,u);case`triangle`:return fr(n,r,i,a,c,l,u,!1);case`flipped-triangle`:return fr(n,r,i,a,c,l,u,!0);case`filled-circle`:return pr(n,r,i,a,l);case`crossed-circle`:return mr(n,r,i,a,c,l,u);case`fork-join`:return hr(n,r,i,a,l);case`note`:return gr(n,r,i,a,(0,e.escapeAttr)(s?.fill??`var(--bg)`),l,u);case`notched-pentagon`:return _r(n,r,i,a,c,l,u);case`sloped-rectangle`:return vr(n,r,i,a,c,l,u);case`flag`:return yr(n,r,i,a,c,l,u);case`bow-tie-rectangle`:return br(n,r,i,a,c,l,u);case`half-rounded-rectangle`:return xr(n,r,i,a,c,l,u);case`brace`:return Sr(n,r,i,a,c,l,u,`left`);case`brace-right`:return Sr(n,r,i,a,c,l,u,`right`);case`braces`:return Sr(n,r,i,a,c,l,u,`both`);case`bolt`:return Cr(n,r,i,a,c,l,u);case`text`:case`anchor`:return``;default:return Kn(n,r,i,a,c,l,u)}}function Kn(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}" />`}function qn(t,n,r,i,a,o,s){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="6" ry="6" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Jn(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 Yn(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 Xn(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 Zn(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 Qn(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 $n(t,n,r,i,a,o,s){let c=i/4,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 er(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 tr(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 nr(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 rr(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 ir(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 ar(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 U(t,n,r){return e.f`fill="${t}" stroke="${n}" stroke-width="${r}"`}function or(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}" ${U(a,o,s)} />`}function sr(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`${U(a,o,s)} />`);return d.push(c?or(t,n+10,l,u,a,o,s):e.f`<rect x="${t}" y="${n+10}" width="${l}" height="${u}" ${U(a,o,s)} />`),d.join(`
18
+ `)}function cr(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}" ${U(a,o,s)} />`}function lr(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}" ${U(a,o,s)} />\n`+e.f`<line x1="${t+c}" y1="${n}" x2="${t+c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />`}function ur(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}" ${U(a,o,s)} />\n`+e.f`<line x1="${t}" y1="${c}" x2="${t+r}" y2="${c}" stroke="${o}" stroke-width="${s}" />`}function dr(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}" ${U(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 fr(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(` `)}" ${U(a,o,s)} />`}function pr(t,n,r,i,a){let o=Math.min(r,i)/2-2;return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="${o}" fill="${a}" stroke="${a}" />`}function mr(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}" ${U(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 hr(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 gr(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 _r(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}" ${U(a,o,s)} />`}function vr(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}" ${U(a,o,s)} />`}function yr(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}" ${U(a,o,s)} />`}function br(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}" ${U(a,o,s)} />`}function xr(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}" ${U(a,o,s)} />`}function Sr(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(`
19
+ `)}function Cr(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}" ${U(a,o,s)} />`}function wr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2-2;return e.f`<circle cx="${a}" cy="${o}" r="${s}" fill="var(--_text)" stroke="none" />`}function Tr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2-2,c=s-4;return e.f`<circle cx="${a}" cy="${o}" r="${s}" `+e.f`fill="none" stroke="var(--_text)" stroke-width="${P.innerBox*2}" />`+e.f`\n<circle cx="${a}" cy="${o}" r="${c}" fill="var(--_text)" stroke="none" />`}function Er(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.y+t.height/2,o=(0,e.escapeAttr)(t.inlineStyle?.color??(0,e.getReadableTextColor)(t.inlineStyle?.fill,`var(--_text)`)),s=e.f`text-anchor="middle" font-size="${r.nodeLabel}" font-weight="${M.nodeLabel}" fill="${o}"`,c=t.inlineStyle?.[`font-family`];return c&&(s+=e.f` style="font-family: ${(0,e.escapeAttr)(c)};"`),(0,e.renderMultilineText)(t.label,i,a,r.nodeLabel,s)}function Dr(t){return(0,e.escapeAttr)(t).replace(/\r/g,`&#13;`).replace(/\n/g,`&#10;`).replace(/\t/g,`&#9;`)}function Or(t,n){return n===void 0?t:t.replace(`<svg `,e.f`<svg data-src="${Dr(n)}" `)}var kr=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=Ir(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 Ar(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 jr(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 Mr=`(?<![\\w-])(var|color-mix)\\(`;function Nr(e,t){let[n,...r]=jr(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function Pr(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 Fr(t){let n=jr(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=Pr(i),s=Pr(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 Ir(e,t){let n=``,r=0,i=new RegExp(Mr,`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=Ar(e,c);if(l===-1)break;let u=Ir(e.slice(c+1,l),t),d=o===`var`?Nr(u,t):Fr(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function Lr(e,t){let n=new kr;for(let[e,r]of Object.entries(t))n.declare(e,r);return Ir(e,n)}var Rr=/(--[\w-]+)\s*:\s*([^;{}]+)/g,zr=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,Br=new Set([`data-src`]);function Vr(e,t){Rr.lastIndex=0;let n;for(;(n=Rr.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function Hr(e,t){return e.replace(zr,(e,n,r,i,a)=>{if(Br.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${Ir(a.slice(1,-1),t)}${o}`})}function Ur(e,t){let n=new kr;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&&Vr(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&Vr(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+=Ir(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:Hr(s,n),i=a+1}return r+e.slice(i)}var Wr=[.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],Gr=[.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 Kr(e){return e>=4352?1:.6}function qr(e,t){let n=t?Gr:Wr,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:Kr(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 Jr(e){return`note ${e}`}function Yr(e){return`${e} link`}function Xr(e){return`namespace ${e}`}function Zr(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:Xr(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 $r(t){return(0,e.findBackEdges)(t.relationships.map(e=>({source:e.from,target:e.to})),t.classes.map(e=>e.id))}function ei(t,n,r){let i=new Map,a=new Map,o=j(n.fontSizes);for(let e of t.classes){if(r.has(e.id)){i.set(e.id,{width:D(e.label,o.nodeLabel,M.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=D(e.label,o.nodeLabel,M.nodeLabel),c=oi(e.attributes),l=oi(e.methods),u=Math.max(ai(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=Zr(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=D(e.name,W.namespaceTitleFontSize,M.groupHeader)+W.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":ae({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=B(e,t),r=l.get(c.get(e)??``);r?.children?r.children.push(n):u.push(n)}let d={fontSize:o.edgeLabel},f=$r(t),p=[];for(let[e,n]of t.relationships.entries()){let t=f.has(e);p.push(ce({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=Jr(n),i=(0,e.measureMultilineText)(r.text,o.edgeLabel,M.edgeLabel),s={width:i.width+W.notePadX*2,height:i.height+W.notePadY*2};a.set(t,s),u.push(B(t,s)),r.forClass!==void 0&&m.has(r.forClass)&&p.push(ce({id:Yr(t),source:t,target:r.forClass,labelStyle:d}))}return{elkGraph:{id:`root`,layoutOptions:{...z({direction:ie(t.direction,re.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 ti(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=$r(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=Ke(n,r.x,r.y),a=h.has(e)?i.reverse():i,s=qe(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=Jr(e),r=g.get(n),a=i.get(n);if(!r||!a)throw Error(`Missing layout for note ${e}`);let o=y.get(Yr(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:Ke(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 ni(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}=ei(n.diagram,t,n.labels);return ti(w(r,t.layoutCache),e,i,a,o,n)}function ri(e){return e.length*Math.ceil(O(`M`,W.memberFontSize))}function ii(e){let t=e.isMethod?`${e.name}(${e.params||``})`:e.name;return`${e.visibility||``}${e.visibilitySpace?` `:``}${t}${e.isMethod&&e.type?` : ${e.type}`:``}`}function ai(e){let t=qr(e.label,!0),n=e.annotation?qr(`\u00ab${e.annotation}\u00bb`,!1):0,r=Math.max(0,...[...e.attributes,...e.methods].map(e=>qr(ii(e),!1))),i=Math.max(t,n);return i/2+Math.max(i/2,r)+W.mermaidPad*2}function oi(e){if(e.length===0)return 0;let n=0;for(let r of e){let e=ri((0,t.formatClassMember)(r));e>n&&(n=e)}return n}var si={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function ci(t,n,r=`Inter`,i=!1,a=A,o,s,c,l=!0,u={}){let d=[],f=l&&t.classes.some(t=>!!(0,e.safeHref)(t.interaction?.href));d.push(Or((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,f,u.styleAttribute,u.description),o)),d.push(L(r,!0,u.nonce,u.bodyFont)),d.push(`<defs>`),d.push(ui(t.relationships.some(e=>e.type===`lollipop`))),d.push(`</defs>`);for(let e of t.namespaces)d.push(li(e));for(let e of t.relationships)d.push(_i(e));for(let e of t.notes)d.push(gi(e));for(let e of t.classes)d.push(di(e,a,l));for(let e of t.relationships){let t=vi(e,a);t&&d.push(t)}for(let e of t.notes)d.push(hi(e,a));for(let e of t.relationships)d.push(xi(e,a));return d.push(`</svg>`),d.join(`
20
+ `)}function li(t){let{x:n,y:r,width:i,height:a}=t,o=W.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+W.namespacePad}" y="${r+o/2}" dy="${F}" font-size="${W.namespaceTitleFontSize}" font-weight="${M.groupHeader}" fill="var(--_text-sec)">${Ti(t.name)}</text>`,`</g>`].join(`
21
+ `)}function ui(e){return` <marker id="cls-inherit" markerWidth="12" markerHeight="10" refX="12" refY="5" orient="auto-start-reverse">
22
22
  <polygon points="0 0, 12 5, 0 10" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
23
23
  </marker>
24
24
  <marker id="cls-composition" markerWidth="18" markerHeight="14" refX="16.5" refY="7" orient="auto-start-reverse">
@@ -32,42 +32,44 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
32
32
  </marker>`+(e?`
33
33
  <marker id="cls-lollipop" markerWidth="12" markerHeight="12" refX="11" refY="6" orient="auto-start-reverse">
34
34
  <circle cx="6" cy="6" r="5" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
35
- </marker>`:``)}function ui(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(F.outerBox)),g=u?.fill?p:`var(--_group-hdr)`,_=u?.color?(0,e.escapeAttr)(u.color):u?.fill?(0,e.escapeAttr)((0,e.getReadableTextColor)(u.fill,`var(--_text)`)):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="${I}" `+e.f`font-size="${oi.annotationSize}" font-weight="${oi.annotationWeight}" `+e.f`font-style="italic" fill="${_??`var(--_text-muted)`}">&lt;&lt;${wi(t.annotation)}&gt;&gt;</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;d.push(e.f` <line x1="${i}" y1="${C}" x2="${i+o}" y2="${C}" `+e.f`stroke="${m}" stroke-width="${F.innerBox}" />`);for(let e=0;e<t.attributes.length;e++){let n=t.attributes[e],r=C+4+e*20+10;d.push(` `+fi(n,i+U.boxPadX,r,_))}let w=C+l;d.push(e.f` <line x1="${i}" y1="${w}" x2="${i+o}" y2="${w}" `+e.f`stroke="${m}" stroke-width="${F.innerBox}" />`);for(let e=0;e<t.methods.length;e++){let n=t.methods[e],r=w+4+e*20+10;d.push(` `+fi(n,i+U.boxPadX,r,_))}return x&&d.push(` </a>`),d.push(`</g>`),d.join(`
36
- `)}var di=700;function fi(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="${di}">${wi(t.visibility)}</tspan><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="${I}" `+e.f`font-size="${oi.memberSize}" font-weight="${oi.memberWeight}"${a}${o}>`+e.f`${u.join(``)}</text>`}var pi=6;function mi(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-pi},${i}`,e.f`${r+a},${i+pi}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `),l=e.f`${r+a-pi},${i} ${r+a},${i+pi} `+e.f`${r+a-pi},${i+pi}`;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="${F.innerBox}" />`+e.f`\n <polygon points="${l}" `+e.f`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${F.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="${N.edgeLabel}" fill="var(--_text-muted)"`)}`+`
37
- </g>`}function hi(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="${F.connector}" stroke-dasharray="2 3" />`}function gi(t){if(t.points.length<2)return``;let n=t.points.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.type===`dependency`||t.type===`realization`?` stroke-dasharray="6 4"`:``,i=vi(t.type,t.markerAt),a=[`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&&a.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.fromCardinality&&a.push(e.f`data-from-cardinality="${(0,e.escapeAttr)(t.fromCardinality)}"`),t.toCardinality&&a.push(e.f`data-to-cardinality="${(0,e.escapeAttr)(t.toCardinality)}"`),e.f`<polyline ${a.join(` `)} points="${n}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${F.connector}"${r}${i} />`}function _i(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="${N.edgeLabel}" fill="var(--_text)"`)+`
38
- </g>`}function vi(t,n){let r=yi(t);return r?(n===`to`?``:e.f` marker-start="url(#${r})"`)+(n===`from`?``:e.f` marker-end="url(#${r})"`):``}function yi(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 bi(t,n){if(!t.label&&!t.fromCardinality&&!t.toCardinality||t.points.length<2)return``;let r=[];if(t.label){let i=xi(t.points,t.labelPosition??Si(t.points)),a=(0,e.measureMultilineText)(t.label,n.edgeLabel,N.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="${N.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=Ci(i,a);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="middle" font-weight="${N.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=Ci(i,a);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="middle" font-weight="${N.edgeLabel}" fill="var(--_text-muted)"`))}return r.join(`
39
- `)}function xi(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 Si(e){return e.length===0?{x:0,y:0}:e[Math.floor(e.length/2)]}function Ci(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.abs(n)>Math.abs(r)?{x:n>0?14:-14,y:-10}:{x:-14,y:r>0?14:-14}}var wi=e.escapeXml,W={padding:40,boxPadX:14,headerHeight:34,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=M(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,N.edgeLabel).width+8:0;a.push({index:r,nest:a.length,out:t?t.out+W.loopLabelGap+t.labelW+W.loopNestGap:W.loopOut,labelW:s})}return a}function Ei(e){return e.length*Math.ceil(O(`M`,W.attrFontSize))}function Di(e,t){let n=new Map,r=M(t.fontSizes);for(let t of e.entities){let e=D(t.label,r.nodeLabel,N.nodeLabel),i=0;for(let e of t.attributes){let t=Ei(`${e.type} ${e.name}${e.keys.length>0?` `+e.keys.join(`,`):``}`);t>i&&(i=t)}let a=Math.max(W.minWidth,e+W.boxPadX*2,i+W.boxPadX*2),o=W.headerHeight+Math.max(t.attributes.length,1)*W.rowHeight;n.set(t.id,{width:a,height:o})}let i=[];for(let[e,t]of n)i.push(oe(e,t));let a={fontSize:r.edgeLabel},o=[];for(let[t,n]of e.relationships.entries())n.entity1!==n.entity2&&o.push(le({id:`e${t}`,source:n.entity1,target:n.entity2,label:n.label,labelStyle:a}));let s=0;for(let n of e.entities){let r=Ti(e,n.id,t),i=r[r.length-1];i&&(s=Math.max(s,i.out+i.labelW))}return{elkGraph:{id:`root`,layoutOptions:{...ae({direction:re(e.direction,ne.er),nodeSpacing:Math.max(W.nodeSpacing,s+20),layerSpacing:Math.max(W.layerSpacing,s+20),padding:W.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.separateConnectedComponents":`false`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:i,edges:o},entitySizes:n}}function Oi(t,n,r,i){let a=new Map;for(let e of n.entities)a.set(e.id,e);let o=[];for(let i of t.children??[]){let t=a.get(i.id);if(t){let a=r.get(t.id);if(!a)throw Error(`Missing computed size for entity "${t.id}"`);o.push({id:t.id,label:t.label,attributes:t.attributes,x:i.x??0,y:i.y??0,width:i.width??a.width,height:i.height??a.height,headerHeight:W.headerHeight,rowHeight:W.rowHeight,inlineStyle:(0,e.resolveNodeStyle)(t.id,n),className:n.classAssignments.get(t.id)})}}let s=new Map((t.edges??[]).map(e=>[e.id,e])),c=[],l=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){c.push({...r,points:qe(s.get(`e${e}`))});continue}let a=o.find(e=>e.id===t.entity1),u=Ti(n,t.entity1,i).find(t=>t.index===e),d=a.y+a.height/2,f=Math.max(W.loopHalf,a.height/8)+10*u.nest,p=a.x-u.out;c.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-W.loopLabelGap-u.labelW/2,y:d}}),l=Math.min(l,p-W.loopLabelGap-u.labelW)}let u=Math.max(0,W.loopMargin-l);if(u>0){for(let e of o)e.x+=u;for(let e of c){for(let t of e.points)t.x+=u;e.labelPoint&&(e.labelPoint.x+=u)}}return{width:(t.width??600)+u,height:t.height??400,entities:o,relationships:c}}function ki(e,t={}){if(e.entities.length===0)return{width:0,height:0,entities:[],relationships:[]};let{elkGraph:n,entitySizes:r}=Di(e,t);return Oi(w(n,t.layoutCache),e,r,t)}var Ai=70,ji={attrSize:11,attrWeight:400,keySize:9,keyWeight:600};function Mi(t,n,r=`Inter`,i=!1,a=j,o,s,c,l={}){let u=[];u.push(Dr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push(R(r,!0,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(`</defs>`);for(let e of t.relationships)u.push(Fi(e));for(let e of t.entities)u.push(Ni(e,a));for(let e of t.relationships)u.push(Li(e));for(let e of t.relationships)u.push(Ii(e,a));return u.push(`</svg>`),u.join(`
40
- `)}function Ni(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(F.outerBox)),_=(0,e.escapeAttr)(f?.[`stroke-width`]??String(F.innerBox)),v=f?.fill?m:`var(--_group-hdr)`,y=f?.color?(0,e.escapeAttr)(f.color):f?.fill?(0,e.escapeAttr)((0,e.getReadableTextColor)(f.fill,`var(--_text)`)):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;p.push(e.f` <line x1="${i}" y1="${x}" x2="${i+o}" y2="${x}" `+e.f`stroke="${h}" stroke-width="${_}" />`);for(let e=0;e<d.length;e++){let t=d[e],n=x+e*l+l/2;p.push(` `+Pi(t,i,n,o,y).replace(/\n/g,`
41
- `))}return d.length===0&&p.push(e.f` <text x="${i+o/2}" y="${x+l/2}" text-anchor="middle" dy="${I}" `+e.f`font-size="${ji.attrSize}" fill="${y??`var(--_text-muted)`}" font-style="italic">(no attributes)</text>`),p.push(`</g>`),p.join(`
42
- `)}function Pi(t,n,r,i,a){let o=[],s=t.comment&&t.comment.length>0;if(t.comment&&t.comment.length>0){let n=t.comment.replace(/<br\s*\/?>/gi,`
43
- `);o.push(e.f`<g><title>${Bi(n)}</title>`)}let c=0;t.keys.length>0&&(c=D(t.keys.join(`,`),ji.keySize,ji.keyWeight)+8,o.push(e.f`<rect x="${n+6}" y="${r-7}" width="${c}" height="14" rx="2" ry="2" `+`fill="var(--_key-badge)" />`),o.push(e.f`<text x="${n+6+c/2}" y="${r}" text-anchor="middle" dy="${I}" `+e.f`font-size="${ji.keySize}" font-weight="${ji.keyWeight}" fill="${a??`var(--_text-sec)`}">${t.keys.join(`,`)}</text>`));let l=n+8+(c>0?c+6:0);o.push(e.f`<text x="${l}" y="${r}" class="mono" dy="${I}" `+e.f`font-size="${ji.attrSize}" font-weight="${ji.attrWeight}">`+e.f`<tspan fill="${a??`var(--_text-muted)`}">${Bi(t.type)}</tspan></text>`);let u=n+i-8;return o.push(e.f`<text x="${u}" y="${r}" class="mono" text-anchor="end" dy="${I}" `+e.f`font-size="${ji.attrSize}" font-weight="${ji.attrWeight}">`+e.f`<tspan fill="${a??`var(--_text-sec)`}">${Bi(t.name)}</tspan></text>`),s&&o.push(`</g>`),o.join(`
44
- `)}function Fi(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="${F.connector}"${r} />`}function Ii(t,n){if(!t.label||t.points.length<2)return``;let r=t.labelPoint??zi(t.points),i=(0,e.measureMultilineText)(t.label,n.edgeLabel,N.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="${N.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${Ai}%, var(--bg))"`)}`}function Li(e){if(e.points.length<2)return``;let t=[],n=e.points[0],r=e.points[1];t.push(Ri(n,r,e.cardinality1));let i=e.points[e.points.length-1],a=e.points[e.points.length-2];return t.push(Ri(i,a,e.cardinality2)),t.join(`
45
- `)}function Ri(t,n,r){let i=[],a=F.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(`
46
- `)}function zi(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 Bi=e.escapeXml,Vi={padding:30,actorGap:140,actorHeight:40,actorPadX:16,headerGap:20,messageRowHeight:40,selfMessageHeight:30,activationWidth:10,blockPadX:10,blockPadTop:40,blockPadBottom:8,blockHeaderExtra:28,dividerExtra:24,noteWidth:60,notePadX:12,notePadY:6,noteGap:10,noteOffsetAfterMessage:8,noteStackGap:4,boxPad:10};function Hi(e){return e+8}var Ui=14,Wi=new Set([`boundary`,`control`,`entity`,`database`]);function Gi(e){return e.type===`actor`||Wi.has(e.participantType)}var Ki=4;function qi(t,n,r){return 14+(0,e.measureMultilineText)(t,n,r).height/2}function Ji(e){return{...Vi,actorHeight:e?.actorHeight??Vi.actorHeight,headerGap:e?.headerGap??Vi.headerGap,messageRowHeight:e?.messageRowHeight??Vi.messageRowHeight,noteOffsetAfterMessage:e?.noteOffsetAfterMessage??Vi.noteOffsetAfterMessage,noteStackGap:e?.noteStackGap??Vi.noteStackGap}}var Yi=16;function Xi(t,n,r){let i=new Map(t.actors.map((e,t)=>[e.id,t]));for(let a of t.messages){if(!a.label)continue;let t=i.get(a.from),o=i.get(a.to),s=(0,e.measureMultilineText)(a.label,r,N.edgeLabel).width,c=t===o?[[t-1,t],[t,t+1]]:[[Math.min(t,o),Math.max(t,o)]],l=t===o?s/2+Yi:s+32;for(let[e,t]of c){if(e<0||t>=n.length)continue;let r=0;for(let i=e+1;i<=t;i++)r+=n[i];if(r>=l)continue;let i=(l-r)/(t-e);for(let r=e+1;r<=t;r++)n[r]+=i}}}function Zi(e,t={}){if(e.actors.length===0)return{width:0,height:0,actors:[],lifelines:[],messages:[],activations:[],blocks:[],notes:[],boxes:[]};let n=Ji(t.sequence),r=M(t.fontSizes),i=e.actors.map(e=>{let t=D(e.label,r.nodeLabel,N.nodeLabel);return Math.max(t+n.actorPadX*2,80)}),a=i.map((e,t)=>t===0?0:Math.max(n.actorGap,(i[t-1]+e)/2+40));Xi(e,a,r.edgeLabel);let o=[],s=n.padding+i[0]/2;for(let t=0;t<e.actors.length;t++)s+=a[t],o.push(s);let c=new Map;for(let t=0;t<e.actors.length;t++)c.set(e.actors[t].id,t);let l=e.boxes.filter(e=>e.actorIds.length>0),u=l.some(e=>e.label!==``),d=l.length===0?0:n.boxPad+(u?Hi(r.edgeLabel):0),f=n.padding+d,p=e.actors.map((e,t)=>({id:e.id,label:e.label,type:e.type,...e.participantType!==void 0&&{participantType:e.participantType},x:o[t],y:f,width:i[t],height:n.actorHeight})),m=l.map(e=>{let t=e.actorIds.map(e=>c.get(e)??0),r=Math.min(...t),a=Math.max(...t),s=o[r]-i[r]/2-n.boxPad,l=o[a]+i[a]/2+n.boxPad,u={label:e.label,x:s,y:n.padding,width:l-s,height:0};return e.color!==void 0&&(u.color=e.color),u}),h=e.actors.map(e=>Gi(e)?qi(e.label,r.nodeLabel,N.nodeLabel):0),g=Math.max(0,...e.actors.map((e,t)=>e.createdAt===void 0?h[t]:0)),_=r.edgeLabel+12,v=f+n.actorHeight+Math.max(n.headerGap,g>0?g+Ki+_:0),y=[],b=new Map;for(let t of e.blocks){let e=b.get(t.startIndex)??0;b.set(t.startIndex,Math.max(e,n.blockHeaderExtra));for(let e of t.dividers){let t=b.get(e.index)??0;b.set(e.index,Math.max(t,n.dividerExtra))}}let x=new Map;for(let t of e.notes){let e=x.get(t.afterIndex)??[];e.push(t),x.set(t.afterIndex,e)}let S=[],C=x.get(-1);if(C&&C.length>0){let e=v;for(let t of C){let a=Math.max(n.noteWidth,D(t.text,r.edgeLabel,N.edgeLabel)+n.notePadX*2),s=r.edgeLabel+n.notePadY*2,l=c.get(t.actorIds[0]??``)??0,u;if(t.position===`left`)u=o[l]-i[l]/2-a-n.noteGap;else if(t.position===`right`)u=o[l]+i[l]/2+n.noteGap;else if(t.actorIds.length>1){let e=c.get(t.actorIds[t.actorIds.length-1]??``)??l;u=(o[l]+o[e])/2-a/2}else u=o[l]-a/2;S.push({text:t.text,x:u,y:e,width:a,height:s,position:t.position,actors:t.actorIds}),e+=s+n.noteStackGap}v=Math.max(v,e+n.messageRowHeight/2)}let w=new Map,T=[],E=n.activationWidth/2;function O(e,t){let n=w.get(e)??[];w.set(e,n);let r=n.length;n.push({startY:t,depth:r})}function k(e,t){let r=w.get(e);if(!r||r.length===0)return;let{startY:i,depth:a}=r.pop(),s=c.get(e)??0,l=a*E;T.push({actorId:e,x:o[s]-n.activationWidth/2+l,topY:i,bottomY:t,width:n.activationWidth,depth:a})}let A=new Map;for(let t of e.activations){let e=A.get(t.afterIndex)??[];e.push(t),A.set(t.afterIndex,e)}function j(e,t){for(let n of A.get(e)??[])n.kind===`start`?O(n.actorId,t):k(n.actorId,t)}j(-1,v);for(let t=0;t<e.messages.length;t++){let a=e.messages[t],s=c.get(a.from)??0,l=c.get(a.to)??0,u=a.from===a.to,d=b.get(t)??0;d>0&&(v+=d);let f=o[s],p=o[l],m=!u&&e.actors[l].createdAt===t;if(m){let e=i[l]/2;p+=f<p?-e:e}y.push({from:a.from,to:a.to,label:a.label,lineStyle:a.lineStyle,arrowHead:a.arrowHead,x1:f,x2:p,y:v,isSelf:u,bidirectional:a.bidirectional??!1,seqNumber:a.seqNumber}),a.activate&&O(a.to,v),a.deactivate&&k(a.from,v),j(t,v),v+=u?n.selfMessageHeight+n.messageRowHeight:n.messageRowHeight,m&&(v+=n.actorHeight/2);let h=x.get(t);if(h&&h.length>0){let e=u?n.selfMessageHeight:0,a=y[t].y+e+n.noteOffsetAfterMessage;for(let e of h){let t=Math.max(n.noteWidth,D(e.text,r.edgeLabel,N.edgeLabel)+n.notePadX*2),s=r.edgeLabel+n.notePadY*2,l=c.get(e.actorIds[0]??``)??0,u;if(e.position===`left`)u=o[l]-i[l]/2-t-n.noteGap;else if(e.position===`right`)u=o[l]+i[l]/2+n.noteGap;else if(e.actorIds.length>1){let n=c.get(e.actorIds[e.actorIds.length-1]??``)??l;u=(o[l]+o[n])/2-t/2}else u=o[l]-t/2;S.push({text:e.text,x:u,y:a,width:t,height:s,position:e.position,actors:e.actorIds}),a+=s+n.noteStackGap}v=Math.max(v,a+n.messageRowHeight/2)}}for(let[e,t]of w)for(let{startY:r,depth:i}of t){let t=c.get(e)??0,a=i*E;T.push({actorId:e,x:o[t]-n.activationWidth/2+a,topY:r,bottomY:v-n.messageRowHeight/2,width:n.activationWidth,depth:i})}T.sort((e,t)=>e.depth-t.depth);let ee=e.blocks.map(t=>{let a=y[t.startIndex],s=y[t.endIndex],l=(a?.y??v)-n.blockPadTop,u=(s?.y??v)+n.blockPadBottom+12,d=new Set;for(let n=t.startIndex;n<=t.endIndex;n++){let t=e.messages[n];t&&(d.add(c.get(t.from)??0),d.add(c.get(t.to)??0))}if(d.size===0)for(let t=0;t<e.actors.length;t++)d.add(t);let f=Math.min(...d),p=Math.max(...d),m=o[f]-i[f]/2-n.blockPadX,h=o[p]+i[p]/2+n.blockPadX,g=t.dividers.map(e=>{let t=y[e.index],n=t?.y??v,i=28;if(e.label&&t?.label){let n=D(`[${e.label}]`,r.edgeLabel,N.edgeLabel),a=m+8,o=a+n,s=D(t.label,r.edgeLabel,N.edgeLabel),c=(t.x1+t.x2)/2-s/2,l=c+s;o>c&&a<l&&(i=36)}return{y:n-i,label:e.label}});return{type:t.type,label:t.label,...t.color===void 0?{}:{color:t.color},x:m,y:l,width:h-m,height:u-l,dividers:g}}),te=S,P=v+n.padding,F=n.padding,I=0;for(let e of p)F=Math.min(F,e.x-e.width/2),I=Math.max(I,e.x+e.width/2);for(let e of ee)F=Math.min(F,e.x),I=Math.max(I,e.x+e.width);for(let e of te)F=Math.min(F,e.x),I=Math.max(I,e.x+e.width);for(let e of m)F=Math.min(F,e.x),I=Math.max(I,e.x+e.width);for(let e of y)if(e.isSelf&&(I=Math.max(I,e.x1+30+8),e.label)){let t=D(e.label,r.edgeLabel,N.edgeLabel)/2+8;I=Math.max(I,e.x1+t),F=Math.min(F,e.x1-t)}let L=F<n.padding?n.padding-F:0;if(L>0){for(let e of p)e.x+=L;for(let e of y)e.x1+=L,e.x2+=L;for(let e of T)e.x+=L;for(let e of ee)e.x+=L;for(let e of te)e.x+=L;for(let e of m)e.x+=L;for(let e=0;e<o.length;e++)o[e]+=L}for(let t=0;t<e.actors.length;t++){let r=e.actors[t].createdAt;r!==void 0&&(p[t].y=(y[r]?.y??v)-n.actorHeight/2)}let R=e.actors.map((e,t)=>{let r=e.destroyedAt,i={actorId:e.id,x:o[t],topY:p[t].y+n.actorHeight+(h[t]>0?h[t]+Ki:0),bottomY:r===void 0?P-n.padding:y[r]?.y??v};return r!==void 0&&(i.destroyed=!0),i});for(let e of m)e.height=P-n.padding+n.boxPad-e.y;let z=I+L+n.padding;return{width:Math.max(z,200),height:Math.max(P,100),actors:p,lifelines:R,messages:y,activations:T,blocks:ee,notes:te,boxes:m}}function Qi(t,n,r=`Inter`,i=!1,a=j,o,s,c,l={}){let u=[];u.push(Dr((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($i()),u.push(`</defs>`);for(let e of t.boxes)u.push(_a(e,a));for(let e of t.blocks)u.push(ya(e,a));let d=la(t,a);for(let e of t.lifelines)u.push(da(e,d));for(let e of t.activations)u.push(pa(e));for(let e of t.messages)u.push(ma(e,a));for(let e of t.notes)u.push(ba(e,a));for(let e of t.actors)u.push(ta(e,a));return u.push(`</svg>`),u.join(`
47
- `)}function $i(){let t=L.width,n=L.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)" />`+`
35
+ </marker>`:``)}function di(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):u?.fill?(0,e.escapeAttr)((0,e.getReadableTextColor)(u.fill,`var(--_text)`)):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>${Ti(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="${si.annotationSize}" font-weight="${si.annotationWeight}" `+e.f`font-style="italic" fill="${_??`var(--_text-muted)`}">&lt;&lt;${Ti(t.annotation)}&gt;&gt;</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;d.push(e.f` <line x1="${i}" y1="${C}" x2="${i+o}" y2="${C}" `+e.f`stroke="${m}" stroke-width="${P.innerBox}" />`);for(let e=0;e<t.attributes.length;e++){let n=t.attributes[e],r=C+4+e*20+10;d.push(` `+pi(n,i+W.boxPadX,r,_))}let w=C+l;d.push(e.f` <line x1="${i}" y1="${w}" x2="${i+o}" y2="${w}" `+e.f`stroke="${m}" stroke-width="${P.innerBox}" />`);for(let e=0;e<t.methods.length;e++){let n=t.methods[e],r=w+4+e*20+10;d.push(` `+pi(n,i+W.boxPadX,r,_))}return x&&d.push(` </a>`),d.push(`</g>`),d.join(`
36
+ `)}var fi=700;function pi(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="${fi}">${Ti(t.visibility)}</tspan><tspan fill="${s}"> </tspan>`);let d=t.isMethod?e.f`${t.name}(${t.params||``})`:t.name;return u.push(e.f`<tspan fill="${c}">${Ti(d)}</tspan>`),t.type&&(u.push(e.f`<tspan fill="${s}">: </tspan>`),u.push(e.f`<tspan fill="${l}">${Ti(t.type)}</tspan>`)),e.f`<text x="${n}" y="${r}" class="mono" dy="${F}" `+e.f`font-size="${si.memberSize}" font-weight="${si.memberWeight}"${a}${o}>`+e.f`${u.join(``)}</text>`}var mi=6;function hi(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-mi},${i}`,e.f`${r+a},${i+mi}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `),l=e.f`${r+a-mi},${i} ${r+a},${i+mi} `+e.f`${r+a-mi},${i+mi}`;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)"`)}`+`
37
+ </g>`}function gi(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 _i(t){if(t.points.length<2)return``;let n=t.points.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.type===`dependency`||t.type===`realization`?` stroke-dasharray="6 4"`:``,i=yi(t.type,t.markerAt),a=[`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&&a.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.fromCardinality&&a.push(e.f`data-from-cardinality="${(0,e.escapeAttr)(t.fromCardinality)}"`),t.toCardinality&&a.push(e.f`data-to-cardinality="${(0,e.escapeAttr)(t.toCardinality)}"`),e.f`<polyline ${a.join(` `)} points="${n}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${P.connector}"${r}${i} />`}function vi(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)"`)+`
38
+ </g>`}function yi(t,n){let r=bi(t);return r?(n===`to`?``:e.f` marker-start="url(#${r})"`)+(n===`from`?``:e.f` marker-end="url(#${r})"`):``}function bi(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 xi(t,n){if(!t.label&&!t.fromCardinality&&!t.toCardinality||t.points.length<2)return``;let r=[];if(t.label){let i=Si(t.points,t.labelPosition??Ci(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=wi(i,a);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="middle" 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=wi(i,a);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="middle" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`))}return r.join(`
39
+ `)}function Si(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 Ci(e){return e.length===0?{x:0,y:0}:e[Math.floor(e.length/2)]}function wi(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.abs(n)>Math.abs(r)?{x:n>0?14:-14,y:-10}:{x:-14,y:r>0?14:-14}}var Ti=e.escapeXml,G={padding:40,boxPadX:14,headerHeight:34,rowHeight:22,minWidth:140,attrFontSize:11,attrFontWeight:400,nodeSpacing:70,layerSpacing:90,loopOut:20,loopHalf:10,loopLabelGap:4,loopNestGap:16,loopMargin:12};function Ei(t,n,r){let i=j(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+G.loopLabelGap+t.labelW+G.loopNestGap:G.loopOut,labelW:s})}return a}function Di(e){return e.length*Math.ceil(O(`M`,G.attrFontSize))}function Oi(e,t){let n=new Map,r=j(t.fontSizes);for(let t of e.entities){let e=D(t.label,r.nodeLabel,M.nodeLabel),i=0;for(let e of t.attributes){let t=Di(`${e.type} ${e.name}${e.keys.length>0?` `+e.keys.join(`,`):``}`);t>i&&(i=t)}let a=Math.max(G.minWidth,e+G.boxPadX*2,i+G.boxPadX*2),o=G.headerHeight+Math.max(t.attributes.length,1)*G.rowHeight;n.set(t.id,{width:a,height:o})}let i=[];for(let[e,t]of n)i.push(B(e,t));let a={fontSize:r.edgeLabel},o=[];for(let[t,n]of e.relationships.entries())n.entity1!==n.entity2&&o.push(ce({id:`e${t}`,source:n.entity1,target:n.entity2,label:n.label,labelStyle:a}));let s=0;for(let n of e.entities){let r=Ei(e,n.id,t),i=r[r.length-1];i&&(s=Math.max(s,i.out+i.labelW))}return{elkGraph:{id:`root`,layoutOptions:{...z({direction:ie(e.direction,re.er),nodeSpacing:Math.max(G.nodeSpacing,s+20),layerSpacing:Math.max(G.layerSpacing,s+20),padding:G.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.separateConnectedComponents":`false`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:i,edges:o},entitySizes:n}}function ki(t,n,r,i){let a=new Map;for(let e of n.entities)a.set(e.id,e);let o=[];for(let i of t.children??[]){let t=a.get(i.id);if(t){let a=r.get(t.id);if(!a)throw Error(`Missing computed size for entity "${t.id}"`);o.push({id:t.id,label:t.label,attributes:t.attributes,x:i.x??0,y:i.y??0,width:i.width??a.width,height:i.height??a.height,headerHeight:G.headerHeight,rowHeight:G.rowHeight,inlineStyle:(0,e.resolveNodeStyle)(t.id,n),className:n.classAssignments.get(t.id)})}}let s=new Map((t.edges??[]).map(e=>[e.id,e])),c=[],l=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){c.push({...r,points:Ke(s.get(`e${e}`))});continue}let a=o.find(e=>e.id===t.entity1),u=Ei(n,t.entity1,i).find(t=>t.index===e),d=a.y+a.height/2,f=Math.max(G.loopHalf,a.height/8)+10*u.nest,p=a.x-u.out;c.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-G.loopLabelGap-u.labelW/2,y:d}}),l=Math.min(l,p-G.loopLabelGap-u.labelW)}let u=Math.max(0,G.loopMargin-l);if(u>0){for(let e of o)e.x+=u;for(let e of c){for(let t of e.points)t.x+=u;e.labelPoint&&(e.labelPoint.x+=u)}}return{width:(t.width??600)+u,height:t.height??400,entities:o,relationships:c}}function Ai(e,t={}){if(e.entities.length===0)return{width:0,height:0,entities:[],relationships:[]};let{elkGraph:n,entitySizes:r}=Oi(e,t);return ki(w(n,t.layoutCache),e,r,t)}var ji=70,Mi={attrSize:11,attrWeight:400,keySize:9,keyWeight:600};function Ni(t,n,r=`Inter`,i=!1,a=A,o,s,c,l={}){let u=[];u.push(Or((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push(L(r,!0,l.nonce,l.bodyFont)),u.push(`<defs>`),u.push(`</defs>`);for(let e of t.relationships)u.push(Ii(e));for(let e of t.entities)u.push(Pi(e,a));for(let e of t.relationships)u.push(Ri(e));for(let e of t.relationships)u.push(Li(e,a));return u.push(`</svg>`),u.join(`
40
+ `)}function Pi(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):f?.fill?(0,e.escapeAttr)((0,e.getReadableTextColor)(f.fill,`var(--_text)`)):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;p.push(e.f` <line x1="${i}" y1="${x}" x2="${i+o}" y2="${x}" `+e.f`stroke="${h}" stroke-width="${_}" />`);for(let e=0;e<d.length;e++){let t=d[e],n=x+e*l+l/2;p.push(` `+Fi(t,i,n,o,y).replace(/\n/g,`
41
+ `))}return d.length===0&&p.push(e.f` <text x="${i+o/2}" y="${x+l/2}" text-anchor="middle" dy="${F}" `+e.f`font-size="${Mi.attrSize}" fill="${y??`var(--_text-muted)`}" font-style="italic">(no attributes)</text>`),p.push(`</g>`),p.join(`
42
+ `)}function Fi(t,n,r,i,a){let o=[],s=t.comment&&t.comment.length>0;if(t.comment&&t.comment.length>0){let n=t.comment.replace(/<br\s*\/?>/gi,`
43
+ `);o.push(e.f`<g><title>${Vi(n)}</title>`)}let c=0;t.keys.length>0&&(c=D(t.keys.join(`,`),Mi.keySize,Mi.keyWeight)+8,o.push(e.f`<rect x="${n+6}" y="${r-7}" width="${c}" height="14" rx="2" ry="2" `+`fill="var(--_key-badge)" />`),o.push(e.f`<text x="${n+6+c/2}" y="${r}" text-anchor="middle" dy="${F}" `+e.f`font-size="${Mi.keySize}" font-weight="${Mi.keyWeight}" fill="${a??`var(--_text-sec)`}">${t.keys.join(`,`)}</text>`));let l=n+8+(c>0?c+6:0);o.push(e.f`<text x="${l}" y="${r}" class="mono" dy="${F}" `+e.f`font-size="${Mi.attrSize}" font-weight="${Mi.attrWeight}">`+e.f`<tspan fill="${a??`var(--_text-muted)`}">${Vi(t.type)}</tspan></text>`);let u=n+i-8;return o.push(e.f`<text x="${u}" y="${r}" class="mono" text-anchor="end" dy="${F}" `+e.f`font-size="${Mi.attrSize}" font-weight="${Mi.attrWeight}">`+e.f`<tspan fill="${a??`var(--_text-sec)`}">${Vi(t.name)}</tspan></text>`),s&&o.push(`</g>`),o.join(`
44
+ `)}function Ii(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 Li(t,n){if(!t.label||t.points.length<2)return``;let r=t.labelPoint??Bi(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) ${ji}%, var(--bg))"`)}`}function Ri(e){if(e.points.length<2)return``;let t=[],n=e.points[0],r=e.points[1];t.push(zi(n,r,e.cardinality1));let i=e.points[e.points.length-1],a=e.points[e.points.length-2];return t.push(zi(i,a,e.cardinality2)),t.join(`
45
+ `)}function zi(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(`
46
+ `)}function Bi(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 Vi=e.escapeXml,Hi={padding:30,actorGap:140,actorHeight:40,actorPadX:16,headerGap:20,messageRowHeight:40,selfMessageHeight:30,activationWidth:10,blockPadX:10,blockPadTop:40,blockPadBottom:8,blockHeaderExtra:28,dividerExtra:24,noteWidth:60,notePadX:12,notePadY:6,noteGap:10,noteOffsetAfterMessage:8,noteStackGap:4,boxPad:10},Ui=60,Wi=45,Gi=20;function Ki(e){return e+8}var qi=14,Ji=new Set([`boundary`,`control`,`entity`,`database`]);function Yi(e){return e.type===`actor`||Ji.has(e.participantType)}var Xi=4;function Zi(t,n,r){return 14+(0,e.measureMultilineText)(t,n,r).height/2}function Qi(e){return{...Hi,actorHeight:e?.actorHeight??Hi.actorHeight,headerGap:e?.headerGap??Hi.headerGap,messageRowHeight:e?.messageRowHeight??Hi.messageRowHeight,noteOffsetAfterMessage:e?.noteOffsetAfterMessage??Hi.noteOffsetAfterMessage,noteStackGap:e?.noteStackGap??Hi.noteStackGap}}var $i=16;function ea(t,n,r=M.edgeLabel){return(0,e.measureMultilineText)(t,n,r).width}function ta(e,t){return e.type===`rect`&&e.color!==void 0?0:ea(`${e.type}${e.label?` [${e.label}]`:``}`.split(`
47
+ `)[0],t,M.groupHeader)+16}function na(e){return e.map((t,n)=>e.slice(0,n).flatMap((e,n)=>e.startIndex>=t.startIndex&&e.endIndex<=t.endIndex?[n]:[]))}function ra(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=ea(t.label,i);e===n?(o(e-1,e,r/2+$i),o(e,e+1,r/2+$i)):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,ea(n.text,i)+r.notePadX*2),c=t[e]/2+r.noteGap+s+$i;n.position===`right`?o(e,e+1,c):n.position===`left`?o(e-1,e,c):n.actorIds.length===1&&(o(e,e+1,s/2+$i),o(e-1,e,s/2+$i))}for(let n of e.blocks){let s=e.actors.length;for(let t=n.startIndex;t<=n.endIndex;t++){let n=e.messages[t];n&&(s=Math.min(s,a.get(n.from),a.get(n.to)))}if(s===e.actors.length)continue;let c=-t[s]/2-r.blockPadX;o(s,s+1,c+ta(n,i)+$i);for(let e of n.dividers)e.label&&o(s,s+1,c+8+ea(`[${e.label}]`,i)+$i)}}function ia(t,n={}){if(t.actors.length===0)return{width:0,height:0,actors:[],lifelines:[],messages:[],activations:[],blocks:[],notes:[],boxes:[]};let r=Qi(n.sequence),i=j(n.fontSizes),a=t.actors.map(e=>{let t=D(e.label,i.nodeLabel,M.nodeLabel);return Math.max(t+r.actorPadX*2,80)}),o=a.map((e,t)=>t===0?0:Math.max(r.actorGap,(a[t-1]+e)/2+40));ra(t,a,o,r,i.edgeLabel);let s=[],c=r.padding+a[0]/2;for(let e=0;e<t.actors.length;e++)c+=o[e],s.push(c);let l=new Map;for(let e=0;e<t.actors.length;e++)l.set(t.actors[e].id,e);let u=t.boxes.filter(e=>e.actorIds.length>0),d=u.some(e=>e.label!==``),f=u.length===0?0:r.boxPad+(d?Ki(i.edgeLabel):0),p=r.padding+f,m=t.actors.map((e,t)=>({id:e.id,label:e.label,type:e.type,...e.participantType!==void 0&&{participantType:e.participantType},x:s[t],y:p,width:a[t],height:r.actorHeight})),h=u.map(e=>{let t=e.actorIds.map(e=>l.get(e)??0),n=Math.min(...t),i=Math.max(...t),o=s[n]-a[n]/2-r.boxPad,c=s[i]+a[i]/2+r.boxPad,u={label:e.label,x:o,y:r.padding,width:c-o,height:0};return e.color!==void 0&&(u.color=e.color),u}),g=t.actors.map(e=>Yi(e)?Zi(e.label,i.nodeLabel,M.nodeLabel):0),_=Math.max(0,...t.actors.map((e,t)=>e.createdAt===void 0?g[t]:0)),v=i.edgeLabel+12,y=p+r.actorHeight+Math.max(r.headerGap,_>0?_+Xi+v:0),b=[],x=new Map,S=new Map;for(let e of t.blocks){x.set(e.startIndex,(x.get(e.startIndex)??0)+r.blockHeaderExtra);for(let t of e.dividers)S.set(t.index,r.dividerExtra)}let C=na(t.blocks),w=new Map;t.blocks.forEach((e,t)=>{let n=w.get(e.endIndex)??[];n.push(t),w.set(e.endIndex,n)});let T=[],E=e=>t.notes.slice(e.noteStartIndex,e.noteEndIndex),O=new Map;for(let e of t.notes){let t=O.get(e.afterIndex)??[];t.push(e),O.set(e.afterIndex,t)}let k=[],ee=new Map,A=(t,n)=>{let o=Math.max(r.noteWidth,ea(t.text,i.edgeLabel)+r.notePadX*2),c=t.text.split(`
48
+ `).length,u=i.edgeLabel*(1+(c-1)*e.LINE_HEIGHT_RATIO)+r.notePadY*2,d=l.get(t.actorIds[0]??``)??0,f;if(t.position===`left`)f=s[d]-a[d]/2-o-r.noteGap;else if(t.position===`right`)f=s[d]+a[d]/2+r.noteGap;else if(t.actorIds.length>1){let e=l.get(t.actorIds[t.actorIds.length-1]??``)??d;f=(s[d]+s[e])/2-o/2}else f=s[d]-o/2;let p={text:t.text,x:f,y:n,width:o,height:u,position:t.position,actors:t.actorIds};return k.push(p),ee.set(t,p),n+u+r.noteStackGap},te=O.get(-1);if(te&&te.length>0){let e=y;for(let t of te)e=A(t,e);y=Math.max(y,e+r.messageRowHeight/2)}let ne=new Map,N=[],P=r.activationWidth/2;function F(e,t){let n=ne.get(e)??[];ne.set(e,n);let r=n.length;n.push({startY:t,depth:r})}function I(e,t){let n=ne.get(e);if(!n||n.length===0)return;let{startY:i,depth:a}=n.pop(),o=l.get(e)??0,c=a*P;N.push({actorId:e,x:s[o]-r.activationWidth/2+c,topY:i,bottomY:t,width:r.activationWidth,depth:a})}let L=new Map;for(let e of t.activations){let t=L.get(e.afterIndex)??[];t.push(e),L.set(e.afterIndex,t)}function R(e,t){for(let n of L.get(e)??[])n.kind===`start`?F(n.actorId,t):I(n.actorId,t)}R(-1,y);for(let e=0;e<t.messages.length;e++){let n=t.messages[e],i=l.get(n.from)??0,o=l.get(n.to)??0,c=n.from===n.to;y+=(x.get(e)??0)+(S.get(e)??0);let u=s[i],d=s[o],f=!c&&t.actors[o].createdAt===e;if(f){let e=a[o]/2;d+=u<d?-e:e}b.push({from:n.from,to:n.to,label:n.label,lineStyle:n.lineStyle,arrowHead:n.arrowHead,x1:u,x2:d,y,isSelf:c,bidirectional:n.bidirectional??!1,seqNumber:n.seqNumber}),n.activate&&F(n.to,y),n.deactivate&&I(n.from,y),R(e,y),y+=c?r.selfMessageHeight+r.messageRowHeight:r.messageRowHeight,f&&(y+=r.actorHeight/2);let p=n=>{let i=b[e].y+(c?20:0)+r.blockPadBottom+12;for(let e of E(t.blocks[n])){let t=ee.get(e);i=Math.max(i,t.y+t.height+r.blockPadBottom)}for(let e of C[n])i=Math.max(i,T[e]+r.blockPadBottom);T[n]=i,y=Math.max(y,i+r.messageRowHeight/2)},m=w.get(e)??[],h=O.get(e);if(h&&h.length>0){let n=c?r.selfMessageHeight:0,i=b[e].y+n+r.noteOffsetAfterMessage;for(let e of h){let n=t.notes.indexOf(e);for(let e of m)T[e]===void 0&&t.blocks[e].noteEndIndex<=n&&(p(e),i=Math.max(i,T[e]+r.noteOffsetAfterMessage));i=A(e,i)}y=Math.max(y,i+r.messageRowHeight/2)}for(let e of m)T[e]===void 0&&p(e)}for(let[e,t]of ne)for(let{startY:n,depth:i}of t){let t=l.get(e)??0,a=i*P;N.push({actorId:e,x:s[t]-r.activationWidth/2+a,topY:n,bottomY:y-r.messageRowHeight/2,width:r.activationWidth,depth:i})}N.sort((e,t)=>e.depth-t.depth);let re=[];t.blocks.forEach((e,n)=>{let o=C[n].map(e=>re[e]),c=(b[e.startIndex]?.y??y)-r.blockPadTop;for(let e of o)c=Math.min(c,e.y-r.blockHeaderExtra);let u=T[n]??y+r.blockPadBottom+12,d=new Set;for(let n=e.startIndex;n<=e.endIndex;n++){let e=t.messages[n];e&&(d.add(l.get(e.from)??0),d.add(l.get(e.to)??0))}if(d.size===0)for(let e=0;e<t.actors.length;e++)d.add(e);let f=Math.min(...d),p=Math.max(...d),m=s[f]-a[f]/2-r.blockPadX,h=s[p]+a[p]/2+r.blockPadX;for(let t of E(e)){let e=ee.get(t);m=Math.min(m,e.x-r.blockPadX),h=Math.max(h,e.x+e.width+r.blockPadX)}for(let e of o)m=Math.min(m,e.x-r.blockPadX),h=Math.max(h,e.x+e.width+r.blockPadX);h=Math.max(h,m+ta(e,i.edgeLabel)+r.blockPadX);for(let t of e.dividers)t.label&&(h=Math.max(h,m+8+ea(`[${t.label}]`,i.edgeLabel)+$i));let g=e.dividers.map(e=>{let a=o.filter((r,i)=>t.blocks[C[n][i]].startIndex===e.index);if(a.length>0)return{y:Math.min(...a.map(e=>e.y))-r.dividerExtra,label:e.label};let s=b[e.index],c=s?.y??y,l=28;if(e.label&&s?.label){let t=D(`[${e.label}]`,i.edgeLabel,M.edgeLabel),n=m+8,r=n+t,a=D(s.label,i.edgeLabel,M.edgeLabel),o=(s.x1+s.x2)/2-a/2,c=o+a;r>o&&n<c&&(l=40)}return{y:c-l,label:e.label}});re.push({type:e.type,label:e.label,...e.color===void 0?{}:{color:e.color},x:m,y:c,width:h-m,height:u-c,dividers:g})});let ie=k,ae=y+r.padding,z=r.padding,B=0;for(let e of m)z=Math.min(z,e.x-e.width/2),B=Math.max(B,e.x+e.width/2);for(let e of re)z=Math.min(z,e.x),B=Math.max(B,e.x+e.width);for(let e of ie)z=Math.min(z,e.x),B=Math.max(B,e.x+e.width);for(let e of h)z=Math.min(z,e.x),B=Math.max(B,e.x+e.width);for(let e of b)if(e.isSelf&&(B=Math.max(B,e.x1+45+8),e.label)){let t=D(e.label,i.edgeLabel,M.edgeLabel)/2+8;B=Math.max(B,e.x1+t),z=Math.min(z,e.x1-t)}let oe=z<r.padding?r.padding-z:0;if(oe>0){for(let e of m)e.x+=oe;for(let e of b)e.x1+=oe,e.x2+=oe;for(let e of N)e.x+=oe;for(let e of re)e.x+=oe;for(let e of ie)e.x+=oe;for(let e of h)e.x+=oe;for(let e=0;e<s.length;e++)s[e]+=oe}for(let e=0;e<t.actors.length;e++){let n=t.actors[e].createdAt;n!==void 0&&(m[e].y=(b[n]?.y??y)-r.actorHeight/2)}let se=t.actors.map((e,t)=>{let n=e.destroyedAt,i={actorId:e.id,x:s[t],topY:m[t].y+r.actorHeight+(g[t]>0?g[t]+Xi:0),bottomY:n===void 0?ae-r.padding:b[n]?.y??y};return n!==void 0&&(i.destroyed=!0),i});for(let e of h)e.height=ae-r.padding+r.boxPad-e.y;let ce=B+oe+r.padding;return{width:Math.max(ce,200),height:Math.max(ae,100),actors:m,lifelines:se,messages:b,activations:N,blocks:re,notes:ie,boxes:h}}function aa(t,n,r=`Inter`,i=!1,a=A,o,s,c,l={}){let u=[];u.push(Or((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(oa()),u.push(`</defs>`);for(let e of t.boxes)u.push(Sa(e,a));for(let e of t.blocks)u.push(wa(e,a));let d=ma(t,a);for(let e of t.lifelines)u.push(ga(e,d));for(let e of t.activations)u.push(va(e));for(let e of t.messages)u.push(ya(e,a));for(let e of t.notes)u.push(Ta(e,a));for(let e of t.actors)u.push(ca(e,a));return u.push(`</svg>`),u.join(`
49
+ `)}function oa(){let t=I.width,n=I.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)" />`+`
48
50
  </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" />`+`
49
- </marker>`}var ea={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 ta(t,n){let{id:r,x:i,y:a,width:o,height:s,label:c,type:l,participantType:u}=t,d=[],f=e.f`font-size="${n.nodeLabel}" text-anchor="middle" font-weight="${N.nodeLabel}" fill="var(--_text)"`;if(d.push(e.f`<g class="actor" data-id="${(0,e.escapeAttr)(r)}" data-label="${(0,e.escapeAttr)(c)}" data-type="${l}">`),l===`actor`){let t=s/24*.9,r=i-12*t,o=a+(s-24*t)/2,l=F.outerBox/t,u=`var(--_line)`;d.push(e.f` <g transform="translate(${r},${o}) scale(${t})">`+e.f`\n <path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" fill="none" stroke="${u}" stroke-width="${l}" />`+e.f`\n <path d="M15 10C15 11.6569 13.6569 13 12 13C10.3431 13 9 11.6569 9 10C9 8.34315 10.3431 7 12 7C13.6569 7 15 8.34315 15 10Z" fill="none" stroke="${u}" stroke-width="${l}" />`+e.f`\n <path d="M5.62842 18.3563C7.08963 17.0398 9.39997 16 12 16C14.6 16 16.9104 17.0398 18.3716 18.3563" fill="none" stroke="${u}" stroke-width="${l}" />`+`
50
- </g>`),d.push(` `+(0,e.renderMultilineText)(c,i,a+s+14,n.nodeLabel,f))}else if(Gi(t)){let t=s/24*.9,r=F.outerBox/t,o=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${r}"`,l=e.f`fill="none" stroke="var(--_node-stroke)" stroke-width="${r}"`,p=ea[u](o,l);d.push(e.f` <g transform="translate(${i-12*t},${a+(s-24*t)/2}) scale(${t})">${p}\n </g>`),d.push(` `+(0,e.renderMultilineText)(c,i,a+s+14,n.nodeLabel,f))}else{let t=i-o/2,r=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${F.outerBox}"`,l=i,p=a+s/2;if(u===`queue`){let n=s/2,i=t+8,c=t+o-8;d.push(e.f` <path d="M${i},${a}H${c}A${8},${n} 0 0 1 ${c},${a+s}H${i}A${8},${n} 0 0 1 ${i},${a}Z" ${r} />`,e.f` <path d="M${c},${a}A${8},${n} 0 0 0 ${c},${a+s}" fill="none" stroke="var(--_node-stroke)" stroke-width="${F.outerBox}" />`)}else u===`collections`?(d.push(e.f` <rect x="${t+4}" y="${a}" width="${o-4}" height="${s-4}" rx="4" ry="4" ${r} />`,e.f` <rect x="${t}" y="${a+4}" width="${o-4}" height="${s-4}" rx="4" ry="4" ${r} />`),l=i-2,p=a+2+(s-4)/2):d.push(e.f` <rect x="${t}" y="${a}" width="${o}" height="${s}" rx="4" ry="4" ${r} />`);d.push(` `+(0,e.renderMultilineText)(c,l,p,n.nodeLabel,f))}return d.push(`</g>`),d.join(`
51
- `)}var na=30,ra=20,ia=10,aa=18,oa=3,sa=2,ca=3;function la(t,n){let r=[],i=t=>(0,e.measureMultilineText)(t,n.edgeLabel,N.edgeLabel),a=(e,t,n)=>{let a=i(e);r.push({x0:t-a.width/2,x1:t+a.width/2,y0:n-a.height/2,y1:n+a.height/2})},o=(e,t,n)=>{let a=i(e);r.push({x0:t,x1:t+a.width,y0:n-a.height/2,y1:n+a.height/2})};for(let e of t.messages)e.label&&a(e.label,(e.x1+e.x2)/2,e.y-ia);for(let e of t.blocks){if(va(e))continue;let t=D(`${e.type}${e.label?` [${e.label}]`:``}`.split(`
52
- `)[0]??``,n.edgeLabel,N.groupHeader)+16;r.push({x0:e.x,x1:e.x+t,y0:e.y,y1:e.y+aa});for(let t of e.dividers)t.label&&o(`[${t.label}]`,e.x+8,t.y+14)}return r}function ua(e,t){let n=t.filter(t=>e.x>t.x0-oa&&e.x<t.x1+oa&&t.y1+sa>e.topY&&t.y0-sa<e.bottomY).map(e=>[e.y0-sa,e.y1+sa]).sort((e,t)=>e[0]-t[0]),r=[],i=e.topY;for(let[e,t]of n)e-i>=ca&&r.push([i,e]),i=Math.max(i,t);return e.bottomY-i>=ca&&r.push([i,e.bottomY]),r.length>0?r:[[e.topY,e.bottomY]]}function da(t,n){let r=ua(t,n).map(([n,r])=>e.f`<line class="lifeline" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x1="${t.x}" y1="${n}" x2="${t.x}" y2="${r}" `+`stroke="var(--_line)" stroke-width="0.75" stroke-dasharray="6 4" />`).join(`
53
- `);if(!t.destroyed)return r;let{x:i,bottomY:a}=t,o=fa;return r+e.f`\n<path class="destroy" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`d="M${i-o} ${a-o} L${i+o} ${a+o} M${i+o} ${a-o} L${i-o} ${a+o}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${F.outerBox}" stroke-linecap="round" />`}var fa=8;function pa(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="${F.innerBox}" />`}function ma(t,n){let r=[],i=t.lineStyle===`dashed`?` stroke-dasharray="6 4"`:``,a=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.isSelf){let n=na,s=ra;r.push(e.f` <polyline points="${t.x1},${t.y} ${t.x1+n},${t.y} ${t.x1+n},${t.y+s} ${t.x2},${t.y+s}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${F.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="${F.connector}"${i} marker-end="url(#${a})"${o} />`);return r.push(` `+(0,e.renderMultilineText)(t.label,(t.x1+t.x2)/2,t.y-ia,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${N.edgeLabel}" fill="var(--_text-muted)"`)),t.seqNumber!==void 0&&r.push(` `+ha(t,n)),r.push(`</g>`),r.join(`
54
- `)}function ha(t,n){let r=Math.max(n.edgeLabel-2,8),i=t.bidirectional?t.x1+Math.sign(t.x2-t.x1)*(8+L.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="${F.innerBox}" />`+(0,e.renderMultilineText)(String(t.seqNumber),i,t.y,r,e.f`font-size="${r}" text-anchor="middle" font-weight="${N.edgeLabel}" fill="var(--_arrow)"`)+`</g>`}var ga=35;function _a(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)} ${ga}%, 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="${F.innerBox}" />`];return t.label&&o.push(` `+(0,e.renderMultilineText)(t.label,t.x+t.width/2,t.y+Hi(n.edgeLabel)/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${N.groupHeader}" fill="var(--_text-sec)"`)),o.push(`</g>`),o.join(`
55
- `)}function va(e){return e.type===`rect`&&e.color!==void 0}function ya(t,n){let r=[];if(va(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(`
56
- `);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="${F.outerBox}" />`);let a=e.f`${t.type}${t.label?e.f` [${t.label}]`:``}`,o=a.split(`
57
- `)[0],s=D(o,n.edgeLabel,N.groupHeader)+16,c=aa;r.push(e.f` <rect x="${t.x}" y="${t.y}" width="${s}" height="${c}" `+e.f`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${F.outerBox}" />`),r.push(` `+(0,e.renderMultilineText)(a,t.x+6,t.y+c/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" font-weight="${N.groupHeader}" 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="0.75" stroke-dasharray="6 4" />`),i.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${i.label}]`,t.x+8,i.y+14,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="start" font-weight="${N.edgeLabel}" fill="var(--_text-muted)"`));return r.push(`</g>`),r.join(`
58
- `)}function ba(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)}"`:``,l=[e.f`${r},${i}`,e.f`${r+a-6},${i}`,e.f`${r+a},${i+6}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `);return e.f`<g class="note"${c}${s}>`+e.f`\n <polygon points="${l}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${F.innerBox}" />`+e.f`\n <polygon points="${r+a-6},${i} ${r+a},${i+6} ${r+a-6},${i+6}" `+e.f`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${F.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="${N.edgeLabel}" fill="var(--_text-muted)"`)}`+`
59
- </g>`}var G={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4,barPadRatio:.2,barGroupGap:0,maxBarWidth:40,legendFontSize:14,legendFontWeight:400,legendHeight:28,legendSwatchW:14,legendSwatchH:14,legendGap:6,legendItemGap:16};function xa(e,t={}){return e.horizontal?Ca(e):Sa(e)}function Sa(t){let n=!!t.title,r=!!t.xAxis.title,i=!!t.yAxis.title,a=t.series.length>1,o=t.yAxis.range;if(!o)throw Error(`XY chart: y-axis range was not set by the parser`);let s=(0,e.niceTickValues)(o.min,o.max),c=ja(s),l=Math.max(...c.map(e=>D(e,G.axisLabelFontSize,G.axisLabelFontWeight)),G.yLabelWidth),u=G.padding+(n?G.titleHeight:0)+(a?G.legendHeight:0),d=G.padding+G.xLabelHeight+(r?G.axisTitlePad:0),f=G.padding+l+G.yLabelGap+(i?G.axisTitlePad:0),p=G.padding,m=G.plotWidth,h=G.plotHeight,g=f+m+p,_=u+h+d,v={x:f,y:u,width:m,height:h},y=wa(t),b=e=>f+(e+.5)*(m/y),x=m/y,S=e=>{let t=(e-o.min)/(o.max-o.min||1);return u+h-t*h},C=Oa(t,b,u+h,x),w=s.map((e,t)=>({label:c[t],x:f,y:S(e),tx:f-G.tickLength,ty:S(e),labelX:f-G.yLabelGap,labelY:S(e),textAnchor:`end`})),T=s.map(e=>({x1:f,y1:S(e),x2:f+m,y2:S(e)})),E=Ta(t,y),O=t.series.map((e,t)=>t),k=ka(t,b,S,x,o.min,E,O),A=Aa(t,b,S,E,O),j=G.padding+(n?G.titleHeight:0)+G.legendHeight/2,M=a?Na(t,g/2,j,O):[],N={x1:f,y1:u+h,x2:f+m,y2:u+h},ee={x1:f,y1:u,x2:f,y2:u+h},te={ticks:C,line:N,...t.xAxis.title?{title:{text:t.xAxis.title,x:f+m/2,y:_-G.padding}}:{}},P={ticks:w,line:ee,...t.yAxis.title?{title:{text:t.yAxis.title,x:G.padding+4,y:u+h/2,rotate:-90}}:{}};return{width:g,height:_,title:t.title?{text:t.title,x:g/2,y:G.padding+G.titleFontSize}:void 0,xAxis:te,yAxis:P,plotArea:v,bars:k,lines:A,gridLines:T,legend:M}}function Ca(t){let n=!!t.title,r=!!t.xAxis.title,i=!!t.yAxis.title,a=t.series.length>1,o=t.yAxis.range;if(!o)throw Error(`XY chart: y-axis range was not set by the parser`);let s=(0,e.niceTickValues)(o.min,o.max),c=ja(s),l=wa(t),u=Ta(t,l),d=Math.max(...u.map(e=>D(e,G.axisLabelFontSize,G.axisLabelFontWeight)),40),f=G.padding+(n?G.titleHeight:0)+(a?G.legendHeight:0),p=G.padding+G.xLabelHeight+(i?G.axisTitlePad:0),m=G.padding+d+G.yLabelGap+(r?G.axisTitlePad:0),h=Math.max(G.padding,D(c[c.length-1],G.axisLabelFontSize,G.axisLabelFontWeight)/2+4),g=G.plotWidth,_=G.plotHeight,v=m+g+h,y=f+_+p,b={x:m,y:f,width:g,height:_},x=e=>{let t=(e-o.min)/(o.max-o.min||1);return m+t*g},S=_/l,C=e=>f+(e+.5)*S,w=s.map((e,t)=>({label:c[t],x:x(e),y:f+_,tx:x(e),ty:f+_+G.tickLength,labelX:x(e),labelY:f+_+18,textAnchor:`middle`})),T=u.map((e,t)=>({label:e,x:m,y:C(t),tx:m-G.tickLength,ty:C(t),labelX:m-G.yLabelGap,labelY:C(t),textAnchor:`end`})),E=s.map(e=>({x1:x(e),y1:f,x2:x(e),y2:f+_})),O=t.series.map((e,t)=>t),k=t.series.filter(e=>e.type===`bar`).length,A=[];if(k>0){let e=S*(1-G.barPadRatio),n=k>1?(e-(k-1)*G.barGroupGap)/k:e,r=Math.min(n,G.maxBarWidth),i=k>1?r*k+G.barGroupGap*(k-1):r,a=0,s=0;for(let e of t.series){if(e.type!==`bar`){s++;continue}for(let t=0;t<e.data.length;t++){let n=C(t)-i/2+a*(r+G.barGroupGap),c=x(Math.max(e.data[t],o.min)),l=x(Math.max(0,o.min));A.push({x:Math.min(l,c),y:n,width:Math.abs(c-l),height:r,value:e.data[t],label:u[t],seriesIndex:a,colorIndex:O[s]})}a++,s++}}let j=[],M=0,N=0;for(let e of t.series){if(e.type!==`line`){N++;continue}let t=e.data.map((e,t)=>({x:x(e),y:C(t),value:e,label:u[t]}));j.push({points:t,seriesIndex:M,colorIndex:O[N]}),M++,N++}let ee={x1:m,y1:f+_,x2:m+g,y2:f+_},te={x1:m,y1:f,x2:m,y2:f+_},P={ticks:w,line:ee,...t.yAxis.title?{title:{text:t.yAxis.title,x:m+g/2,y:y-G.padding}}:{}},F={ticks:T,line:te,...t.xAxis.title?{title:{text:t.xAxis.title,x:G.padding+4,y:f+_/2,rotate:-90}}:{}},I=t.title?{text:t.title,x:v/2,y:G.padding+G.titleFontSize}:void 0,L=G.padding+(n?G.titleHeight:0)+G.legendHeight/2;return{width:v,height:y,horizontal:!0,title:I,xAxis:P,yAxis:F,plotArea:b,bars:A,lines:j,gridLines:E,legend:a?Na(t,v/2,L,O):[]}}function wa(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 Ta(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)=>Ma(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var Ea=8;function Da(e,t){let n=e.map(e=>D(e,G.axisLabelFontSize,G.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<Ea){i=!1;break}if(i)return r}return Math.max(1,e.length)}function Oa(e,t,n,r){let i=Ta(e,wa(e)),a=Da(i,r);return i.map((e,r)=>({label:r%a===0?e:``,x:t(r),y:n,tx:t(r),ty:n+G.tickLength,labelX:t(r),labelY:n+18,textAnchor:`middle`}))}function ka(e,t,n,r,i,a,o){let s=e.series.filter(e=>e.type===`bar`).length;if(s===0)return[];let c=r*(1-G.barPadRatio),l=s>1?(c-(s-1)*G.barGroupGap)/s:c,u=Math.min(l,G.maxBarWidth),d=s>1?u*s+G.barGroupGap*(s-1):u,f=[],p=0,m=0;for(let r of e.series){if(r.type!==`bar`){m++;continue}for(let e=0;e<r.data.length;e++){let s=t(e)-d/2+p*(u+G.barGroupGap),c=n(r.data[e]),l=n(Math.max(0,i));f.push({x:s,y:Math.min(c,l),width:u,height:Math.abs(l-c),value:r.data[e],label:a[e],seriesIndex:p,colorIndex:o[m]})}p++,m++}return f}function Aa(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(i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function ja(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 Ma(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function Na(e,t,n,r){let i=[],a=0,o=0;for(let t=0;t<e.series.length;t++){let s=e.series[t],c=s.type===`bar`?`Bar ${a+1}`:`Line ${o+1}`;i.push({label:c,x:0,y:n,type:s.type,seriesIndex:s.type===`bar`?a:o,colorIndex:r[t]}),s.type===`bar`?a++:o++}let s=i.map(e=>{let t=D(e.label,G.legendFontSize,G.legendFontWeight);return G.legendSwatchW+G.legendGap+t}),c=t-(s.reduce((e,t)=>e+t,0)+(i.length-1)*G.legendItemGap)/2;for(let e=0;e<i.length;e++)i[e].x=c,c+=s[e]+G.legendItemGap;return i}var K={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,legendSize:14,legendWeight:400,dotRadius:5,lineWidth:2.5,barRadius:8},q={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function Pa(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=Dr((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 p=Math.max(...t.lines.map(e=>e.points.length),0),m=p>0&&p<=12,{style:h,defs:g}=Fa(t,a,m,n.accent,n.bg,l.nonce);u.push(h),g&&u.push(g);let{plotArea:_}=t,v=t.xAxis.ticks.map(e=>e.x),y=t.horizontal?t.yAxis.ticks.map(e=>e.y):t.gridLines.map(e=>e.y1),b=v.length>1?Math.abs(v[1]-v[0]):_.width/6,x=y.length>1?Math.abs(y[1]-y[0]):_.height/6,S=b/Math.max(1,Math.round(b/20)),C=x/Math.max(1,Math.round(x/20)),w=v[0]??_.x,T=y[0]??_.y,E=w-Math.ceil((w-_.x)/S)*S,D=T-Math.ceil((T-_.y)/C)*C;for(let e=D;e<=_.y+_.height+.5;e+=C)for(let t=E;t<=_.x+_.width+.5;t+=S)u.push(`<circle cx="${J(t)}" cy="${J(e)}" r="1.5" class="xychart-grid"/>`);let O=[];for(let e of t.bars){let n=` data-value="${e.value}"${e.label?` data-label="${Y(e.label)}"`:``}`,r=t.horizontal?La(e.x,e.y,e.width,e.height,K.barRadius):Ia(e.x,e.y,e.width,e.height,K.barRadius);if(u.push(`<path d="${r}" class="xychart-bar xychart-color-${e.colorIndex}"${n}/>`),a){let t=Ha(e.value),n=e.label?`${e.label}: ${t}`:t,r=Va(e.x+e.width/2,e.y,t);O.push(`<g class="xychart-bar-group"><rect x="${J(e.x)}" y="${J(e.y)}" width="${J(e.width)}" height="${J(e.height)}" fill="transparent"/><title>${Y(n)}</title>`+r+`</g>`)}}for(let e of t.lines){if(e.points.length===0)continue;let n=t.horizontal?Ra(e.points):za(e.points);u.push(`<path d="${n}" class="xychart-line-shadow xychart-color-${e.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${n}" class="xychart-line xychart-color-${e.colorIndex}"/>`)}let k=[];if(a||m){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=J(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=K.dotRadius*3,s=`<rect x="${J(n-o)}" y="${J(i-o)}" width="${J(o*2)}" height="${J(a-i+o*2)}" fill="transparent" class="xychart-hit"/>`,c=t.map(t=>({text:Ha(t.value),legendLabel:e.get(t.seriesIndex)||`Line ${t.seriesIndex+1}`})),l=Ba(n,i-K.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="${Y(e.label)}"`:``}`;f+=`<circle cx="${J(e.x)}" cy="${J(e.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`}f+=`<title>${Y(d)}</title>${l}</g>`,k.push(f)}else if(a){let e=t[0],r=` data-value="${e.value}"${e.label?` data-label="${Y(e.label)}"`:``}`,i=Ha(e.value),a=e.label?`${e.label}: ${i}`:i,o=Va(n,e.y-K.dotRadius,i),s=m?`<circle cx="${J(n)}" cy="${J(e.y)}" r="${K.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;k.push(`<g class="xychart-dot-group">${s}<circle cx="${J(e.x)}" cy="${J(e.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${r}/><title>${Y(a)}</title>${o}</g>`)}else for(let e of t){let t=` data-value="${e.value}"${e.label?` data-label="${Y(e.label)}"`:``}`;u.push(`<circle cx="${J(e.x)}" cy="${J(e.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`)}}}for(let e of t.xAxis.ticks)e.label!==``&&u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${K.labelSize}" font-weight="${K.labelWeight}" dy="${I}" class="xychart-label">${Y(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="${K.labelSize}" font-weight="${K.labelWeight}" dy="${I}" class="xychart-label">${Y(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="${K.axisTitleSize}" font-weight="${K.axisTitleWeight}" dy="${I}" class="xychart-axis-title">${Y(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="${K.axisTitleSize}" font-weight="${K.axisTitleWeight}" dy="${I}" class="xychart-axis-title">${Y(e.text)}</text>`)}t.title&&u.push(`<text x="${t.title.x}" y="${t.title.y}" text-anchor="middle" font-size="${K.titleSize}" font-weight="${K.titleWeight}" dy="${I}" class="xychart-title">${Y(t.title.text)}</text>`);for(let e of t.legend){if(e.type===`bar`)u.push(`<rect x="${e.x}" y="${e.y-7}" width="14" height="14" rx="3" class="xychart-bar xychart-color-${e.colorIndex}"/>`);else{let t=e.y;u.push(`<line x1="${e.x}" y1="${t}" x2="${e.x+14}" y2="${t}" stroke-width="${K.lineWidth}" stroke-linecap="round" class="xychart-legend-line xychart-color-${e.colorIndex}"/>`)}u.push(`<text x="${e.x+14+6}" y="${e.y}" text-anchor="start" font-size="${K.legendSize}" font-weight="${K.legendWeight}" dy="${I}" class="xychart-label">${Y(e.label)}</text>`)}for(let e of O)u.push(e);for(let e of k)u.push(e);return u.push(`</svg>`),u.join(`
60
- `)}function Fa(n,r,i,a,o,s){let c=a??t.CHART_ACCENT_FALLBACK,l=new Set;for(let e of n.bars)l.add(e.colorIndex);for(let e of n.lines)l.add(e.colorIndex);let u=[];for(let e of[...l].sort((e,t)=>e-t)){let n=e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,c,o);u.push(` --xychart-color-${e}: ${n};`),u.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let d=[];for(let e of[...l].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;d.push(` .xychart-bar.xychart-color-${e} { stroke: ${t}; fill: var(--xychart-bar-fill-${e}); }`),d.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),d.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let f=r?`
51
+ </marker>`}var sa={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 ca(t,n){let{id:r,x:i,y:a,width:o,height:s,label:c,type:l,participantType:u}=t,d=[],f=e.f`font-size="${n.nodeLabel}" text-anchor="middle" font-weight="${M.nodeLabel}" fill="var(--_text)"`;if(d.push(e.f`<g class="actor" data-id="${(0,e.escapeAttr)(r)}" data-label="${(0,e.escapeAttr)(c)}" data-type="${l}">`),l===`actor`){let t=s/24*.9,r=i-12*t,o=a+(s-24*t)/2,l=P.outerBox/t,u=`var(--_line)`;d.push(e.f` <g transform="translate(${r},${o}) scale(${t})">`+e.f`\n <path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" fill="none" stroke="${u}" stroke-width="${l}" />`+e.f`\n <path d="M15 10C15 11.6569 13.6569 13 12 13C10.3431 13 9 11.6569 9 10C9 8.34315 10.3431 7 12 7C13.6569 7 15 8.34315 15 10Z" fill="none" stroke="${u}" stroke-width="${l}" />`+e.f`\n <path d="M5.62842 18.3563C7.08963 17.0398 9.39997 16 12 16C14.6 16 16.9104 17.0398 18.3716 18.3563" fill="none" stroke="${u}" stroke-width="${l}" />`+`
52
+ </g>`),d.push(` `+(0,e.renderMultilineText)(c,i,a+s+14,n.nodeLabel,f))}else if(Yi(t)){let t=s/24*.9,r=P.outerBox/t,o=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${r}"`,l=e.f`fill="none" stroke="var(--_node-stroke)" stroke-width="${r}"`,p=sa[u](o,l);d.push(e.f` <g transform="translate(${i-12*t},${a+(s-24*t)/2}) scale(${t})">${p}\n </g>`),d.push(` `+(0,e.renderMultilineText)(c,i,a+s+14,n.nodeLabel,f))}else{let t=i-o/2,r=e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}"`,l=i,p=a+s/2;if(u===`queue`){let n=s/2,i=t+8,c=t+o-8;d.push(e.f` <path d="M${i},${a}H${c}A${8},${n} 0 0 1 ${c},${a+s}H${i}A${8},${n} 0 0 1 ${i},${a}Z" ${r} />`,e.f` <path d="M${c},${a}A${8},${n} 0 0 0 ${c},${a+s}" fill="none" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`)}else u===`collections`?(d.push(e.f` <rect x="${t+4}" y="${a}" width="${o-4}" height="${s-4}" rx="4" ry="4" ${r} />`,e.f` <rect x="${t}" y="${a+4}" width="${o-4}" height="${s-4}" rx="4" ry="4" ${r} />`),l=i-2,p=a+2+(s-4)/2):d.push(e.f` <rect x="${t}" y="${a}" width="${o}" height="${s}" rx="4" ry="4" ${r} />`);d.push(` `+(0,e.renderMultilineText)(c,l,p,n.nodeLabel,f))}return d.push(`</g>`),d.join(`
53
+ `)}var la=10,ua=18,da=3,fa=2,pa=3;function ma(t,n){let r=[],i=t=>(0,e.measureMultilineText)(t,n.edgeLabel,M.edgeLabel),a=(e,t,n)=>{let a=i(e);r.push({x0:t-a.width/2,x1:t+a.width/2,y0:n-a.height/2,y1:n+a.height/2})},o=(e,t,n)=>{let a=i(e);r.push({x0:t,x1:t+a.width,y0:n-a.height/2,y1:n+a.height/2})};for(let e of t.messages)!e.label||e.isSelf||a(e.label,(e.x1+e.x2)/2,e.y-la);for(let e of t.blocks){if(Ca(e))continue;let t=D(`${e.type}${e.label?` [${e.label}]`:``}`.split(`
54
+ `)[0]??``,n.edgeLabel,M.groupHeader)+16;r.push({x0:e.x,x1:e.x+t,y0:e.y,y1:e.y+ua});for(let t of e.dividers)t.label&&o(`[${t.label}]`,e.x+8,t.y+14)}return r}function ha(e,t){let n=t.filter(t=>e.x>t.x0-da&&e.x<t.x1+da&&t.y1+fa>e.topY&&t.y0-fa<e.bottomY).map(e=>[e.y0-fa,e.y1+fa]).sort((e,t)=>e[0]-t[0]),r=[],i=e.topY;for(let[e,t]of n)e-i>=pa&&r.push([i,e]),i=Math.max(i,t);return e.bottomY-i>=pa&&r.push([i,e.bottomY]),r.length>0?r:[[e.topY,e.bottomY]]}function ga(t,n){let r=ha(t,n).map(([n,r])=>e.f`<line class="lifeline" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x1="${t.x}" y1="${n}" x2="${t.x}" y2="${r}" `+`stroke="var(--_line)" stroke-width="0.75" stroke-dasharray="6 4" />`).join(`
55
+ `);if(!t.destroyed)return r;let{x:i,bottomY:a}=t,o=_a;return r+e.f`\n<path class="destroy" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`d="M${i-o} ${a-o} L${i+o} ${a+o} M${i+o} ${a-o} L${i-o} ${a+o}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${P.outerBox}" stroke-linecap="round" />`}var _a=8;function va(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 ya(t,n){let r=[],i=t.lineStyle===`dashed`?` stroke-dasharray="6 4"`:``,a=t.arrowHead===`filled`?`seq-arrow`:`seq-arrow-open`,o=t.bidirectional?e.f` marker-start="url(#${a})"`:``;return 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.isSelf?r.push(e.f` <path d="M ${t.x1},${t.y} C ${t.x1+60},${t.y-10} ${t.x1+60},${t.y+20+10} ${t.x2},${t.y+20}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${P.connector}"${i} marker-end="url(#${a})"${o} />`):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} />`),r.push(` `+(0,e.renderMultilineText)(t.label,(t.x1+t.x2)/2,t.y-la,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`)),t.seqNumber!==void 0&&r.push(` `+ba(t,n)),r.push(`</g>`),r.join(`
56
+ `)}function ba(t,n){let r=Math.max(n.edgeLabel-2,8),i=t.bidirectional?t.x1+Math.sign(t.x2-t.x1)*(8+I.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 xa=35;function Sa(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)} ${xa}%, 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+Ki(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(`
57
+ `)}function Ca(e){return e.type===`rect`&&e.color!==void 0}function wa(t,n){let r=[];if(Ca(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(`
58
+ `);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="${P.outerBox}" />`);let a=e.f`${t.type}${t.label?e.f` [${t.label}]`:``}`,o=a.split(`
59
+ `)[0],s=D(o,n.edgeLabel,M.groupHeader)+16,c=ua;r.push(e.f` <rect x="${t.x}" y="${t.y}" width="${s}" height="${c}" `+e.f`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),r.push(` `+(0,e.renderMultilineText)(a,t.x+6,t.y+c/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" font-weight="${M.groupHeader}" 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="0.75" stroke-dasharray="6 4" />`),i.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${i.label}]`,t.x+8,i.y+14,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="start" font-weight="${M.edgeLabel}" fill="var(--_text-muted)"`));return r.push(`</g>`),r.join(`
60
+ `)}function Ta(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)}"`:``,l=[e.f`${r},${i}`,e.f`${r+a-6},${i}`,e.f`${r+a},${i+6}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `);return e.f`<g class="note"${c}${s}>`+e.f`\n <polygon points="${l}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />`+e.f`\n <polygon points="${r+a-6},${i} ${r+a},${i+6} ${r+a-6},${i+6}" `+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)"`)}`+`
61
+ </g>`}var K={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4,barPadRatio:.2,barGroupGap:0,maxBarWidth:40,legendFontSize:14,legendFontWeight:400,legendHeight:28,legendSwatchW:14,legendSwatchH:14,legendGap:6,legendItemGap:16};function Ea(e,t={}){return e.horizontal?Oa(e):Da(e)}function Da(t){let n=!!t.title,r=!!t.xAxis.title,i=!!t.yAxis.title,a=t.series.length>1,o=t.yAxis.range;if(!o)throw Error(`XY chart: y-axis range was not set by the parser`);let s=(0,e.niceTickValues)(o.min,o.max),c=Ia(s),l=Math.max(...c.map(e=>D(e,K.axisLabelFontSize,K.axisLabelFontWeight)),K.yLabelWidth),u=K.padding+(n?K.titleHeight:0)+(a?K.legendHeight:0),d=K.padding+K.xLabelHeight+(r?K.axisTitlePad:0),f=K.padding+l+K.yLabelGap+(i?K.axisTitlePad:0),p=K.padding,m=K.plotWidth,h=K.plotHeight,g=f+m+p,_=u+h+d,v={x:f,y:u,width:m,height:h},y=ka(t),b=e=>f+(e+.5)*(m/y),x=m/y,S=e=>{let t=(e-o.min)/(o.max-o.min||1);return u+h-t*h},C=Na(t,b,u+h,x),w=s.map((e,t)=>({label:c[t],x:f,y:S(e),tx:f-K.tickLength,ty:S(e),labelX:f-K.yLabelGap,labelY:S(e),textAnchor:`end`})),T=s.map(e=>({x1:f,y1:S(e),x2:f+m,y2:S(e)})),E=Aa(t,y),O=t.series.map((e,t)=>t),k=Pa(t,b,S,x,o.min,E,O),ee=Fa(t,b,S,E,O),A=K.padding+(n?K.titleHeight:0)+K.legendHeight/2,j=a?Ra(t,g/2,A,O):[],M={x1:f,y1:u+h,x2:f+m,y2:u+h},te={x1:f,y1:u,x2:f,y2:u+h},ne={ticks:C,line:M,...t.xAxis.title?{title:{text:t.xAxis.title,x:f+m/2,y:_-K.padding}}:{}},N={ticks:w,line:te,...t.yAxis.title?{title:{text:t.yAxis.title,x:K.padding+4,y:u+h/2,rotate:-90}}:{}};return{width:g,height:_,title:t.title?{text:t.title,x:g/2,y:K.padding+K.titleFontSize}:void 0,xAxis:ne,yAxis:N,plotArea:v,bars:k,lines:ee,gridLines:T,legend:j}}function Oa(t){let n=!!t.title,r=!!t.xAxis.title,i=!!t.yAxis.title,a=t.series.length>1,o=t.yAxis.range;if(!o)throw Error(`XY chart: y-axis range was not set by the parser`);let s=(0,e.niceTickValues)(o.min,o.max),c=Ia(s),l=ka(t),u=Aa(t,l),d=Math.max(...u.map(e=>D(e,K.axisLabelFontSize,K.axisLabelFontWeight)),40),f=K.padding+(n?K.titleHeight:0)+(a?K.legendHeight:0),p=K.padding+K.xLabelHeight+(i?K.axisTitlePad:0),m=K.padding+d+K.yLabelGap+(r?K.axisTitlePad:0),h=Math.max(K.padding,D(c[c.length-1],K.axisLabelFontSize,K.axisLabelFontWeight)/2+4),g=K.plotWidth,_=K.plotHeight,v=m+g+h,y=f+_+p,b={x:m,y:f,width:g,height:_},x=e=>{let t=(e-o.min)/(o.max-o.min||1);return m+t*g},S=_/l,C=e=>f+(e+.5)*S,w=s.map((e,t)=>({label:c[t],x:x(e),y:f+_,tx:x(e),ty:f+_+K.tickLength,labelX:x(e),labelY:f+_+18,textAnchor:`middle`})),T=u.map((e,t)=>({label:e,x:m,y:C(t),tx:m-K.tickLength,ty:C(t),labelX:m-K.yLabelGap,labelY:C(t),textAnchor:`end`})),E=s.map(e=>({x1:x(e),y1:f,x2:x(e),y2:f+_})),O=t.series.map((e,t)=>t),k=t.series.filter(e=>e.type===`bar`).length,ee=[];if(k>0){let e=S*(1-K.barPadRatio),n=k>1?(e-(k-1)*K.barGroupGap)/k:e,r=Math.min(n,K.maxBarWidth),i=k>1?r*k+K.barGroupGap*(k-1):r,a=0,s=0;for(let e of t.series){if(e.type!==`bar`){s++;continue}for(let t=0;t<e.data.length;t++){let n=C(t)-i/2+a*(r+K.barGroupGap),c=x(Math.max(e.data[t],o.min)),l=x(Math.max(0,o.min));ee.push({x:Math.min(l,c),y:n,width:Math.abs(c-l),height:r,value:e.data[t],label:u[t],seriesIndex:a,colorIndex:O[s]})}a++,s++}}let A=[],j=0,M=0;for(let e of t.series){if(e.type!==`line`){M++;continue}let t=e.data.map((e,t)=>({x:x(e),y:C(t),value:e,label:u[t]}));A.push({points:t,seriesIndex:j,colorIndex:O[M]}),j++,M++}let te={x1:m,y1:f+_,x2:m+g,y2:f+_},ne={x1:m,y1:f,x2:m,y2:f+_},N={ticks:w,line:te,...t.yAxis.title?{title:{text:t.yAxis.title,x:m+g/2,y:y-K.padding}}:{}},P={ticks:T,line:ne,...t.xAxis.title?{title:{text:t.xAxis.title,x:K.padding+4,y:f+_/2,rotate:-90}}:{}},F=t.title?{text:t.title,x:v/2,y:K.padding+K.titleFontSize}:void 0,I=K.padding+(n?K.titleHeight:0)+K.legendHeight/2;return{width:v,height:y,horizontal:!0,title:F,xAxis:N,yAxis:P,plotArea:b,bars:ee,lines:A,gridLines:E,legend:a?Ra(t,v/2,I,O):[]}}function ka(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 Aa(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)=>La(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var ja=8;function Ma(e,t){let n=e.map(e=>D(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<ja){i=!1;break}if(i)return r}return Math.max(1,e.length)}function Na(e,t,n,r){let i=Aa(e,ka(e)),a=Ma(i,r);return i.map((e,r)=>({label:r%a===0?e:``,x:t(r),y:n,tx:t(r),ty:n+K.tickLength,labelX:t(r),labelY:n+18,textAnchor:`middle`}))}function Pa(e,t,n,r,i,a,o){let s=e.series.filter(e=>e.type===`bar`).length;if(s===0)return[];let c=r*(1-K.barPadRatio),l=s>1?(c-(s-1)*K.barGroupGap)/s:c,u=Math.min(l,K.maxBarWidth),d=s>1?u*s+K.barGroupGap*(s-1):u,f=[],p=0,m=0;for(let r of e.series){if(r.type!==`bar`){m++;continue}for(let e=0;e<r.data.length;e++){let s=t(e)-d/2+p*(u+K.barGroupGap),c=n(r.data[e]),l=n(Math.max(0,i));f.push({x:s,y:Math.min(c,l),width:u,height:Math.abs(l-c),value:r.data[e],label:a[e],seriesIndex:p,colorIndex:o[m]})}p++,m++}return f}function Fa(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(i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function Ia(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 La(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function Ra(e,t,n,r){let i=[],a=0,o=0;for(let t=0;t<e.series.length;t++){let s=e.series[t],c=s.type===`bar`?`Bar ${a+1}`:`Line ${o+1}`;i.push({label:c,x:0,y:n,type:s.type,seriesIndex:s.type===`bar`?a:o,colorIndex:r[t]}),s.type===`bar`?a++:o++}let s=i.map(e=>{let t=D(e.label,K.legendFontSize,K.legendFontWeight);return K.legendSwatchW+K.legendGap+t}),c=t-(s.reduce((e,t)=>e+t,0)+(i.length-1)*K.legendItemGap)/2;for(let e=0;e<i.length;e++)i[e].x=c,c+=s[e]+K.legendItemGap;return i}var q={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,legendSize:14,legendWeight:400,dotRadius:5,lineWidth:2.5,barRadius:8},J={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function za(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=Or((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 p=Math.max(...t.lines.map(e=>e.points.length),0),m=p>0&&p<=12,{style:h,defs:g}=Ba(t,a,m,n.accent,n.bg,l.nonce);u.push(h),g&&u.push(g);let{plotArea:_}=t,v=t.xAxis.ticks.map(e=>e.x),y=t.horizontal?t.yAxis.ticks.map(e=>e.y):t.gridLines.map(e=>e.y1),b=v.length>1?Math.abs(v[1]-v[0]):_.width/6,x=y.length>1?Math.abs(y[1]-y[0]):_.height/6,S=b/Math.max(1,Math.round(b/20)),C=x/Math.max(1,Math.round(x/20)),w=v[0]??_.x,T=y[0]??_.y,E=w-Math.ceil((w-_.x)/S)*S,D=T-Math.ceil((T-_.y)/C)*C;for(let e=D;e<=_.y+_.height+.5;e+=C)for(let t=E;t<=_.x+_.width+.5;t+=S)u.push(`<circle cx="${Y(t)}" cy="${Y(e)}" r="1.5" class="xychart-grid"/>`);let O=[];for(let e of t.bars){let n=` data-value="${e.value}"${e.label?` data-label="${X(e.label)}"`:``}`,r=t.horizontal?Ha(e.x,e.y,e.width,e.height,q.barRadius):Va(e.x,e.y,e.width,e.height,q.barRadius);if(u.push(`<path d="${r}" class="xychart-bar xychart-color-${e.colorIndex}"${n}/>`),a){let t=qa(e.value),n=e.label?`${e.label}: ${t}`:t,r=Ka(e.x+e.width/2,e.y,t);O.push(`<g class="xychart-bar-group"><rect x="${Y(e.x)}" y="${Y(e.y)}" width="${Y(e.width)}" height="${Y(e.height)}" fill="transparent"/><title>${X(n)}</title>`+r+`</g>`)}}for(let e of t.lines){if(e.points.length===0)continue;let n=t.horizontal?Ua(e.points):Wa(e.points);u.push(`<path d="${n}" class="xychart-line-shadow xychart-color-${e.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${n}" class="xychart-line xychart-color-${e.colorIndex}"/>`)}let k=[];if(a||m){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:qa(t.value),legendLabel:e.get(t.seriesIndex)||`Line ${t.seriesIndex+1}`})),l=Ga(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>`,k.push(f)}else if(a){let e=t[0],r=` data-value="${e.value}"${e.label?` data-label="${X(e.label)}"`:``}`,i=qa(e.value),a=e.label?`${e.label}: ${i}`:i,o=Ka(n,e.y-q.dotRadius,i),s=m?`<circle cx="${Y(n)}" cy="${Y(e.y)}" r="${q.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;k.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>`)}else for(let e of t){let t=` data-value="${e.value}"${e.label?` data-label="${X(e.label)}"`:``}`;u.push(`<circle cx="${Y(e.x)}" cy="${Y(e.y)}" r="${q.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`)}}}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="${F}" 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="${F}" 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="${F}" 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="${F}" 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="${F}" class="xychart-title">${X(t.title.text)}</text>`);for(let e of t.legend){if(e.type===`bar`)u.push(`<rect x="${e.x}" y="${e.y-7}" width="14" height="14" rx="3" class="xychart-bar xychart-color-${e.colorIndex}"/>`);else{let t=e.y;u.push(`<line x1="${e.x}" y1="${t}" x2="${e.x+14}" y2="${t}" stroke-width="${q.lineWidth}" stroke-linecap="round" class="xychart-legend-line xychart-color-${e.colorIndex}"/>`)}u.push(`<text x="${e.x+14+6}" y="${e.y}" text-anchor="start" font-size="${q.legendSize}" font-weight="${q.legendWeight}" dy="${F}" class="xychart-label">${X(e.label)}</text>`)}for(let e of O)u.push(e);for(let e of k)u.push(e);return u.push(`</svg>`),u.join(`
62
+ `)}function Ba(n,r,i,a,o,s){let c=a??t.CHART_ACCENT_FALLBACK,l=new Set;for(let e of n.bars)l.add(e.colorIndex);for(let e of n.lines)l.add(e.colorIndex);let u=[];for(let e of[...l].sort((e,t)=>e-t)){let n=e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,c,o);u.push(` --xychart-color-${e}: ${n};`),u.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let d=[];for(let e of[...l].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;d.push(` .xychart-bar.xychart-color-${e} { stroke: ${t}; fill: var(--xychart-bar-fill-${e}); }`),d.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),d.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let f=r?`
61
63
  .xychart-tip { opacity: 0; pointer-events: none; }
62
64
  .xychart-tip-bg { fill: var(--_text); filter: drop-shadow(0 1px 3px color-mix(in srgb, var(--fg) 20%, transparent)); }
63
- .xychart-tip-text { fill: var(--bg); font-size: ${q.fontSize}px; font-weight: ${q.fontWeight}; }
65
+ .xychart-tip-text { fill: var(--bg); font-size: ${J.fontSize}px; font-weight: ${J.fontWeight}; }
64
66
  .xychart-tip-ptr { fill: var(--_text); }
65
67
  .xychart-bar-group:hover .xychart-tip,
66
68
  .xychart-dot-group:hover .xychart-tip { opacity: 1; }`:``,p=u.length>0?`\n svg {\n${u.join(`
67
69
  `)}\n }`:``;return{style:`${(0,e.styleOpenTag)(s)}
68
70
  .xychart-grid { fill: var(--_inner-stroke); stroke: none; opacity: 0.65; }
69
71
  .xychart-bar { stroke-width: 1.5; }
70
- .xychart-line { fill: none; stroke-width: ${K.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
72
+ .xychart-line { fill: none; stroke-width: ${q.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
71
73
  .xychart-line-shadow { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.12; }
72
74
  .xychart-dot { stroke: var(--bg); stroke-width: 2; }
73
75
  .xychart-label { fill: var(--_text-muted); }
@@ -75,31 +77,31 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
75
77
  .xychart-title { fill: var(--_text); }${p}
76
78
  ${d.join(`
77
79
  `)}${f}
78
- </style>`,defs:``}}function Ia(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return a<=0?`M${J(e)},${J(t)} h${J(n)} v${J(r)} h${J(-n)} Z`:[`M${J(e)},${J(t+a)}`,`Q${J(e)},${J(t)} ${J(e+a)},${J(t)}`,`L${J(e+n-a)},${J(t)}`,`Q${J(e+n)},${J(t)} ${J(e+n)},${J(t+a)}`,`L${J(e+n)},${J(t+r-a)}`,`Q${J(e+n)},${J(t+r)} ${J(e+n-a)},${J(t+r)}`,`L${J(e+a)},${J(t+r)}`,`Q${J(e)},${J(t+r)} ${J(e)},${J(t+r-a)}`,`Z`].join(` `)}function La(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return a<=0?`M${J(e)},${J(t)} h${J(n)} v${J(r)} h${J(-n)} Z`:[`M${J(e+a)},${J(t)}`,`L${J(e+n-a)},${J(t)}`,`Q${J(e+n)},${J(t)} ${J(e+n)},${J(t+a)}`,`L${J(e+n)},${J(t+r-a)}`,`Q${J(e+n)},${J(t+r)} ${J(e+n-a)},${J(t+r)}`,`L${J(e+a)},${J(t+r)}`,`Q${J(e)},${J(t+r)} ${J(e)},${J(t+r-a)}`,`L${J(e)},${J(t+a)}`,`Q${J(e)},${J(t)} ${J(e+a)},${J(t)}`,`Z`].join(` `)}function Ra(e){return e.map((e,t)=>`${t===0?`M`:`L`}${J(e.x)},${J(e.y)}`).join(` `)}function za(e){if(e.length===0)return``;if(e.length===1)return`M${J(e[0].x)},${J(e[0].y)}`;if(e.length===2)return`M${J(e[0].x)},${J(e[0].y)} L${J(e[1].x)},${J(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${J(e[0].x)},${J(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${J(a)},${J(s)} ${J(c)},${J(l)} ${J(e[r+1].x)},${J(e[r+1].y)}`}return o}function Ba(e,t,n,r){let i=D(n,q.fontSize,600),a=Math.max(...r.map(e=>{let t=D(e.legendLabel,q.fontSize,q.fontWeight),n=D(e.text,q.fontSize,q.fontWeight);return t+10+n})),o=Math.max(i,a)+q.padX*2,s=26+r.length*20+6,c=Math.max(q.minY,t-q.offsetY-s-q.pointerSize),l=e-o/2,u=e,d=c+s,f=q.pointerSize,p=`<polygon points="${J(u-f)},${J(d)} ${J(u+f)},${J(d)} ${J(u)},${J(d+f)}" class="xychart-tip xychart-tip-ptr"/>`,m=`<rect x="${J(l)}" y="${J(c)}" width="${J(o)}" height="${s}" rx="${q.rx}" class="xychart-tip xychart-tip-bg"/>`;m+=p;let h=c+6+10;m+=`<text x="${J(e)}" y="${J(h)}" text-anchor="middle" font-weight="600" font-size="${q.fontSize}" dy="${I}" class="xychart-tip xychart-tip-text">${Y(n)}</text>`;let g=l+q.padX,_=l+o-q.padX;for(let e of r)h+=20,m+=`<text x="${J(g)}" y="${J(h)}" text-anchor="start" font-size="${q.fontSize}" font-weight="${q.fontWeight}" dy="${I}" class="xychart-tip xychart-tip-text">${Y(e.legendLabel)}</text>`,m+=`<text x="${J(_)}" y="${J(h)}" text-anchor="end" font-size="${q.fontSize}" font-weight="${q.fontWeight}" dy="${I}" class="xychart-tip xychart-tip-text">${Y(e.text)}</text>`;return m}function Va(e,t,n){let r=D(n,q.fontSize,q.fontWeight)+q.padX*2,i=q.height,a=Math.max(q.minY,t-q.offsetY-i-q.pointerSize),o=e-r/2,s=e,c=a+i/2,l=e,u=a+i,d=q.pointerSize,f=`<polygon points="${J(l-d)},${J(u)} ${J(l+d)},${J(u)} ${J(l)},${J(u+d)}" class="xychart-tip xychart-tip-ptr"/>`;return`<rect x="${J(o)}" y="${J(a)}" width="${J(r)}" height="${i}" rx="${q.rx}" class="xychart-tip xychart-tip-bg"/>`+f+`<text x="${J(s)}" y="${J(c)}" text-anchor="middle" dy="${I}" class="xychart-tip xychart-tip-text">${Y(n)}</text>`}function Ha(e){return Number.isInteger(e)?e.toLocaleString(`en-US`):e.toFixed(+(Math.abs(e)<10))}function J(e){return String(Math.round(e*10)/10)}function Y(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var X={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},Ua=Math.PI*2;function Z(e){return String(Math.round(e*100)/100)}function Wa(e,t,n,r){return{x:e+n*Math.sin(r),y:t-n*Math.cos(r)}}function Ga(e,t,n,r,i,a=0){if(i-r>=Ua-1e-9){let r=(n,r)=>`M${Z(e)},${Z(t-n)}A${Z(n)},${Z(n)},0,1,${r},${Z(e)},${Z(t+n)}A${Z(n)},${Z(n)},0,1,${r},${Z(e)},${Z(t-n)}`;return r(n,1)+(a>0?r(a,0):``)+`Z`}let o=Wa(e,t,n,r),s=Wa(e,t,n,i),c=+(i-r>Math.PI),l=`M${Z(o.x)},${Z(o.y)}A${Z(n)},${Z(n)},0,${c},1,${Z(s.x)},${Z(s.y)}`;if(a<=0)return`${l}L${Z(e)},${Z(t)}Z`;let u=Wa(e,t,a,i),d=Wa(e,t,a,r);return`${l}L${Z(u.x)},${Z(u.y)}A${Z(a)},${Z(a)},0,${c},0,${Z(d.x)},${Z(d.y)}Z`}function Ka(e,t,n){return n?`${e} [${String(t)}]`:e}function qa(e,t={}){let n=X.height,r=n,i=Math.min(r,n)/2-X.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%X.paletteSize})).filter(({slice:e})=>e.value/s*100>=X.minPercent),l=c.reduce((e,t)=>e+t.slice.value,0),u=X.legendRectSize+X.legendSpacing,d=e.slices.length,f=d>0?e.legendPosition??`right`:`right`,p=e.slices.map(t=>Ka(t.label,t.value,e.showData)),m=Math.max(0,...p.map(e=>D(e,X.legendFontSize,X.fontWeight))),h=X.legendRectSize+X.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*X.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+X.margin+S:r+X.margin,w=f===`top`||f===`bottom`?n+g:n,T=e.title??``,E=T.length>0?D(T,X.titleFontSize,X.fontWeight):0,O=a-E/2,k=a+E/2,A=x.x,j=x.x+S,M=x.y,N=x.y+g-u+X.legendRectSize,ee=Math.min(0,O,d>0?A:0),te=Math.max(C,k,d>0?j:0),P=d>0?Math.min(0,M):0,F=d>0?Math.max(w,N):n,I=-ee,L=-P,R=a+_+I,z=o+v+L,ne=[],re=0,ie=e.donutHole??0,ae=ie>0&&ie<=.9?ie*i:0,oe=i*(e.textPosition??X.textPosition);for(let{slice:t,colorIndex:n}of c){let r=re,a=re+t.value/l*Ua;re=a;let o=Wa(R,z,oe,(r+a)/2),c=e.highlightSlice!==void 0&&e.highlightSlice!==`hover`&&e.highlightSlice!==``&&e.highlightSlice===t.label,u=c?X.highlightScale:1;ne.push({label:t.label,value:t.value,colorIndex:n,startAngle:r,endAngle:a,path:Ga(R,z,i*u,r,a,ae*u),percentText:`${(t.value/s*100).toFixed(0)}%`,labelX:o.x,labelY:o.y,...c?{highlighted:c}:{}})}let se=p.map((e,t)=>{let n=x.x+I,r=x.y+t*u+L;return{text:e,colorIndex:t%X.paletteSize,x:n,y:r,size:X.legendRectSize,textX:n+X.legendRectSize+X.legendSpacing,textY:r+X.legendRectSize-X.legendSpacing}});return{width:Math.ceil(te-ee),height:Math.ceil(F-P),cx:R,cy:z,radius:i,outerRadius:i+X.outerStrokeWidth/2,title:T.length>0?{text:T,x:a+I,y:o+L-(n-50)/2}:void 0,slices:ne,legend:se,accTitle:e.accTitle,accDescr:e.accDescr,sliceColors:e.sliceColors}}function Ja(e){return String(Math.round(e*100)/100)}function Ya(e,n,r){return e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,n??t.CHART_ACCENT_FALLBACK,r)}function Xa(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]??Ya(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)?`
80
+ </style>`,defs:``}}function Va(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return a<=0?`M${Y(e)},${Y(t)} h${Y(n)} v${Y(r)} h${Y(-n)} Z`:[`M${Y(e)},${Y(t+a)}`,`Q${Y(e)},${Y(t)} ${Y(e+a)},${Y(t)}`,`L${Y(e+n-a)},${Y(t)}`,`Q${Y(e+n)},${Y(t)} ${Y(e+n)},${Y(t+a)}`,`L${Y(e+n)},${Y(t+r-a)}`,`Q${Y(e+n)},${Y(t+r)} ${Y(e+n-a)},${Y(t+r)}`,`L${Y(e+a)},${Y(t+r)}`,`Q${Y(e)},${Y(t+r)} ${Y(e)},${Y(t+r-a)}`,`Z`].join(` `)}function Ha(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return a<=0?`M${Y(e)},${Y(t)} h${Y(n)} v${Y(r)} h${Y(-n)} Z`:[`M${Y(e+a)},${Y(t)}`,`L${Y(e+n-a)},${Y(t)}`,`Q${Y(e+n)},${Y(t)} ${Y(e+n)},${Y(t+a)}`,`L${Y(e+n)},${Y(t+r-a)}`,`Q${Y(e+n)},${Y(t+r)} ${Y(e+n-a)},${Y(t+r)}`,`L${Y(e+a)},${Y(t+r)}`,`Q${Y(e)},${Y(t+r)} ${Y(e)},${Y(t+r-a)}`,`L${Y(e)},${Y(t+a)}`,`Q${Y(e)},${Y(t)} ${Y(e+a)},${Y(t)}`,`Z`].join(` `)}function Ua(e){return e.map((e,t)=>`${t===0?`M`:`L`}${Y(e.x)},${Y(e.y)}`).join(` `)}function Wa(e){if(e.length===0)return``;if(e.length===1)return`M${Y(e[0].x)},${Y(e[0].y)}`;if(e.length===2)return`M${Y(e[0].x)},${Y(e[0].y)} L${Y(e[1].x)},${Y(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${Y(e[0].x)},${Y(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${Y(a)},${Y(s)} ${Y(c)},${Y(l)} ${Y(e[r+1].x)},${Y(e[r+1].y)}`}return o}function Ga(e,t,n,r){let i=D(n,J.fontSize,600),a=Math.max(...r.map(e=>{let t=D(e.legendLabel,J.fontSize,J.fontWeight),n=D(e.text,J.fontSize,J.fontWeight);return t+10+n})),o=Math.max(i,a)+J.padX*2,s=26+r.length*20+6,c=Math.max(J.minY,t-J.offsetY-s-J.pointerSize),l=e-o/2,u=e,d=c+s,f=J.pointerSize,p=`<polygon points="${Y(u-f)},${Y(d)} ${Y(u+f)},${Y(d)} ${Y(u)},${Y(d+f)}" class="xychart-tip xychart-tip-ptr"/>`,m=`<rect x="${Y(l)}" y="${Y(c)}" width="${Y(o)}" height="${s}" rx="${J.rx}" class="xychart-tip xychart-tip-bg"/>`;m+=p;let h=c+6+10;m+=`<text x="${Y(e)}" y="${Y(h)}" text-anchor="middle" font-weight="600" font-size="${J.fontSize}" dy="${F}" class="xychart-tip xychart-tip-text">${X(n)}</text>`;let g=l+J.padX,_=l+o-J.padX;for(let e of r)h+=20,m+=`<text x="${Y(g)}" y="${Y(h)}" text-anchor="start" font-size="${J.fontSize}" font-weight="${J.fontWeight}" dy="${F}" class="xychart-tip xychart-tip-text">${X(e.legendLabel)}</text>`,m+=`<text x="${Y(_)}" y="${Y(h)}" text-anchor="end" font-size="${J.fontSize}" font-weight="${J.fontWeight}" dy="${F}" class="xychart-tip xychart-tip-text">${X(e.text)}</text>`;return m}function Ka(e,t,n){let r=D(n,J.fontSize,J.fontWeight)+J.padX*2,i=J.height,a=Math.max(J.minY,t-J.offsetY-i-J.pointerSize),o=e-r/2,s=e,c=a+i/2,l=e,u=a+i,d=J.pointerSize,f=`<polygon points="${Y(l-d)},${Y(u)} ${Y(l+d)},${Y(u)} ${Y(l)},${Y(u+d)}" class="xychart-tip xychart-tip-ptr"/>`;return`<rect x="${Y(o)}" y="${Y(a)}" width="${Y(r)}" height="${i}" rx="${J.rx}" class="xychart-tip xychart-tip-bg"/>`+f+`<text x="${Y(s)}" y="${Y(c)}" text-anchor="middle" dy="${F}" class="xychart-tip xychart-tip-text">${X(n)}</text>`}function qa(e){return Number.isInteger(e)?e.toLocaleString(`en-US`):e.toFixed(+(Math.abs(e)<10))}function Y(e){return String(Math.round(e*10)/10)}function X(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var Z={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},Ja=Math.PI*2;function Q(e){return String(Math.round(e*100)/100)}function Ya(e,t,n,r){return{x:e+n*Math.sin(r),y:t-n*Math.cos(r)}}function Xa(e,t,n,r,i,a=0){if(i-r>=Ja-1e-9){let r=(n,r)=>`M${Q(e)},${Q(t-n)}A${Q(n)},${Q(n)},0,1,${r},${Q(e)},${Q(t+n)}A${Q(n)},${Q(n)},0,1,${r},${Q(e)},${Q(t-n)}`;return r(n,1)+(a>0?r(a,0):``)+`Z`}let o=Ya(e,t,n,r),s=Ya(e,t,n,i),c=+(i-r>Math.PI),l=`M${Q(o.x)},${Q(o.y)}A${Q(n)},${Q(n)},0,${c},1,${Q(s.x)},${Q(s.y)}`;if(a<=0)return`${l}L${Q(e)},${Q(t)}Z`;let u=Ya(e,t,a,i),d=Ya(e,t,a,r);return`${l}L${Q(u.x)},${Q(u.y)}A${Q(a)},${Q(a)},0,${c},0,${Q(d.x)},${Q(d.y)}Z`}function Za(e,t,n){return n?`${e} [${String(t)}]`:e}function Qa(e,t={}){let n=Z.height,r=n,i=Math.min(r,n)/2-Z.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%Z.paletteSize})).filter(({slice:e})=>e.value/s*100>=Z.minPercent),l=c.reduce((e,t)=>e+t.slice.value,0),u=Z.legendRectSize+Z.legendSpacing,d=e.slices.length,f=d>0?e.legendPosition??`right`:`right`,p=e.slices.map(t=>Za(t.label,t.value,e.showData)),m=Math.max(0,...p.map(e=>D(e,Z.legendFontSize,Z.fontWeight))),h=Z.legendRectSize+Z.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*Z.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+Z.margin+S:r+Z.margin,w=f===`top`||f===`bottom`?n+g:n,T=e.title??``,E=T.length>0?D(T,Z.titleFontSize,Z.fontWeight):0,O=a-E/2,k=a+E/2,ee=x.x,A=x.x+S,j=x.y,M=x.y+g-u+Z.legendRectSize,te=Math.min(0,O,d>0?ee:0),ne=Math.max(C,k,d>0?A:0),N=d>0?Math.min(0,j):0,P=d>0?Math.max(w,M):n,F=-te,I=-N,L=a+_+F,R=o+v+I,re=[],ie=0,ae=e.donutHole??0,z=ae>0&&ae<=.9?ae*i:0,B=i*(e.textPosition??Z.textPosition);for(let{slice:t,colorIndex:n}of c){let r=ie,a=ie+t.value/l*Ja;ie=a;let o=Ya(L,R,B,(r+a)/2),c=e.highlightSlice!==void 0&&e.highlightSlice!==`hover`&&e.highlightSlice!==``&&e.highlightSlice===t.label,u=c?Z.highlightScale:1;re.push({label:t.label,value:t.value,colorIndex:n,startAngle:r,endAngle:a,path:Xa(L,R,i*u,r,a,z*u),percentText:`${(t.value/s*100).toFixed(0)}%`,labelX:o.x,labelY:o.y,...c?{highlighted:c}:{}})}let oe=p.map((e,t)=>{let n=x.x+F,r=x.y+t*u+I;return{text:e,colorIndex:t%Z.paletteSize,x:n,y:r,size:Z.legendRectSize,textX:n+Z.legendRectSize+Z.legendSpacing,textY:r+Z.legendRectSize-Z.legendSpacing}});return{width:Math.ceil(ne-te),height:Math.ceil(P-N),cx:L,cy:R,radius:i,outerRadius:i+Z.outerStrokeWidth/2,title:T.length>0?{text:T,x:a+F,y:o+I-(n-50)/2}:void 0,slices:re,legend:oe,accTitle:e.accTitle,accDescr:e.accDescr,sliceColors:e.sliceColors}}function $a(e){return String(Math.round(e*100)/100)}function eo(e,n,r){return e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,n??t.CHART_ACCENT_FALLBACK,r)}function to(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]??eo(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)?`
79
81
  .pie-slice.pie-highlight { opacity: 1; }`:``,l=o.length>0?`\n svg {\n${o.join(`
80
82
  `)}\n }`:``;return`${(0,e.styleOpenTag)(r)}
81
- .pie-outer { fill: none; stroke: var(--fg); stroke-width: ${X.outerStrokeWidth}px; }
83
+ .pie-outer { fill: none; stroke: var(--fg); stroke-width: ${Z.outerStrokeWidth}px; }
82
84
  .pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }${c}
83
- .pie-slice-label { fill: var(--_text); font-size: ${X.sectionFontSize}px; font-weight: ${X.fontWeight}; }
84
- .pie-title { fill: var(--_text); font-size: ${X.titleFontSize}px; font-weight: ${X.fontWeight}; }
85
- .pie-legend-text { fill: var(--_text); font-size: ${X.legendFontSize}px; font-weight: ${X.fontWeight}; }${l}
85
+ .pie-slice-label { fill: var(--_text); font-size: ${Z.sectionFontSize}px; font-weight: ${Z.fontWeight}; }
86
+ .pie-title { fill: var(--_text); font-size: ${Z.titleFontSize}px; font-weight: ${Z.fontWeight}; }
87
+ .pie-legend-text { fill: var(--_text); font-size: ${Z.legendFontSize}px; font-weight: ${Z.fontWeight}; }${l}
86
88
  ${s.join(`
87
89
  `)}
88
- </style>`}function Za(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(Dr((0,e.svgOpenTag)(t.width,t.height,n,i,o??t.accTitle,s,void 0,c.styleAttribute,t.accDescr),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(Xa(t,n,c.nonce)),l.push(`<circle cx="${Ja(t.cx)}" cy="${Ja(t.cy)}" r="${Ja(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="${Ja(n.labelX)}" y="${Ja(n.labelY)}" text-anchor="middle" class="pie-slice-label">${(0,e.escapeXml)(n.percentText)}</text>`);t.title&&l.push(`<text x="${Ja(t.title.x)}" y="${Ja(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="${Ja(n.x)}" y="${Ja(n.y)}" width="${n.size}" height="${n.size}" class="pie-legend-swatch pie-color-${n.colorIndex}"/><text x="${Ja(n.textX)}" y="${Ja(n.textY)}" class="pie-legend-text">${(0,e.escapeXml)(n.text)}</text></g>`);return l.push(`</svg>`),l.join(`
89
- `)}var Qa={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},$a={chartWidth:500,chartHeight:500};function eo(e){return{anchor:`middle`,baseline:`hanging`,rotation:0,...e}}function to(e){let t={...Qa,...$a,...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:eo({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(eo({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,j=(e,n)=>T.push(eo({text:e,x:k,y:n,fontSize:t.yAxisLabelFontSize,anchor:A?`middle`:`start`,rotation:-90}));i&&e.yAxisBottom&&j(e.yAxisBottom,h+_-(A?y/2:0)),i&&e.yAxisTop&&j(e.yAxisTop,h+y-y/2);let M=[...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:eo({text:e.label,x:n,y:r+t.pointTextPadding,fontSize:t.pointLabelFontSize})}});return{width:t.chartWidth,height:t.chartHeight,themeColors:e.themeColors,title:a?eo({text:e.title,x:t.chartWidth/2,y:t.titlePadding,fontSize:t.titleFontSize}):void 0,quadrants:b,lines:w,axisLabels:T,points:M}}function Q(e){return String(Math.round(e*100)/100)}var no=[14,10,6,3];function ro(n,r){let i=`var(--accent, ${t.CHART_ACCENT_FALLBACK})`,a=`color-mix(in srgb, ${i} 35%, var(--bg))`,o=no.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)}
90
+ </style>`}function no(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(Or((0,e.svgOpenTag)(t.width,t.height,n,i,o??t.accTitle,s,void 0,c.styleAttribute,t.accDescr),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce,c.bodyFont)),l.push(to(t,n,c.nonce)),l.push(`<circle cx="${$a(t.cx)}" cy="${$a(t.cy)}" r="${$a(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="${$a(n.labelX)}" y="${$a(n.labelY)}" text-anchor="middle" class="pie-slice-label">${(0,e.escapeXml)(n.percentText)}</text>`);t.title&&l.push(`<text x="${$a(t.title.x)}" y="${$a(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="${$a(n.x)}" y="${$a(n.y)}" width="${n.size}" height="${n.size}" class="pie-legend-swatch pie-color-${n.colorIndex}"/><text x="${$a(n.textX)}" y="${$a(n.textY)}" class="pie-legend-text">${(0,e.escapeXml)(n.text)}</text></g>`);return l.push(`</svg>`),l.join(`
91
+ `)}var ro={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},io={chartWidth:500,chartHeight:500};function ao(e){return{anchor:`middle`,baseline:`hanging`,rotation:0,...e}}function oo(e){let t={...ro,...io,...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:ao({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(ao({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,ee=!!e.yAxisTop,A=(e,n)=>T.push(ao({text:e,x:k,y:n,fontSize:t.yAxisLabelFontSize,anchor:ee?`middle`:`start`,rotation:-90}));i&&e.yAxisBottom&&A(e.yAxisBottom,h+_-(ee?y/2:0)),i&&e.yAxisTop&&A(e.yAxisTop,h+y-y/2);let j=[...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:ao({text:e.label,x:n,y:r+t.pointTextPadding,fontSize:t.pointLabelFontSize})}});return{width:t.chartWidth,height:t.chartHeight,themeColors:e.themeColors,title:a?ao({text:e.title,x:t.chartWidth/2,y:t.titlePadding,fontSize:t.titleFontSize}):void 0,quadrants:b,lines:w,axisLabels:T,points:j}}function so(e){return String(Math.round(e*100)/100)}var co=[14,10,6,3];function lo(n,r){let i=`var(--accent, ${t.CHART_ACCENT_FALLBACK})`,a=`color-mix(in srgb, ${i} 35%, var(--bg))`,o=co.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)}
90
92
  ${o.join(`
91
93
  `)}
92
94
  .quadrant-line { stroke: ${a}; }
93
95
  .quadrant-text { fill: var(--_text); }
94
96
  .quadrant-point { fill: var(--fg); stroke: var(--fg); stroke-width: 0px; }${[...l,...s].map(e=>`
95
97
  `+e).join(``)}
96
- </style>`}function io(t,n){return t.text?`<text x="0" y="0" class="quadrant-text ${n}" font-size="${t.fontSize}" dominant-baseline="${t.baseline}" text-anchor="${t.anchor}" transform="translate(${Q(t.x)}, ${Q(t.y)}) rotate(${t.rotation})">${(0,e.escapeXml)(t.text)}</text>`:``}function ao(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(Dr((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(ro(t,c.nonce)),l.push(`<g class="quadrants">`);for(let e of t.quadrants)l.push(`<g class="quadrant"><rect x="${Q(e.x)}" y="${Q(e.y)}" width="${Q(e.width)}" height="${Q(e.height)}" class="quadrant-cell-${e.index}"/>${io(e.text,`quadrant-label`)}</g>`);l.push(`</g>`),l.push(`<g class="border">`);for(let e of t.lines)l.push(`<line x1="${Q(e.x1)}" y1="${Q(e.y1)}" x2="${Q(e.x2)}" y2="${Q(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="${Q(e.x)}" cy="${Q(e.y)}" r="${e.radius}" class="quadrant-point${n}"/>${io(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">${io(e,`quadrant-axis-label`)}</g>`);return l.push(`</g>`),l.push(`<g class="title">`),t.title&&l.push(io(t.title,`quadrant-title`)),l.push(`</g>`),l.push(`</svg>`),l.join(`
97
- `)}var oo=2048,so=[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],co=[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 lo(e,t){let n=e.codePointAt(0);if(!(n<32||n>126))return(t?co:so)[n-32]/oo}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},uo=$.width-2*$.shapePadding;function fo(e,t,n){let r=[];for(let i of e.split(`
98
- `)){let e=``;for(let a of i.split(/\s+/).filter(Boolean)){let i=e?`${e} ${a}`:a;e&&vo(i,n,400)>t?(r.push(e),e=a):e=i}r.push(e)}return r}function po(e,t){let n=Math.min(Math.max(e*$.personHeadRatio,$.personHeadMin),$.personHeadMax),r=n*(2-$.personHeadOverlap),i=t===void 0?1/0:t-r;return{rx:Math.min(e*$.personRx,i*$.personRxMaxOfHeight),headRadius:n,pillTop:r}}function mo(e,t){return e*$.nameLine+$.typeLine+ho(t)}function ho(e){return e===0?0:$.descrLine+(e-1)*$.descrExtraLine}function go(e){let t=e/2;return{rx:t,ry:t/(2.5+e/50)}}function _o(e){let t=e/2;return{rx:t/(2.5+e/50),ry:t}}function vo(e,t,n){let r=0;for(let i of e){let e=lo(i,n>=600);r+=e===void 0?D(i,t,n)*$.textScale:e*t}return r}function yo(e,t,n,r){let i=mo(t,n),a=i+2*$.shapePadding,o=Math.max($.width,r+2*$.shapePadding);if(e.kind===`person`)return{width:o,height:po(o).pillTop+a,textHeight:i};if(e.shape===`db`){let{ry:e}=go(o);return{width:o,height:a+2*e-$.dbTrim,textHeight:i}}if(e.shape===`queue`){let e=i+$.queueExtra,{rx:t}=_o(e);return{width:o+3*t,height:e,textHeight:i}}return{width:o,height:a,textHeight:i}}function bo(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 xo=$.messageSize+5;function So(e){return e.labelLines??(0,t.c4RelLabelLines)(e)}function Co(e){let t=e.labelPosition;return t?So(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*xo,w:vo(n,$.messageSize,400),h:$.messageSize})):[]}function wo(){return{next:{cnt:0}}}function To(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 Eo(e,t,n,r){let i=e[t];e[t]=i===void 0?n:r(n,i)}function Do(e,t){e.next.cnt+=1;let n=$.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>$.shapeInRow)&&(r=e.next.startx+n+$.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,Eo(e,`startx`,r,Math.min),Eo(e,`starty`,a,Math.min),Eo(e,`stopx`,i,Math.max),Eo(e,`stopy`,o,Math.max),Eo(e.next,`startx`,r,Math.min),Eo(e.next,`starty`,a,Math.min),Eo(e.next,`stopx`,i,Math.max),Eo(e.next,`stopy`,o,Math.max)}function Oo(e){let n=fo(e.label,uo,$.nameSize),r=e.description?fo(e.description,uo,$.descrSize):[],i=Math.max(...n.map(e=>vo(e,$.nameSize,700)),vo((0,t.c4TypeLine)(e),$.typeSize,400),...r.map(e=>vo(e,$.descrSize,400)));return{el:e,nameLines:n,descriptionLines:r,x:0,y:0,...yo(e,n.length,r.length,i)}}function ko(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 Ao(e){let n=new Map,r=[],i=$.diagramMarginX,a=$.diagramMarginY,o=(e,t)=>{for(let r of t){let t=Oo(r);n.set(r.alias,t),Do(e,t)}e.stopx+=$.shapeMargin,e.stopy+=$.shapeMargin},s=(e,n,c)=>{let l=wo();l.widthLimit=e.widthLimit/Math.min($.boundaryInRow,n.length);for(let[u,d]of n.entries()){let n=d.boundary,f=0,p=f+8;f=p+$.boundaryLabelHeight;let m;n&&(0,t.c4BoundaryTypeLine)(n)&&(m=f+5,f=m+$.boundaryTypeHeight);let h;if(n?.description&&(h=f+20,f=h+$.boundaryDescrHeight),n||(f=$.rootHeadingHeight),u===0||u%$.boundaryInRow===0){let t=e.startx+$.diagramMarginX,n=e.stopy+$.diagramMarginY+f;To(l,t,t,n,n)}else{let e=l.stopx===l.startx?l.startx:l.stopx+$.diagramMarginX;To(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=$.width,l.stopx=l.startx+e),t===0&&(t=f+$.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+$.shapeMargin,e.stopy),e.stopx=Math.max(l.stopx+$.shapeMargin,e.stopx),i=Math.max(i,e.stopx),a=Math.max(a,e.stopy)}},c=wo();return To(c,$.diagramMarginX,$.diagramMarginX,$.diagramMarginY,$.diagramMarginY),c.widthLimit=$.screenWidth,s(c,[e],-1),{elements:n,boundaries:r,maxX:i,maxY:a}}function jo(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 Mo(e,t){let n=po(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 Po({x:r,y:i},t,f.map(e=>({x:r+e.x,y:i+e.y})))}function No(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 Po(e,t,n){let r,i=1/0;return n.forEach((a,o)=>{let s=No(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 Fo=1e-6;function Io(e,t){let n=jo(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=go(e.width),s=n.x-r,c=Math.abs(s)<e.width/2-Fo||Math.abs(Math.abs(s)-e.width/2)<=Fo&&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 Lo(e,t){let n=jo(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=_o(e.height),s=n.y-i,c=Math.abs(s)<e.height/2-Fo||Math.abs(Math.abs(s)-e.height/2)<=Fo&&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 Ro(e,t){let n=e.el;return n?.kind===`person`?Mo(e,t):n?.shape===`db`?Io(e,t):n?.shape===`queue`?Lo(e,t):jo(e,t)}var zo=e=>({x:e.x+e.width/2,y:e.y+e.height/2});function Bo(e,n,r,i){let a=r.get(e.from),o=r.get(e.to),s=Ro(a,zo(o)),c=Ro(o,zo(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?vo(r??``,$.messageSize,400):0;if(f.labelPosition=d({x:n.x+i/2,y:n.y}),e.technology){let t=vo(`[${e.technology}]`,$.messageSize,400);f.technologyX=n.x+Math.max(i,t)/2}}return f}var Vo=2,Ho=6,Uo=2,Wo=[0,14,-14,28,-28],Go=[.75,.55,.4],Ko=1e3,qo=100,Jo=10,Yo=2,Xo=5,Zo=4,Qo=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}),$o=(e,t)=>e.x0<t.x1+Vo&&e.x1>t.x0-Vo&&e.y0<t.y1+Vo&&e.y1>t.y0-Vo;function es(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/Zo));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 ts(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:qo}),r=(t,r,i,a)=>{let o=vo(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,Xo)},i=(0,t.c4BoundaryTypeLine)({...e,elementAliases:[],children:[]});return[n(e.x,e.x+e.width,e.y,e.y,Yo),n(e.x,e.x+e.width,e.y+e.height,e.y+e.height,Yo),n(e.x,e.x,e.y,e.y+e.height,Yo),n(e.x+e.width,e.x+e.width,e.y,e.y+e.height,Yo),r(e.label,e.labelY,$.boundarySize+2,700),...i?[r(i,e.typeY,$.boundarySize,400)]:[],...e.description?[r(e.description,e.descrY,$.boundarySize-2,400)]:[]]})}function ns(e,t){return Co({...e,labelLines:t.lines,labelPosition:t.position,...t.technologyX===void 0?{}:{technologyX:t.technologyX}}).map(Qo)}function rs(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?vo(d[0],$.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(`
99
- `)]);Go.forEach((e,r)=>{let i=fo(d[0],p*e,$.messageSize),a=[...i,...t].join(`
100
- `);if(n.has(a))return;n.add(a);let o=Math.max(...i.map(e=>vo(e,$.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(...Wo)+Vo,y=h.flatMap(t=>ns(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(Uo,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=ns(e,t);for(let e of Wo)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($o(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+=Jo)}}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(...Co(e).map(e=>({...Qo(e),weight:qo})))}function is(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*$.diagramMarginY+$.titleExtra;t.title=e.title,t.width=Math.ceil(2*$.diagramMarginX+vo(e.title,16,400)),t.height=n,t.titlePosition={x:$.diagramMarginX,y:n/2}}return t}let n=Ao(ko(e)),r=e.title?$.titleExtra:0,i=$.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)=>Bo(e,t,s,i)),l=[...a.map(e=>({x0:e.x-Ho,x1:e.x+e.width+Ho,y0:e.y-Ho,y1:e.y+e.height+Ho,weight:Ko})),...ts(o)],u=c.map(es),d=[];c.forEach((e,t)=>rs(e,l,u.filter((e,n)=>n!==t),d));let f=n.maxX+$.diagramMarginX,p=n.maxY+$.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-$.diagramMarginX)/2-4*$.diagramMarginX,y:$.diagramMarginY+$.diagramMarginY+i}),m}function as(t,n,r=`Inter`,i=!1,a=j,o,s,c,l={}){let u=[];u.push(Dr((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="${I}" `+e.f`font-size="16" fill="var(--_text)">${(0,e.escapeXml)(t.title)}</text>`);for(let e of t.boundaries)u.push(ss(e));for(let e of t.elements)u.push(cs(e));for(let e of t.relationships)u.push(gs(e));for(let e of t.relationships)u.push(_s(e));return u.push(`</svg>`),u.filter(Boolean).join(`
101
- `)}function os(t,n,r,i,a){return e.f` <text x="${n}" y="${r}" text-anchor="middle" dy="${I}" font-size="${i}" `+e.f`${a}>${(0,e.escapeXml)(t)}</text>`}function ss(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(os(n.label,i,n.y+(n.labelY??8),$.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(os(a,i,n.y+n.typeY,$.boundarySize,`fill="var(--_text)"`)),n.description&&n.descrY!==void 0&&r.push(os(n.description,i,n.y+n.descrY,$.boundarySize-2,`fill="var(--_text)"`)),r.push(`</g>`),r.join(`
102
- `)}function cs(n){let r=bo(n),{x:i,y:a,width:o,height:s}=n,c=i+o/2,l=mo(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(...us(n,r)),d=a+po(o).pillTop+$.shapePadding;else if(n.shape===`db`){u.push(...ds(n,r));let{ry:e}=go(o);d=a+(2*e+s)/2-l/2}else if(n.shape===`queue`){u.push(...fs(n,r));let{rx:e}=_o(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="${$.cornerRadius}" ry="${$.cornerRadius}" `+e.f`fill="${r.fill}" stroke="${r.stroke}" stroke-width="${$.strokeWidth}" />`),d=a+$.shapePadding;let p=d;for(let t of n.nameLines)u.push(os(t,f,p+$.nameLine/2,$.nameSize,e.f`font-weight="700" fill="${r.text}"`)),p+=$.nameLine;return u.push(os((0,t.c4TypeLine)(n),f,p+$.typeLine/2,$.typeSize,e.f`fill="${r.text}"`)),p+=$.typeLine,n.descriptionLines.forEach((t,n)=>{u.push(os(t,f,p+$.descrLine/2+n*$.descrExtraLine,$.descrSize,e.f`fill="${r.text}"`))}),p+=ho(n.descriptionLines.length),u.push(`</g>`),u.join(`
103
- `)}function ls(t){let{x:n,y:r,width:i,height:a}=t,{rx:o,headRadius:s,pillTop:c}=po(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 us(t,n){return[e.f` <path class="c4-person-shape" d="${ls(t)}" fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.strokeWidth}" />`]}function ds(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=go(a),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.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 fs(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=_o(o),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.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 ps(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 ms=3,hs=1;function gs(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=ps(r,s),u=ps(n,c);return[o,...t.bidirectional?[l,u]:[t.reversed?u:l]].filter(Boolean).join(`
104
- `)}function _s(t){let n=So(t),r=Co(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))-ms,o=Math.max(...r.map(e=>e.cx+e.w/2))+ms,s=r[0].cy-r[0].h/2-hs,c=r[r.length-1],l=c.cy+c.h/2+hs;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(os(e,s.cx,s.cy,$.messageSize,o?`font-style="italic" fill="var(--_text)"`:`fill="var(--_text)"`))}),i.push(`</g>`),i.join(`
105
- `)}var vs={type:`xychart`,parse:t.parseXYChart,layoutForSvg:xa,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return Pa(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},ys={type:`sequence`,parse:t.parseSequenceDiagram,layoutForSvg:Zi,renderSvg(e,t){return Qi(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function bs(e){return(e.interactivity??`static`)!==`none`}function xs(e){return(e.interactivity??`static`)===`full`}var Ss={type:`class`,parse:t.parseClassDiagram,layoutForSvg:ti,renderSvg(e,t,n){return si(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,bs(n),t.emit)}},Cs={type:`er`,parse:t.parseErDiagram,layoutForSvg(t,n){return ki((0,e.withDirectionOverride)(t,n.direction),n)},renderSvg(e,t){return Mi(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},ws={type:`flowchart`,parse:(e,n)=>(0,t.parseMermaid)(n),layoutForSvg(t,n){return{graph:yn((0,e.withDirectionOverride)(t,n.direction),n),curve:n.curve??t.initConfig?.curve??`linear`}},renderSvg(e,t,n){return An(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,xs(n),bs(n),t.title,t.decorative,t.emit)}},Ts={type:`c4`,parse:t.parseC4Diagram,layoutForSvg(e,t){return is(e,t)},renderSvg(e,t){return as(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},Es={xychart:vs,er:Cs,sequence:ys,class:Ss,flowchart:ws,architecture:{type:`architecture`,parse:t.parseArchitecture,layoutForSvg(n,r){return{graph:_n((0,e.withDirectionOverride)((0,t.architectureToGraph)(n),r.direction),r),curve:r.curve??`linear`}},renderSvg:ws.renderSvg},c4:Ts,pie:{type:`pie`,parse:(e,n)=>(0,t.parsePieChart)(n),layoutForSvg:(e,t)=>qa(t.honorThemeVariables?e:{...e,sliceColors:void 0},t),renderSvg(e,t){return Za(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)=>to(t.honorThemeVariables?e:{...e,themeColors:void 0}),renderSvg(e,t){return ao(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}}};function Ds(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 Os(t={}){return(0,e.themeStyleDeclarations)(Ds(t),t.transparent)}function ks(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute,bodyFont:a(e)}}function As(e,t={}){let{svg:n,colors:r}=Ns(e,t),i=js(n);return t.resolveColors?Hr(i,r):i}function js(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 Ms(t){let r=(0,e.extractAccessibility)((0,n.decodeXML)(t)).text;Es[(0,e.detectDiagramType)(r)].parse((0,e.splitStatements)(r),r)}function Ns(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=M(r.fontSizes),l=(0,e.detectDiagramType)(a),u=r.embedSource?t:void 0,d=r.title??i.accTitle,f=r.decorative,p={...ks(r),description:i.accDescr},m=(0,e.splitStatements)(a),h=Es[l],g=h.parse(m,a),_=g;_.nodes instanceof Map&&Array.isArray(_.edges)&&(0,e.checkGraphSize)(_.nodes.size,_.edges.length,r.limits);let v=h.layoutForSvg(g,r),y=Ds(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};return{svg:h.renderSvg(v,b,r),colors:y}}async function Ps(e,t={}){return t.embedFont===`subset`&&await i(),As(e,t)}var Fs=As,Is=Ps;exports.ACTOR_LABEL_OFFSET=Ui,exports.ARROW_HEAD=L,exports.ASYMMETRIC_NOTCH=te,exports.CLS=U,exports.ELK_DIRECTION_FALLBACK=ne,exports.ElkNotRegisteredError=g,exports.FONT_SIZES=j,exports.FONT_WEIGHTS=N,exports.GROUP_HEADER_CONTENT_PAD=ee,exports.INLINE_CENTERED_EDGE_LABEL=se,exports.MONO_FONT=k,exports.MONO_FONT_STACK=A,exports.NODE_PADDING=P,exports.PIE=X,exports.QUADRANT=Qa,exports.STROKE_WIDTHS=F,exports.TEXT_BASELINE_SHIFT=I,exports.baseElkLayoutOptions=ae,exports.boxLabelHeight=Hi,exports.buildElkEdge=le,exports.buildElkEdgeLabel=ce,exports.buildElkLeafNode=oe,exports.buildSvgStyleBlock=R,exports.classBackEdges=Qr,exports.classNoteId=qr,exports.clipEdgeToShape=je,exports.convertToElkFormat=bn,exports.createLayoutCache=x,exports.directionToElk=re,exports.elkLayoutSync=w,exports.elkPadding=ie,exports.estimateMonoTextWidth=O,exports.estimateTextWidth=D,exports.evaluateCssColorValue=Ir,exports.extractEdgeLabelPosition=Je,exports.extractEdgePoints=qe,exports.formatTickLabels=ja,exports.hasLabelBelowIcon=Gi,exports.layoutClassDiagramSync=ti,exports.layoutErDiagramSync=ki,exports.layoutFlowchartSync=yn,exports.layoutGraphSync=_n,exports.layoutPieChart=qa,exports.layoutQuadrantChart=to,exports.layoutSequenceDiagram=Zi,exports.layoutXYChart=xa,exports.loadEmbeddedFont=i,Object.defineProperty(exports,"niceTickValues",{enumerable:!0,get:function(){return e.niceTickValues}}),exports.pieColorValue=Ya,exports.pointsToPath=d,exports.registerElk=_,exports.renderClassSvg=si,exports.renderErSvg=Mi,exports.renderMermaid=Is,exports.renderMermaidSVG=As,exports.renderMermaidSVGAsync=Ps,exports.renderMermaidSync=Fs,exports.renderPieSvg=Za,exports.renderQuadrantSvg=ao,exports.renderSequenceSvg=Qi,exports.renderSvg=An,exports.renderXYChartSvg=Pa,exports.resolveCssColors=Hr,exports.resolveFontSizes=M,exports.smoothCurvePath=za,exports.straightLinePath=Ra,exports.themeCssVariables=Os,exports.validateMermaid=Ms,exports.withDataSrc=Dr,exports.xLabelStep=Da;
98
+ </style>`}function uo(t,n){return t.text?`<text x="0" y="0" class="quadrant-text ${n}" font-size="${t.fontSize}" dominant-baseline="${t.baseline}" text-anchor="${t.anchor}" transform="translate(${so(t.x)}, ${so(t.y)}) rotate(${t.rotation})">${(0,e.escapeXml)(t.text)}</text>`:``}function fo(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(Or((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(lo(t,c.nonce)),l.push(`<g class="quadrants">`);for(let e of t.quadrants)l.push(`<g class="quadrant"><rect x="${so(e.x)}" y="${so(e.y)}" width="${so(e.width)}" height="${so(e.height)}" class="quadrant-cell-${e.index}"/>${uo(e.text,`quadrant-label`)}</g>`);l.push(`</g>`),l.push(`<g class="border">`);for(let e of t.lines)l.push(`<line x1="${so(e.x1)}" y1="${so(e.y1)}" x2="${so(e.x2)}" y2="${so(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="${so(e.x)}" cy="${so(e.y)}" r="${e.radius}" class="quadrant-point${n}"/>${uo(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">${uo(e,`quadrant-axis-label`)}</g>`);return l.push(`</g>`),l.push(`<g class="title">`),t.title&&l.push(uo(t.title,`quadrant-title`)),l.push(`</g>`),l.push(`</svg>`),l.join(`
99
+ `)}var po=2048,mo=[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],ho=[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 go(e,t){let n=e.codePointAt(0);if(!(n<32||n>126))return(t?ho:mo)[n-32]/po}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},_o=$.width-2*$.shapePadding;function vo(e,t,n){let r=[];for(let i of e.split(`
100
+ `)){let e=``;for(let a of i.split(/\s+/).filter(Boolean)){let i=e?`${e} ${a}`:a;e&&wo(i,n,400)>t?(r.push(e),e=a):e=i}r.push(e)}return r}function yo(e,t){let n=Math.min(Math.max(e*$.personHeadRatio,$.personHeadMin),$.personHeadMax),r=n*(2-$.personHeadOverlap),i=t===void 0?1/0:t-r;return{rx:Math.min(e*$.personRx,i*$.personRxMaxOfHeight),headRadius:n,pillTop:r}}function bo(e,t){return e*$.nameLine+$.typeLine+xo(t)}function xo(e){return e===0?0:$.descrLine+(e-1)*$.descrExtraLine}function So(e){let t=e/2;return{rx:t,ry:t/(2.5+e/50)}}function Co(e){let t=e/2;return{rx:t/(2.5+e/50),ry:t}}function wo(e,t,n){let r=0;for(let i of e){let e=go(i,n>=600);r+=e===void 0?D(i,t,n)*$.textScale:e*t}return r}function To(e,t,n,r){let i=bo(t,n),a=i+2*$.shapePadding,o=Math.max($.width,r+2*$.shapePadding);if(e.kind===`person`)return{width:o,height:yo(o).pillTop+a,textHeight:i};if(e.shape===`db`){let{ry:e}=So(o);return{width:o,height:a+2*e-$.dbTrim,textHeight:i}}if(e.shape===`queue`){let e=i+$.queueExtra,{rx:t}=Co(e);return{width:o+3*t,height:e,textHeight:i}}return{width:o,height:a,textHeight:i}}function Eo(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 Do=$.messageSize+5;function Oo(e){return e.labelLines??(0,t.c4RelLabelLines)(e)}function ko(e){let t=e.labelPosition;return t?Oo(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*Do,w:wo(n,$.messageSize,400),h:$.messageSize})):[]}function Ao(){return{next:{cnt:0}}}function jo(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 Mo(e,t,n,r){let i=e[t];e[t]=i===void 0?n:r(n,i)}function No(e,t){e.next.cnt+=1;let n=$.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>$.shapeInRow)&&(r=e.next.startx+n+$.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,Mo(e,`startx`,r,Math.min),Mo(e,`starty`,a,Math.min),Mo(e,`stopx`,i,Math.max),Mo(e,`stopy`,o,Math.max),Mo(e.next,`startx`,r,Math.min),Mo(e.next,`starty`,a,Math.min),Mo(e.next,`stopx`,i,Math.max),Mo(e.next,`stopy`,o,Math.max)}function Po(e){let n=vo(e.label,_o,$.nameSize),r=e.description?vo(e.description,_o,$.descrSize):[],i=Math.max(...n.map(e=>wo(e,$.nameSize,700)),wo((0,t.c4TypeLine)(e),$.typeSize,400),...r.map(e=>wo(e,$.descrSize,400)));return{el:e,nameLines:n,descriptionLines:r,x:0,y:0,...To(e,n.length,r.length,i)}}function Fo(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 Io(e){let n=new Map,r=[],i=$.diagramMarginX,a=$.diagramMarginY,o=(e,t)=>{for(let r of t){let t=Po(r);n.set(r.alias,t),No(e,t)}e.stopx+=$.shapeMargin,e.stopy+=$.shapeMargin},s=(e,n,c)=>{let l=Ao();l.widthLimit=e.widthLimit/Math.min($.boundaryInRow,n.length);for(let[u,d]of n.entries()){let n=d.boundary,f=0,p=f+8;f=p+$.boundaryLabelHeight;let m;n&&(0,t.c4BoundaryTypeLine)(n)&&(m=f+5,f=m+$.boundaryTypeHeight);let h;if(n?.description&&(h=f+20,f=h+$.boundaryDescrHeight),n||(f=$.rootHeadingHeight),u===0||u%$.boundaryInRow===0){let t=e.startx+$.diagramMarginX,n=e.stopy+$.diagramMarginY+f;jo(l,t,t,n,n)}else{let e=l.stopx===l.startx?l.startx:l.stopx+$.diagramMarginX;jo(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=$.width,l.stopx=l.startx+e),t===0&&(t=f+$.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+$.shapeMargin,e.stopy),e.stopx=Math.max(l.stopx+$.shapeMargin,e.stopx),i=Math.max(i,e.stopx),a=Math.max(a,e.stopy)}},c=Ao();return jo(c,$.diagramMarginX,$.diagramMarginX,$.diagramMarginY,$.diagramMarginY),c.widthLimit=$.screenWidth,s(c,[e],-1),{elements:n,boundaries:r,maxX:i,maxY:a}}function Lo(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 Ro(e,t){let n=yo(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 Bo({x:r,y:i},t,f.map(e=>({x:r+e.x,y:i+e.y})))}function zo(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 Bo(e,t,n){let r,i=1/0;return n.forEach((a,o)=>{let s=zo(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 Vo=1e-6;function Ho(e,t){let n=Lo(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=So(e.width),s=n.x-r,c=Math.abs(s)<e.width/2-Vo||Math.abs(Math.abs(s)-e.width/2)<=Vo&&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 Uo(e,t){let n=Lo(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=Co(e.height),s=n.y-i,c=Math.abs(s)<e.height/2-Vo||Math.abs(Math.abs(s)-e.height/2)<=Vo&&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 Wo(e,t){let n=e.el;return n?.kind===`person`?Ro(e,t):n?.shape===`db`?Ho(e,t):n?.shape===`queue`?Uo(e,t):Lo(e,t)}var Go=e=>({x:e.x+e.width/2,y:e.y+e.height/2});function Ko(e,n,r,i){let a=r.get(e.from),o=r.get(e.to),s=Wo(a,Go(o)),c=Wo(o,Go(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?wo(r??``,$.messageSize,400):0;if(f.labelPosition=d({x:n.x+i/2,y:n.y}),e.technology){let t=wo(`[${e.technology}]`,$.messageSize,400);f.technologyX=n.x+Math.max(i,t)/2}}return f}var qo=2,Jo=6,Yo=2,Xo=[0,14,-14,28,-28],Zo=[.75,.55,.4],Qo=1e3,$o=100,es=10,ts=2,ns=5,rs=4,is=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}),as=(e,t)=>e.x0<t.x1+qo&&e.x1>t.x0-qo&&e.y0<t.y1+qo&&e.y1>t.y0-qo;function os(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/rs));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 ss(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:$o}),r=(t,r,i,a)=>{let o=wo(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,ns)},i=(0,t.c4BoundaryTypeLine)({...e,elementAliases:[],children:[]});return[n(e.x,e.x+e.width,e.y,e.y,ts),n(e.x,e.x+e.width,e.y+e.height,e.y+e.height,ts),n(e.x,e.x,e.y,e.y+e.height,ts),n(e.x+e.width,e.x+e.width,e.y,e.y+e.height,ts),r(e.label,e.labelY,$.boundarySize+2,700),...i?[r(i,e.typeY,$.boundarySize,400)]:[],...e.description?[r(e.description,e.descrY,$.boundarySize-2,400)]:[]]})}function cs(e,t){return ko({...e,labelLines:t.lines,labelPosition:t.position,...t.technologyX===void 0?{}:{technologyX:t.technologyX}}).map(is)}function ls(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?wo(d[0],$.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(`
101
+ `)]);Zo.forEach((e,r)=>{let i=vo(d[0],p*e,$.messageSize),a=[...i,...t].join(`
102
+ `);if(n.has(a))return;n.add(a);let o=Math.max(...i.map(e=>wo(e,$.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(...Xo)+qo,y=h.flatMap(t=>cs(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(Yo,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=cs(e,t);for(let e of Xo)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(as(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+=es)}}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(...ko(e).map(e=>({...is(e),weight:$o})))}function us(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*$.diagramMarginY+$.titleExtra;t.title=e.title,t.width=Math.ceil(2*$.diagramMarginX+wo(e.title,16,400)),t.height=n,t.titlePosition={x:$.diagramMarginX,y:n/2}}return t}let n=Io(Fo(e)),r=e.title?$.titleExtra:0,i=$.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)=>Ko(e,t,s,i)),l=[...a.map(e=>({x0:e.x-Jo,x1:e.x+e.width+Jo,y0:e.y-Jo,y1:e.y+e.height+Jo,weight:Qo})),...ss(o)],u=c.map(os),d=[];c.forEach((e,t)=>ls(e,l,u.filter((e,n)=>n!==t),d));let f=n.maxX+$.diagramMarginX,p=n.maxY+$.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-$.diagramMarginX)/2-4*$.diagramMarginX,y:$.diagramMarginY+$.diagramMarginY+i}),m}function ds(t,n,r=`Inter`,i=!1,a=A,o,s,c,l={}){let u=[];u.push(Or((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(ps(e));for(let e of t.elements)u.push(ms(e));for(let e of t.relationships)u.push(Ss(e));for(let e of t.relationships)u.push(Cs(e));return u.push(`</svg>`),u.filter(Boolean).join(`
103
+ `)}function fs(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 ps(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(fs(n.label,i,n.y+(n.labelY??8),$.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(fs(a,i,n.y+n.typeY,$.boundarySize,`fill="var(--_text)"`)),n.description&&n.descrY!==void 0&&r.push(fs(n.description,i,n.y+n.descrY,$.boundarySize-2,`fill="var(--_text)"`)),r.push(`</g>`),r.join(`
104
+ `)}function ms(n){let r=Eo(n),{x:i,y:a,width:o,height:s}=n,c=i+o/2,l=bo(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(...gs(n,r)),d=a+yo(o).pillTop+$.shapePadding;else if(n.shape===`db`){u.push(..._s(n,r));let{ry:e}=So(o);d=a+(2*e+s)/2-l/2}else if(n.shape===`queue`){u.push(...vs(n,r));let{rx:e}=Co(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="${$.cornerRadius}" ry="${$.cornerRadius}" `+e.f`fill="${r.fill}" stroke="${r.stroke}" stroke-width="${$.strokeWidth}" />`),d=a+$.shapePadding;let p=d;for(let t of n.nameLines)u.push(fs(t,f,p+$.nameLine/2,$.nameSize,e.f`font-weight="700" fill="${r.text}"`)),p+=$.nameLine;return u.push(fs((0,t.c4TypeLine)(n),f,p+$.typeLine/2,$.typeSize,e.f`fill="${r.text}"`)),p+=$.typeLine,n.descriptionLines.forEach((t,n)=>{u.push(fs(t,f,p+$.descrLine/2+n*$.descrExtraLine,$.descrSize,e.f`fill="${r.text}"`))}),p+=xo(n.descriptionLines.length),u.push(`</g>`),u.join(`
105
+ `)}function hs(t){let{x:n,y:r,width:i,height:a}=t,{rx:o,headRadius:s,pillTop:c}=yo(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 gs(t,n){return[e.f` <path class="c4-person-shape" d="${hs(t)}" fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.strokeWidth}" />`]}function _s(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=So(a),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.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 vs(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=Co(o),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.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 ys(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 bs=3,xs=1;function Ss(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=ys(r,s),u=ys(n,c);return[o,...t.bidirectional?[l,u]:[t.reversed?u:l]].filter(Boolean).join(`
106
+ `)}function Cs(t){let n=Oo(t),r=ko(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))-bs,o=Math.max(...r.map(e=>e.cx+e.w/2))+bs,s=r[0].cy-r[0].h/2-xs,c=r[r.length-1],l=c.cy+c.h/2+xs;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(fs(e,s.cx,s.cy,$.messageSize,o?`font-style="italic" fill="var(--_text)"`:`fill="var(--_text)"`))}),i.push(`</g>`),i.join(`
107
+ `)}var ws={type:`xychart`,parse:t.parseXYChart,layoutForSvg:Ea,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return za(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},Ts={type:`sequence`,parse:t.parseSequenceDiagram,layoutForSvg:ia,renderSvg(e,t){return aa(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function Es(e){return(e.interactivity??`static`)!==`none`}function Ds(e){return(e.interactivity??`static`)===`full`}var Os={type:`class`,parse:t.parseClassDiagram,layoutForSvg:ni,renderSvg(e,t,n){return ci(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,Es(n),t.emit)}},ks={type:`er`,parse:t.parseErDiagram,layoutForSvg(t,n){return Ai((0,e.withDirectionOverride)(t,n.direction),n)},renderSvg(e,t){return Ni(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},As={type:`flowchart`,parse:(e,n)=>(0,t.parseMermaid)(n),layoutForSvg(t,n){return{graph:yn((0,e.withDirectionOverride)(t,n.direction),n),curve:n.curve??t.initConfig?.curve??`linear`}},renderSvg(e,t,n){return An(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,Ds(n),Es(n),t.title,t.decorative,t.emit)}},js={type:`c4`,parse:t.parseC4Diagram,layoutForSvg(e,t){return us(e,t)},renderSvg(e,t){return ds(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},Ms={xychart:ws,er:ks,sequence:Ts,class:Os,flowchart:As,architecture:{type:`architecture`,parse:t.parseArchitecture,layoutForSvg(n,r){return{graph:_n((0,e.withDirectionOverride)((0,t.architectureToGraph)(n),r.direction),r),curve:r.curve??`linear`}},renderSvg:As.renderSvg},c4:js,pie:{type:`pie`,parse:(e,n)=>(0,t.parsePieChart)(n),layoutForSvg:(e,t)=>Qa(t.honorThemeVariables?e:{...e,sliceColors:void 0},t),renderSvg(e,t){return no(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)=>oo(t.honorThemeVariables?e:{...e,themeColors:void 0}),renderSvg(e,t){return fo(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}}};function Ns(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 Ps(t={}){return(0,e.themeStyleDeclarations)(Ns(t),t.transparent)}function Fs(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute,bodyFont:a(e)}}function Is(e,t={}){let{svg:n,colors:r}=zs(e,t),i=Ls(n);return t.resolveColors?Ur(i,r):i}function Ls(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 Rs(t){let r=(0,e.extractAccessibility)((0,n.decodeXML)(t)).text;Ms[(0,e.detectDiagramType)(r)].parse((0,e.splitStatements)(r),r)}function zs(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=j(r.fontSizes),l=(0,e.detectDiagramType)(a),u=r.embedSource?t:void 0,d=r.title??i.accTitle,f=r.decorative,p={...Fs(r),description:i.accDescr},m=(0,e.splitStatements)(a),h=Ms[l],g=h.parse(m,a),_=g;_.nodes instanceof Map&&Array.isArray(_.edges)&&(0,e.checkGraphSize)(_.nodes.size,_.edges.length,r.limits);let v=h.layoutForSvg(g,r),y=Ns(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};return{svg:h.renderSvg(v,b,r),colors:y}}async function Bs(e,t={}){return t.embedFont===`subset`&&await i(),Is(e,t)}var Vs=Is,Hs=Bs;exports.ACTOR_LABEL_OFFSET=qi,exports.ARROW_HEAD=I,exports.ASYMMETRIC_NOTCH=ne,exports.CLS=W,exports.ELK_DIRECTION_FALLBACK=re,exports.ElkNotRegisteredError=g,exports.FONT_SIZES=A,exports.FONT_WEIGHTS=M,exports.GROUP_HEADER_CONTENT_PAD=te,exports.INLINE_CENTERED_EDGE_LABEL=oe,exports.MONO_FONT=k,exports.MONO_FONT_STACK=ee,exports.NODE_PADDING=N,exports.PIE=Z,exports.QUADRANT=ro,exports.SELF_LOOP_CONTROL=Ui,exports.SELF_LOOP_EXTENT=Wi,exports.SELF_LOOP_HEIGHT=Gi,exports.STROKE_WIDTHS=P,exports.TEXT_BASELINE_SHIFT=F,exports.baseElkLayoutOptions=z,exports.boxLabelHeight=Ki,exports.buildElkEdge=ce,exports.buildElkEdgeLabel=se,exports.buildElkLeafNode=B,exports.buildSvgStyleBlock=L,exports.classBackEdges=$r,exports.classNoteId=Jr,exports.clipEdgeToShape=Ae,exports.convertToElkFormat=bn,exports.createLayoutCache=x,exports.directionToElk=ie,exports.elkLayoutSync=w,exports.elkPadding=ae,exports.estimateMonoTextWidth=O,exports.estimateTextWidth=D,exports.evaluateCssColorValue=Lr,exports.extractEdgeLabelPosition=qe,exports.extractEdgePoints=Ke,exports.formatTickLabels=Ia,exports.hasLabelBelowIcon=Yi,exports.layoutClassDiagramSync=ni,exports.layoutErDiagramSync=Ai,exports.layoutFlowchartSync=yn,exports.layoutGraphSync=_n,exports.layoutPieChart=Qa,exports.layoutQuadrantChart=oo,exports.layoutSequenceDiagram=ia,exports.layoutXYChart=Ea,exports.loadEmbeddedFont=i,Object.defineProperty(exports,"niceTickValues",{enumerable:!0,get:function(){return e.niceTickValues}}),exports.pieColorValue=eo,exports.pointsToPath=d,exports.registerElk=_,exports.renderClassSvg=ci,exports.renderErSvg=Ni,exports.renderMermaid=Hs,exports.renderMermaidSVG=Is,exports.renderMermaidSVGAsync=Bs,exports.renderMermaidSync=Vs,exports.renderPieSvg=no,exports.renderQuadrantSvg=fo,exports.renderSequenceSvg=aa,exports.renderSvg=An,exports.renderXYChartSvg=za,exports.resolveCssColors=Ur,exports.resolveFontSizes=j,exports.smoothCurvePath=Wa,exports.straightLinePath=Ua,exports.themeCssVariables=Ps,exports.validateMermaid=Rs,exports.withDataSrc=Or,exports.xLabelStep=Ma;