pi-outpost 0.35.0 → 0.35.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.
Files changed (95) hide show
  1. package/dist/contract/validate-structured-exchange.mjs +1 -1
  2. package/dist/pi-outpost.mjs +89 -84
  3. package/dist/pi-outpost.sea.mjs +2 -2
  4. package/dist/sea-prep.blob +2 -2
  5. package/dist/web/assets/PdfViewer-CptfuY34.js +2 -0
  6. package/dist/web/assets/{abnfDiagram-YUKMZFIV-C_v5KfC7.js → abnfDiagram-YUKMZFIV-kB5t-7AM.js} +1 -1
  7. package/dist/web/assets/architecture-WOLXFQ4H-BuU5EQCD.js +1 -0
  8. package/dist/web/assets/{architectureDiagram-47P4ROYG-DTpA3_fr.js → architectureDiagram-47P4ROYG-C5hzR07F.js} +1 -1
  9. package/dist/web/assets/{blockDiagram-E7TT5TSB-JiGNkbrY.js → blockDiagram-E7TT5TSB-DdpYvXs8.js} +1 -1
  10. package/dist/web/assets/{c4Diagram-CRA5TL53-BqyaF5aA.js → c4Diagram-CRA5TL53-Di3h58ks.js} +1 -1
  11. package/dist/web/assets/channel-DVH-eaz_.js +1 -0
  12. package/dist/web/assets/{chunk-2BW5OAIV-SBPwGrjA.js → chunk-2BW5OAIV-BIIX2R6x.js} +1 -1
  13. package/dist/web/assets/{chunk-3YJQHVM4-MV5Ex8sq.js → chunk-3YJQHVM4-Dt99sj0b.js} +1 -1
  14. package/dist/web/assets/{chunk-4EA7E6EY-CKvXXyhx.js → chunk-4EA7E6EY-yvJMWemR.js} +1 -1
  15. package/dist/web/assets/{chunk-7TKQ45FW-D6DuC99K.js → chunk-7TKQ45FW-Dob6DuOQ.js} +1 -1
  16. package/dist/web/assets/{chunk-AW2ZBBNX-C4rsmcm9.js → chunk-AW2ZBBNX-DB6rxZAL.js} +1 -1
  17. package/dist/web/assets/{chunk-DBDB3WZW-DYwidElu.js → chunk-DBDB3WZW-BIeIRFel.js} +1 -1
  18. package/dist/web/assets/{chunk-E2ZNV5FY-CYbRGGQf.js → chunk-E2ZNV5FY-k59zNMXy.js} +1 -1
  19. package/dist/web/assets/{chunk-EU5HNXII-DxNjjYiq.js → chunk-EU5HNXII-ND0WZFFM.js} +1 -1
  20. package/dist/web/assets/{chunk-FVRAUYC3-cRWf5LC3.js → chunk-FVRAUYC3-D1LdAmKs.js} +1 -1
  21. package/dist/web/assets/{chunk-HJ2JQQFS-D9pDNejT.js → chunk-HJ2JQQFS-_yet-jCS.js} +1 -1
  22. package/dist/web/assets/{chunk-HTAEGDNF-B_PVN4qe.js → chunk-HTAEGDNF-DKo1PJAZ.js} +1 -1
  23. package/dist/web/assets/{chunk-KQW6MTUR-BvQfG-IU.js → chunk-KQW6MTUR-evHULq4-.js} +1 -1
  24. package/dist/web/assets/{chunk-NTY3LDVX-C_c1c_yY.js → chunk-NTY3LDVX-C2IFjend.js} +1 -1
  25. package/dist/web/assets/{chunk-VPRB5NB3-BneD2tFR.js → chunk-VPRB5NB3-CCVn2tFZ.js} +1 -1
  26. package/dist/web/assets/{chunk-XC4XBNZT-BfvNm2P2.js → chunk-XC4XBNZT-DjwT4Fb8.js} +1 -1
  27. package/dist/web/assets/{classDiagram-v2-K4WV4PDN-D3Jwj4hF.js → classDiagram-v2-K4WV4PDN-7vBzSF1K.js} +1 -1
  28. package/dist/web/assets/{conversationExport-B_MfzYyo.js → conversationExport-1pQ1kKRb.js} +2 -2
  29. package/dist/web/assets/{cynefin-EF2NZ3EQ-D0UE3xaA.js → cynefin-EF2NZ3EQ-EkVSUZoC.js} +1 -1
  30. package/dist/web/assets/{cynefinDiagram-3GCD6N5R-CCBRrG1y.js → cynefinDiagram-3GCD6N5R-TqsWGFj_.js} +1 -1
  31. package/dist/web/assets/{dagre-W4DXFKR2-zRL24iZJ.js → dagre-W4DXFKR2-Bs7WDnka.js} +1 -1
  32. package/dist/web/assets/{diagram-2UJZ2QOL-LHcLpXvO.js → diagram-2UJZ2QOL-BCCQWZ6Q.js} +1 -1
  33. package/dist/web/assets/{diagram-OVF4WLC6-8BeDZk_g.js → diagram-OVF4WLC6-ClTJAriq.js} +1 -1
  34. package/dist/web/assets/{diagram-PFPMY2P6-CKBnlJR4.js → diagram-PFPMY2P6-DRS4uv3o.js} +1 -1
  35. package/dist/web/assets/{diagram-UMYRVEAY-CRVvTnHL.js → diagram-UMYRVEAY-oQDIgSp_.js} +1 -1
  36. package/dist/web/assets/{diagram-YEKJPTXX-C77BIwU0.js → diagram-YEKJPTXX-DGvp5HHA.js} +1 -1
  37. package/dist/web/assets/{diagram-ZIFT7M5P-VCN0ewTA.js → diagram-ZIFT7M5P-DTOvOJP9.js} +1 -1
  38. package/dist/web/assets/{docxExport-Cx1UE4r4.js → docxExport-70RM2cmX.js} +2 -2
  39. package/dist/web/assets/{ebnfDiagram-VR2GEFS7-DE3BquXX.js → ebnfDiagram-VR2GEFS7-Bt9AsQhf.js} +1 -1
  40. package/dist/web/assets/{elk-IJKZMXRS-BMBFeeLM.js → elk-IJKZMXRS-43BtmMFC.js} +1 -1
  41. package/dist/web/assets/{erDiagram-O2IAPWRE-BpvBfZtG.js → erDiagram-O2IAPWRE-Cg5FjWxt.js} +1 -1
  42. package/dist/web/assets/eventmodeling-K75KTNOO-D-1S3G_r.js +1 -0
  43. package/dist/web/assets/flowDiagram-OXPTDLAJ-BwBlCFbR.js +1 -0
  44. package/dist/web/assets/{ganttDiagram-R7TSEDQI-Vx8rdpBL.js → ganttDiagram-R7TSEDQI-Drk9ZBL_.js} +1 -1
  45. package/dist/web/assets/{gitGraph-VSP46ZUC-CXqfxKB6.js → gitGraph-VSP46ZUC-_W77O0wc.js} +1 -1
  46. package/dist/web/assets/{gitGraphDiagram-XJZIOB7I-CtT_GFza.js → gitGraphDiagram-XJZIOB7I-BFVa-iQn.js} +1 -1
  47. package/dist/web/assets/index-DXN0nanq.js +350 -0
  48. package/dist/web/assets/{info-OHQRW6UA-Dzy6-ufv.js → info-OHQRW6UA-Ctq9vAkc.js} +1 -1
  49. package/dist/web/assets/{infoDiagram-5W2HQ5XZ-CFRmWQIO.js → infoDiagram-5W2HQ5XZ-9s3DGUEP.js} +1 -1
  50. package/dist/web/assets/{ishikawaDiagram-K3B6WC7H-Cibrnarh.js → ishikawaDiagram-K3B6WC7H-Bb66YtFg.js} +1 -1
  51. package/dist/web/assets/{journeyDiagram-COXZFDF6-DFoq_6Ri.js → journeyDiagram-COXZFDF6-DZ-UCzYx.js} +1 -1
  52. package/dist/web/assets/{kanban-definition-P3RFRI5V-B_ksgbTL.js → kanban-definition-P3RFRI5V-CXBbbpKw.js} +1 -1
  53. package/dist/web/assets/{line-DK5MzjMr.js → line-DI6oDPYR.js} +1 -1
  54. package/dist/web/assets/{loadReferencedImage-BAkXtzog.js → loadReferencedImage-BQpK9GNN.js} +2 -2
  55. package/dist/web/assets/{mermaid-parser.core-0hMEi6f9.js → mermaid-parser.core-F143UNdq.js} +3 -3
  56. package/dist/web/assets/{mermaid.core-D2DiwiHi.js → mermaid.core-FqGqI1ho.js} +4 -4
  57. package/dist/web/assets/{mindmap-definition-LZFPQGKD-DiJiFNch.js → mindmap-definition-LZFPQGKD-B6Q2fkYK.js} +1 -1
  58. package/dist/web/assets/{packet-JDAUHWVQ-BGr5cgVG.js → packet-JDAUHWVQ-DA9k8-fU.js} +1 -1
  59. package/dist/web/assets/{pdf-DUYUQwoI.js → pdf-DhwAPtjt.js} +1 -1
  60. package/dist/web/assets/{pegDiagram-BGZESJAR-BXEDbek_.js → pegDiagram-BGZESJAR-DGymYtc-.js} +1 -1
  61. package/dist/web/assets/{pie-XZMESJXO-Cf8_kbHC.js → pie-XZMESJXO-BWjAcopM.js} +1 -1
  62. package/dist/web/assets/{pieDiagram-CAPJLFHJ-Co9YXMsu.js → pieDiagram-CAPJLFHJ-BcDIEPPQ.js} +1 -1
  63. package/dist/web/assets/{quadrantDiagram-GDMTTRAM-CfS7tD05.js → quadrantDiagram-GDMTTRAM-DJQxy266.js} +1 -1
  64. package/dist/web/assets/{radar-ABXABTNO-BEGsrsAA.js → radar-ABXABTNO-DhsSZPg3.js} +1 -1
  65. package/dist/web/assets/{railroad-I3PHUGI6-CFT2jtUv.js → railroad-I3PHUGI6-DJ7oN14G.js} +1 -1
  66. package/dist/web/assets/railroad-abnf-LNEFI6M7-BZj4c-IW.js +1 -0
  67. package/dist/web/assets/railroad-ebnf-DWYD2UWJ-BnSjVGRJ.js +1 -0
  68. package/dist/web/assets/railroad-peg-JR7BVNR7-Cf0UiINZ.js +1 -0
  69. package/dist/web/assets/{railroadDiagram-SM67HX2B-CbQqJD5P.js → railroadDiagram-SM67HX2B-BaHuLDd3.js} +1 -1
  70. package/dist/web/assets/{requirementDiagram-X7JNWC4A-BGmGKspK.js → requirementDiagram-X7JNWC4A-Cdx0JkRV.js} +1 -1
  71. package/dist/web/assets/{sankeyDiagram-UM26HJRW-BrgJVT7k.js → sankeyDiagram-UM26HJRW-Wmb1OXw9.js} +1 -1
  72. package/dist/web/assets/{sequenceDiagram-ZO4K6R2Y-VgSVGmd4.js → sequenceDiagram-ZO4K6R2Y-B0l0Rf12.js} +1 -1
  73. package/dist/web/assets/{stateDiagram-v2-TBUQTH76-DyoK2VR4.js → stateDiagram-v2-TBUQTH76-DzgT3ME7.js} +1 -1
  74. package/dist/web/assets/{swimlanes-N4OXWK64-DFGFtJZB.js → swimlanes-N4OXWK64-CiDMShdL.js} +1 -1
  75. package/dist/web/assets/swimlanesDiagram-K3J5GTZL-BNLW10Yk.js +8 -0
  76. package/dist/web/assets/{timeline-definition-YOQAKGHF-Cqgm-mFB.js → timeline-definition-YOQAKGHF-C0vevBVy.js} +1 -1
  77. package/dist/web/assets/{treeView-D4JQ5SDB-CSP5w1GL.js → treeView-D4JQ5SDB-0qXyE7XG.js} +1 -1
  78. package/dist/web/assets/{treemap-SAJKECNS-DkHwZurr.js → treemap-SAJKECNS-DzfA771k.js} +1 -1
  79. package/dist/web/assets/{usecaseDiagram-VIAY4XPW-C4OqICTk.js → usecaseDiagram-VIAY4XPW-tA8gpVwy.js} +1 -1
  80. package/dist/web/assets/{vennDiagram-BLWOH2XV-C9lYHAeZ.js → vennDiagram-BLWOH2XV-DwCrnY44.js} +1 -1
  81. package/dist/web/assets/{wardley-7MLQ67FV-CPzWT6B3.js → wardley-7MLQ67FV-BdlgtOCQ.js} +1 -1
  82. package/dist/web/assets/{wardleyDiagram-YMQ3BMBF-DXD2__kE.js → wardleyDiagram-YMQ3BMBF-hSTGOEfh.js} +1 -1
  83. package/dist/web/assets/{xychartDiagram-TAQBALBS-Dqxktrov.js → xychartDiagram-TAQBALBS-CDqueuac.js} +1 -1
  84. package/dist/web/index.html +1 -1
  85. package/package.json +2 -2
  86. package/dist/web/assets/PdfViewer-GOg5r-bG.js +0 -2
  87. package/dist/web/assets/architecture-WOLXFQ4H-DqYyXFjD.js +0 -1
  88. package/dist/web/assets/channel-BQKcNNxJ.js +0 -1
  89. package/dist/web/assets/eventmodeling-K75KTNOO-DLCfkEm-.js +0 -1
  90. package/dist/web/assets/flowDiagram-OXPTDLAJ-BqkbyaSw.js +0 -1
  91. package/dist/web/assets/index-D8PP343M.js +0 -350
  92. package/dist/web/assets/railroad-abnf-LNEFI6M7-BeOImRGm.js +0 -1
  93. package/dist/web/assets/railroad-ebnf-DWYD2UWJ-BZhyClCm.js +0 -1
  94. package/dist/web/assets/railroad-peg-JR7BVNR7-DXhvwuLk.js +0 -1
  95. package/dist/web/assets/swimlanesDiagram-K3J5GTZL-BmwDNPXX.js +0 -8
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{y as n,z as r}from"./chunk-VPRB5NB3-BneD2tFR.js";var i=Object.freeze({left:0,top:0,width:16,height:16}),a=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),o=Object.freeze({...i,...a}),s=Object.freeze({...o,body:``,hidden:!1}),c=Object.freeze({width:null,height:null}),l=Object.freeze({...c,...a}),u=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!d(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!d(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!d(e,n)?null:e}return null},d=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function f(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function p(e,t){let n=f(e,t);for(let r in s)r in a?r in e&&!(r in n)&&(n[r]=a[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function m(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function h(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=p(r[e]||i[e],a)}return o(t),n.forEach(o),p(e,a)}function g(e,t){if(e.icons[t])return h(e,t,[]);let n=m(e,[t])[t];return n?h(e,t,n):null}var _=/(-?[0-9.]*[0-9]+[0-9.]*)/g,v=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function y(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(_);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=v.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function b(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function x(e,t){return e?`<defs>`+e+`</defs>`+t:t}function S(e,t,n){let r=b(e);return x(r.defs,t+r.content+n)}var C=e=>e===`unset`||e===`undefined`||e===`none`;function w(e,t){let n={...o,...e},r={...l,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=S(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let s=r.width,c=r.height,u=i.width,d=i.height,f,p;s===null?(p=c===null?`1em`:c===`auto`?d:c,f=y(p,u/d)):(f=s===`auto`?u:s,p=c===null?y(f,d/u):c===`auto`?d:c);let m={},h=(e,t)=>{C(t)||(m[e]=t.toString())};h(`width`,f),h(`height`,p);let g=[i.left,i.top,u,d];return m.viewBox=g.join(` `),{attributes:m,viewBox:g,body:a}}var T=/\sid="(\S+)"/g,E=new Map;function D(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=E.get(e)||0;return E.set(e,t+1),t?`${e}${t}`:e}function O(e){let t=[],n;for(;n=T.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=D(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}function k(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}var A={body:`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>`,height:80,width:80},j=new Map,M=new Map,N=e(e=>{for(let n of e){if(!n.name)throw Error(`Invalid icon loader. Must have a "name" property with non-empty string value.`);if(t.debug(`Registering icon pack:`,n.name),`loader`in n)M.set(n.name,n.loader);else if(`icons`in n)j.set(n.name,n.icons);else throw t.error(`Invalid icon loader:`,n),Error(`Invalid icon loader. Must have either "icons" or "loader" property.`)}},`registerIconPacks`),P=e(async(e,n)=>{let r=u(e,!0,n!==void 0);if(!r)throw Error(`Invalid icon name: ${e}`);let i=r.prefix||n;if(!i)throw Error(`Icon name must contain a prefix: ${e}`);let a=j.get(i);if(!a){let e=M.get(i);if(!e)throw Error(`Icon set not found: ${r.prefix}`);try{a={...await e(),prefix:i},j.set(i,a)}catch(e){throw t.error(e),Error(`Failed to load icon set: ${r.prefix}`)}}let o=g(a,r.name);if(!o)throw Error(`Icon not found: ${e}`);return o},`getRegisteredIconData`),F=e(async e=>{try{return await P(e),!0}catch{return!1}},`isIconAvailable`),I=e(async(e,i,a)=>{let o;try{o=await P(e,i?.fallbackPrefix)}catch(e){t.error(e),o=A}let s=w(o,i),c=k(O(s.body),{...s.attributes,...a});return r(c,n())},`getIconSVG`);export{A as i,F as n,N as r,I as t};
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{y as n,z as r}from"./chunk-VPRB5NB3-CCVn2tFZ.js";var i=Object.freeze({left:0,top:0,width:16,height:16}),a=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),o=Object.freeze({...i,...a}),s=Object.freeze({...o,body:``,hidden:!1}),c=Object.freeze({width:null,height:null}),l=Object.freeze({...c,...a}),u=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!d(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!d(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!d(e,n)?null:e}return null},d=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function f(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function p(e,t){let n=f(e,t);for(let r in s)r in a?r in e&&!(r in n)&&(n[r]=a[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function m(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function h(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=p(r[e]||i[e],a)}return o(t),n.forEach(o),p(e,a)}function g(e,t){if(e.icons[t])return h(e,t,[]);let n=m(e,[t])[t];return n?h(e,t,n):null}var _=/(-?[0-9.]*[0-9]+[0-9.]*)/g,v=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function y(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(_);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=v.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function b(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function x(e,t){return e?`<defs>`+e+`</defs>`+t:t}function S(e,t,n){let r=b(e);return x(r.defs,t+r.content+n)}var C=e=>e===`unset`||e===`undefined`||e===`none`;function w(e,t){let n={...o,...e},r={...l,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=S(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let s=r.width,c=r.height,u=i.width,d=i.height,f,p;s===null?(p=c===null?`1em`:c===`auto`?d:c,f=y(p,u/d)):(f=s===`auto`?u:s,p=c===null?y(f,d/u):c===`auto`?d:c);let m={},h=(e,t)=>{C(t)||(m[e]=t.toString())};h(`width`,f),h(`height`,p);let g=[i.left,i.top,u,d];return m.viewBox=g.join(` `),{attributes:m,viewBox:g,body:a}}var T=/\sid="(\S+)"/g,E=new Map;function D(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=E.get(e)||0;return E.set(e,t+1),t?`${e}${t}`:e}function O(e){let t=[],n;for(;n=T.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=D(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}function k(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}var A={body:`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>`,height:80,width:80},j=new Map,M=new Map,N=e(e=>{for(let n of e){if(!n.name)throw Error(`Invalid icon loader. Must have a "name" property with non-empty string value.`);if(t.debug(`Registering icon pack:`,n.name),`loader`in n)M.set(n.name,n.loader);else if(`icons`in n)j.set(n.name,n.icons);else throw t.error(`Invalid icon loader:`,n),Error(`Invalid icon loader. Must have either "icons" or "loader" property.`)}},`registerIconPacks`),P=e(async(e,n)=>{let r=u(e,!0,n!==void 0);if(!r)throw Error(`Invalid icon name: ${e}`);let i=r.prefix||n;if(!i)throw Error(`Icon name must contain a prefix: ${e}`);let a=j.get(i);if(!a){let e=M.get(i);if(!e)throw Error(`Icon set not found: ${r.prefix}`);try{a={...await e(),prefix:i},j.set(i,a)}catch(e){throw t.error(e),Error(`Failed to load icon set: ${r.prefix}`)}}let o=g(a,r.name);if(!o)throw Error(`Icon not found: ${e}`);return o},`getRegisteredIconData`),F=e(async e=>{try{return await P(e),!0}catch{return!1}},`isIconAvailable`),I=e(async(e,i,a)=>{let o;try{o=await P(e,i?.fallbackPrefix)}catch(e){t.error(e),o=A}let s=w(o,i),c=k(O(s.body),{...s.attributes,...a});return r(c,n())},`getIconSVG`);export{A as i,F as n,N as r,I as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{o as t}from"./chunk-2BW5OAIV-SBPwGrjA.js";var n=5,r=1e-5,i=2,a=.6,o=1e-6;function s(e){let t=[];for(let n=0;n<e.length-1;n++)t.push({a:e[n],b:e[n+1]});return t}e(s,`buildSegmentList`);function c(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,s=r.x-n.x,c=r.y-n.y,l=i*c-a*s;if(l===0)return null;let u=n.x-e.x,d=n.y-e.y,f=(u*c-d*s)/l,p=(u*a-d*i)/l;return f<=o||f>=1-o||p<=o||p>=1-o?null:{point:{x:e.x+f*i,y:e.y+f*a},tA:f,tB:p}}e(c,`segmentIntersection`);function l(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}e(l,`isHorizontalSeg`);function u(e,t,r){if(e.curve!==`rounded`)return!1;let i=e.points,a=i[t],o=i[t+1];if(!a||!o)return!1;let s=Math.hypot(o.x-a.x,o.y-a.y),c=r*s,l=t>0?_(i[t-1],a,o,n):null;if(l&&c<l.cutLen)return!0;let u=t+2<i.length?_(a,o,i[t+2],n):null;return u!==null&&s-c<u.cutLen}e(u,`crossingSitsInRoundedCorner`);function d(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=s(r.points);for(let a=n+1;a<e.length;a++){let n=e[a],o=s(n.points);for(let[e,a]of i.entries())for(let[i,s]of o.entries()){let o=c(a.a,a.b,s.a,s.b);if(!o||u(r,e,o.tA)||u(n,i,o.tB))continue;let d=l(a);d!==l(s)&&d?t.push({jumpEdgeId:r.id,otherEdgeId:n.id,segIndex:e,t:o.tA,point:o.point}):t.push({jumpEdgeId:n.id,otherEdgeId:r.id,segIndex:i,t:o.tB,point:o.point})}}}return t}e(d,`findEdgeIntersections`);function f(e){return`${Math.round(e*1e3)/1e3}`}e(f,`fmt`);function p(e){return`${f(e.x)},${f(e.y)}`}e(p,`pointToString`);function m(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(n)?+(t>=0):+(n>=0)}e(m,`getArcSweepFlag`);function h(e,n){if(e.length<2)return e.map(e=>({...e}));let r=e.map(e=>({...e})),i=n.arrowTypeStart&&t[n.arrowTypeStart];if(i){let t=e[0],n=e[1],a=Math.atan2(n.y-t.y,n.x-t.x);r[0].x=t.x+i*Math.cos(a),r[0].y=t.y+i*Math.sin(a)}let a=n.arrowTypeEnd&&t[n.arrowTypeEnd];if(a){let t=e.length,n=e[t-2],i=e[t-1],o=Math.atan2(i.y-n.y,i.x-n.x);r[t-1].x=i.x-a*Math.cos(o),r[t-1].y=i.y-a*Math.sin(o)}return r}e(h,`applyMarkerOffsets`);function g(e,t,n,r,i){let a=e.point.x,o=e.point.y,s={x:a-t*e.r,y:o-n*e.r},c={x:a+t*e.r,y:o+n*e.r},l=[`L${p(s)}`];return i===`arc`?l.push(`A${f(e.r)},${f(e.r)} 0 0 ${r} ${p(c)}`):l.push(`M${p(c)}`),l}e(g,`emitJump`);function _(e,t,n,i){let a=t.x-e.x,o=t.y-e.y,s=n.x-t.x,c=n.y-t.y,l=Math.hypot(a,o),u=Math.hypot(s,c);if(l<r||u<r)return null;let d=a/l,f=o/l,p=s/u,m=c/u,h=d*p+f*m,g=Math.acos(Math.max(-1,Math.min(1,h)));if(g<r||Math.abs(Math.PI-g)<r)return null;let _=Math.min(i/Math.sin(g/2),l/2,u/2);return{startX:t.x-d*_,startY:t.y-f*_,endX:t.x+p*_,endY:t.y+m*_,ctrlX:t.x,ctrlY:t.y,cutLen:_}}e(_,`computeRoundedCorner`);function v(e,t,r){let o=e.points;if(o.length<2)return``;let c=h(o,e),l=e.curve===`rounded`,u=s(c),d=new Map;for(let e of t){let t=u[e.segIndex];if(!t)continue;let n=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),i=d.get(e.segIndex)??[];i.push({t:e.t,point:e.point,d:e.t*n,r:r.jumpRadius}),d.set(e.segIndex,i)}let v=[`M${p(c[0])}`];for(let e=0;e<u.length;e++){let t=u[e],o=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),s=o===0?0:(t.b.x-t.a.x)/o,h=o===0?0:(t.b.y-t.a.y)/o,y=m(t),b=0;if(l&&e>0){let t=_(c[e-1],c[e],c[e+1]??c[e],n);t&&(b=t.cutLen)}let x=o,S=null;l&&e<u.length-1&&(S=_(c[e],c[e+1],c[e+2]??c[e+1],n),S&&(x=o-S.cutLen));let C=r.jumpRadius*a,w=[...d.get(e)??[]].sort((e,t)=>e.t-t.t).filter(e=>{let t=Math.min(e.d-b,x-e.d)-i;return e.r=Math.min(e.r,t),e.r>=C});for(let e=0;e<w.length-1;e++){let t=w[e+1].d-w[e].d;if(w[e].r+w[e+1].r>t){let n=t/2;w[e].r=Math.min(w[e].r,n),w[e+1].r=Math.min(w[e+1].r,n)}}for(let e of w)e.r<C||v.push(...g(e,s,h,y,r.jumpStyle));l&&S?(v.push(`L${f(S.startX)},${f(S.startY)}`),v.push(`Q${f(S.ctrlX)},${f(S.ctrlY)} ${f(S.endX)},${f(S.endY)}`)):v.push(`L${p(t.b)}`)}return v.join(` `)}e(v,`rewriteEdgePath`);function y(e){return/^[\d\s+,.LMelm-]*$/.test(e)}e(y,`isStraightPath`);function b(e){return!e||e===`linear`||e===`rounded`||e===`step`||e===`stepBefore`||e===`stepAfter`}e(b,`curveSupportsLineHops`);function x(e){if(!e)return null;try{let t=typeof atob==`function`?atob(e):Buffer.from(e,`base64`).toString(),n=JSON.parse(t);if(!Array.isArray(n))return null;let r=[];for(let e of n)e&&typeof e.x==`number`&&typeof e.y==`number`&&r.push({x:e.x,y:e.y});return r.length>=2?r:null}catch{return null}}e(x,`decodeDataPoints`);function S(e,t,n){if(!n.enabled)return;let r=e.node();if(!r)return;let i=new Map;for(let e of t)i.set(e.id,e);let a=new Map;for(let e of r.querySelectorAll(`path[data-id]`)){let t=e.getAttribute(`data-id`);t!==null&&!a.has(t)&&a.set(t,e)}let o=[];for(let e of t){let t=a.get(e.id);if(!t)continue;let n=x(t.getAttribute(`data-points`))??e.points;o.push({...e,points:n})}let s=d(o);if(s.length===0)return;let c=new Map;for(let e of s){let t=c.get(e.jumpEdgeId)??[];t.push(e),c.set(e.jumpEdgeId,t)}for(let e of o){let t=c.get(e.id);if(!t||t.length===0)continue;let r=i.get(e.id)?.curve;if(r!==void 0&&!b(r))continue;let o=a.get(e.id);if(!o||r===void 0&&!y(o.getAttribute(`d`)??``))continue;let s=o.getAttribute(`style`)??``,l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s),u=l?Number.parseFloat(l[1]):null,d=l?Number.parseFloat(l[2]):null,f=v(e,t,n);if(o.setAttribute(`d`,f),u!==null&&d!==null&&typeof o.getTotalLength==`function`){let e=o.getTotalLength(),t=`0 ${u} ${Math.max(0,e-u-d)} ${d}`,n=s.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${t};`).replace(/;\s*;+/g,`;`);o.setAttribute(`style`,n)}}}e(S,`applyLineJumpsToSvg`);export{S as t};
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{o as t}from"./chunk-2BW5OAIV-BIIX2R6x.js";var n=5,r=1e-5,i=2,a=.6,o=1e-6;function s(e){let t=[];for(let n=0;n<e.length-1;n++)t.push({a:e[n],b:e[n+1]});return t}e(s,`buildSegmentList`);function c(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,s=r.x-n.x,c=r.y-n.y,l=i*c-a*s;if(l===0)return null;let u=n.x-e.x,d=n.y-e.y,f=(u*c-d*s)/l,p=(u*a-d*i)/l;return f<=o||f>=1-o||p<=o||p>=1-o?null:{point:{x:e.x+f*i,y:e.y+f*a},tA:f,tB:p}}e(c,`segmentIntersection`);function l(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}e(l,`isHorizontalSeg`);function u(e,t,r){if(e.curve!==`rounded`)return!1;let i=e.points,a=i[t],o=i[t+1];if(!a||!o)return!1;let s=Math.hypot(o.x-a.x,o.y-a.y),c=r*s,l=t>0?_(i[t-1],a,o,n):null;if(l&&c<l.cutLen)return!0;let u=t+2<i.length?_(a,o,i[t+2],n):null;return u!==null&&s-c<u.cutLen}e(u,`crossingSitsInRoundedCorner`);function d(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=s(r.points);for(let a=n+1;a<e.length;a++){let n=e[a],o=s(n.points);for(let[e,a]of i.entries())for(let[i,s]of o.entries()){let o=c(a.a,a.b,s.a,s.b);if(!o||u(r,e,o.tA)||u(n,i,o.tB))continue;let d=l(a);d!==l(s)&&d?t.push({jumpEdgeId:r.id,otherEdgeId:n.id,segIndex:e,t:o.tA,point:o.point}):t.push({jumpEdgeId:n.id,otherEdgeId:r.id,segIndex:i,t:o.tB,point:o.point})}}}return t}e(d,`findEdgeIntersections`);function f(e){return`${Math.round(e*1e3)/1e3}`}e(f,`fmt`);function p(e){return`${f(e.x)},${f(e.y)}`}e(p,`pointToString`);function m(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(n)?+(t>=0):+(n>=0)}e(m,`getArcSweepFlag`);function h(e,n){if(e.length<2)return e.map(e=>({...e}));let r=e.map(e=>({...e})),i=n.arrowTypeStart&&t[n.arrowTypeStart];if(i){let t=e[0],n=e[1],a=Math.atan2(n.y-t.y,n.x-t.x);r[0].x=t.x+i*Math.cos(a),r[0].y=t.y+i*Math.sin(a)}let a=n.arrowTypeEnd&&t[n.arrowTypeEnd];if(a){let t=e.length,n=e[t-2],i=e[t-1],o=Math.atan2(i.y-n.y,i.x-n.x);r[t-1].x=i.x-a*Math.cos(o),r[t-1].y=i.y-a*Math.sin(o)}return r}e(h,`applyMarkerOffsets`);function g(e,t,n,r,i){let a=e.point.x,o=e.point.y,s={x:a-t*e.r,y:o-n*e.r},c={x:a+t*e.r,y:o+n*e.r},l=[`L${p(s)}`];return i===`arc`?l.push(`A${f(e.r)},${f(e.r)} 0 0 ${r} ${p(c)}`):l.push(`M${p(c)}`),l}e(g,`emitJump`);function _(e,t,n,i){let a=t.x-e.x,o=t.y-e.y,s=n.x-t.x,c=n.y-t.y,l=Math.hypot(a,o),u=Math.hypot(s,c);if(l<r||u<r)return null;let d=a/l,f=o/l,p=s/u,m=c/u,h=d*p+f*m,g=Math.acos(Math.max(-1,Math.min(1,h)));if(g<r||Math.abs(Math.PI-g)<r)return null;let _=Math.min(i/Math.sin(g/2),l/2,u/2);return{startX:t.x-d*_,startY:t.y-f*_,endX:t.x+p*_,endY:t.y+m*_,ctrlX:t.x,ctrlY:t.y,cutLen:_}}e(_,`computeRoundedCorner`);function v(e,t,r){let o=e.points;if(o.length<2)return``;let c=h(o,e),l=e.curve===`rounded`,u=s(c),d=new Map;for(let e of t){let t=u[e.segIndex];if(!t)continue;let n=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),i=d.get(e.segIndex)??[];i.push({t:e.t,point:e.point,d:e.t*n,r:r.jumpRadius}),d.set(e.segIndex,i)}let v=[`M${p(c[0])}`];for(let e=0;e<u.length;e++){let t=u[e],o=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),s=o===0?0:(t.b.x-t.a.x)/o,h=o===0?0:(t.b.y-t.a.y)/o,y=m(t),b=0;if(l&&e>0){let t=_(c[e-1],c[e],c[e+1]??c[e],n);t&&(b=t.cutLen)}let x=o,S=null;l&&e<u.length-1&&(S=_(c[e],c[e+1],c[e+2]??c[e+1],n),S&&(x=o-S.cutLen));let C=r.jumpRadius*a,w=[...d.get(e)??[]].sort((e,t)=>e.t-t.t).filter(e=>{let t=Math.min(e.d-b,x-e.d)-i;return e.r=Math.min(e.r,t),e.r>=C});for(let e=0;e<w.length-1;e++){let t=w[e+1].d-w[e].d;if(w[e].r+w[e+1].r>t){let n=t/2;w[e].r=Math.min(w[e].r,n),w[e+1].r=Math.min(w[e+1].r,n)}}for(let e of w)e.r<C||v.push(...g(e,s,h,y,r.jumpStyle));l&&S?(v.push(`L${f(S.startX)},${f(S.startY)}`),v.push(`Q${f(S.ctrlX)},${f(S.ctrlY)} ${f(S.endX)},${f(S.endY)}`)):v.push(`L${p(t.b)}`)}return v.join(` `)}e(v,`rewriteEdgePath`);function y(e){return/^[\d\s+,.LMelm-]*$/.test(e)}e(y,`isStraightPath`);function b(e){return!e||e===`linear`||e===`rounded`||e===`step`||e===`stepBefore`||e===`stepAfter`}e(b,`curveSupportsLineHops`);function x(e){if(!e)return null;try{let t=typeof atob==`function`?atob(e):Buffer.from(e,`base64`).toString(),n=JSON.parse(t);if(!Array.isArray(n))return null;let r=[];for(let e of n)e&&typeof e.x==`number`&&typeof e.y==`number`&&r.push({x:e.x,y:e.y});return r.length>=2?r:null}catch{return null}}e(x,`decodeDataPoints`);function S(e,t,n){if(!n.enabled)return;let r=e.node();if(!r)return;let i=new Map;for(let e of t)i.set(e.id,e);let a=new Map;for(let e of r.querySelectorAll(`path[data-id]`)){let t=e.getAttribute(`data-id`);t!==null&&!a.has(t)&&a.set(t,e)}let o=[];for(let e of t){let t=a.get(e.id);if(!t)continue;let n=x(t.getAttribute(`data-points`))??e.points;o.push({...e,points:n})}let s=d(o);if(s.length===0)return;let c=new Map;for(let e of s){let t=c.get(e.jumpEdgeId)??[];t.push(e),c.set(e.jumpEdgeId,t)}for(let e of o){let t=c.get(e.id);if(!t||t.length===0)continue;let r=i.get(e.id)?.curve;if(r!==void 0&&!b(r))continue;let o=a.get(e.id);if(!o||r===void 0&&!y(o.getAttribute(`d`)??``))continue;let s=o.getAttribute(`style`)??``,l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s),u=l?Number.parseFloat(l[1]):null,d=l?Number.parseFloat(l[2]):null,f=v(e,t,n);if(o.setAttribute(`d`,f),u!==null&&d!==null&&typeof o.getTotalLength==`function`){let e=o.getTotalLength(),t=`0 ${u} ${Math.max(0,e-u-d)} ${d}`,n=s.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${t};`).replace(/;\s*;+/g,`;`);o.setAttribute(`style`,n)}}}e(S,`applyLineJumpsToSvg`);export{S as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{c as n}from"./chunk-VPRB5NB3-BneD2tFR.js";var r=e((e,r,o,s)=>{e.attr(`class`,o);let{width:c,height:l,x:u,y:d}=i(e,r);n(e,l,c,s);let f=a(u,d,c,l,r);e.attr(`viewBox`,f),t.debug(`viewBox configured: ${f} with padding: ${r}`)},`setupViewPortForSVG`),i=e((e,t)=>{let n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+t*2,height:n.height+t*2,x:n.x,y:n.y}},`calculateDimensionsWithPadding`),a=e((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,`createViewBox`);export{r as t};
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{c as n}from"./chunk-VPRB5NB3-CCVn2tFZ.js";var r=e((e,r,o,s)=>{e.attr(`class`,o);let{width:c,height:l,x:u,y:d}=i(e,r);n(e,l,c,s);let f=a(u,d,c,l,r);e.attr(`viewBox`,f),t.debug(`viewBox configured: ${f} with padding: ${r}`)},`setupViewPortForSVG`),i=e((e,t)=>{let n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+t*2,height:n.height+t*2,x:n.x,y:n.y}},`calculateDimensionsWithPadding`),a=e((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,`createViewBox`);export{r as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{b as r,g as i,w as a}from"./chunk-VPRB5NB3-BneD2tFR.js";import{n as o}from"./chunk-E2ZNV5FY-CYbRGGQf.js";import{a as s,i as c,t as l}from"./chunk-4EA7E6EY-CKvXXyhx.js";import{s as u}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{t as d}from"./rough.esm-Dy-Kn_BL.js";import{i as f,n as p,t as m}from"./chunk-XC4XBNZT-BfvNm2P2.js";import{n as h}from"./chunk-DBDB3WZW-DYwidElu.js";var g=e(async(e,a)=>{let l=r(),{theme:p,themeVariables:m,handDrawnSeed:h}=l,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=m,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=c(a),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(a.cssClasses||``)).attr(`id`,a.id).attr(`data-id`,a.id).attr(`data-et`,`cluster`).attr(`data-look`,a.look);u(w,a.colorIndex,p,v);let T=i(l.flowchart.htmlLabels),E=a.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await o(D,a.label,{style:a.labelStyle,useHtmlLabels:T,isNode:!0,width:a.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=a.padding??0,j=a.width<=k.width+A?k.width+A:a.width;a.diff=a.width<=k.width+A?(j-a.width)/2-A:-A;let M=a.height,N=a.y-M/2,P=a.y+M/2,F=a.x-j/2,I=a.swimlaneContentTop===void 0?N+M/3:a.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(a.look===`handDrawn`){let r=d.svg(w),i=s(a,{roughness:.7,fill:g,stroke:y,seed:h}),o=s(a,{roughness:.7,fill:`none`,stroke:y,seed:h}),c=r.rectangle(F,N,e,M,i);z=w.insert(()=>c,`:first-child`).attr(`class`,`swimlane-title`);let l=r.rectangle(t,N,n,M,o);B=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let r=F+e/2,i=a.y;D.attr(`transform`,`translate(${r}, ${i}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,r=Math.max(0,P-n),i=a.x-j/2;if(a.look===`handDrawn`){let e=d.svg(w),o=s(a,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:h}),c=s(a,{roughness:.7,fill:`none`,stroke:y,seed:h}),l=e.rectangle(i,N,j,t,o);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=e.rectangle(i,n,j,r,c);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,i).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,i).attr(`y`,n).attr(`width`,j).attr(`height`,r).attr(`fill`,`none`).attr(`stroke`,y);let o=a.x-k.width/2,c=N+(t-k.height)/2;D.attr(`transform`,`translate(${o}, ${c})`)}if(t.trace(`Swimlane data `,a,JSON.stringify(a)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return a.offsetX=0,a.width=j,a.height=M,a.offsetY=k.height-A/2,a.intersect=function(e){return f(a,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=r(),{theme:g,themeVariables:_,handDrawnSeed:v}=l,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=c(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);u(E,i.colorIndex,g,x);let D=a(l),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await o(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await m(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(a(l)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=d.svg(E),n=s(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=h(l);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return f(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=r(),{theme:o,themeVariables:s,handDrawnSeed:c}=i,{altBackground:l,borderColorArray:h,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=s,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);u(y,t.colorIndex,o,h);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await m(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(a(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=d.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:c}):n.rectangle(A,j,D,O,{seed:c});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?l:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:c});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(a(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return f(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=r(),{themeVariables:u,handDrawnSeed:m}=l,{clusterBkg:g,clusterBorder:_}=u,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=c(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=a(l),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await o(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(a(l)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=d.svg(S),n=s(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:m}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=h(l);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:i,handDrawnSeed:a}=r(),{altBackground:o,nodeBorder:s,borderColorArray:c}=i,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);u(l,t.colorIndex,n,c);let p=l.insert(`g`,`:first-child`),m=0*t.padding,h=t.width+m;t.diff=-t.padding;let g=t.height+m,_=t.x-h/2,v=t.y-g/2;t.width=h;let y;if(t.look===`handDrawn`){let e=d.svg(l).rectangle(_,v,h,g,{fill:o??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:s,seed:a});y=l.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=p.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return f(t,e)},{cluster:l,labelBBox:{}}},`divider`),S=e(async(e,i,l)=>{t.info(`Creating ${l.cssClass} for `,i.id,i);let g=r(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=c(i),C=e.insert(`g`).attr(`class`,`cluster `+l.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);u(C,i.colorIndex,_,b);let w=a(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await o(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await m(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=d.svg(C),t=s(i,{roughness:l.roughness,fill:l.fill,stroke:l.stroke,strokeWidth:l.strokeWidth,seed:y,...l.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...l.strokeDash?{strokeLineDash:l.strokeDash}:{}}),n=e.path(p(A,j,O,k,l.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,l.rx).attr(`ry`,l.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,l.fill).attr(`stroke`,l.stroke).attr(`stroke-width`,l.strokeWidth+`px`),l.strokeDash&&M.attr(`stroke-dasharray`,l.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=h(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=r();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let p=r(),{theme:m,themeVariables:g,handDrawnSeed:_}=p,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=c(i),{stylesMap:C}=l(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);u(E,i.colorIndex,m,b);let D=a(p),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await o(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=s(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=d.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=h(p);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t};
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{b as r,g as i,w as a}from"./chunk-VPRB5NB3-CCVn2tFZ.js";import{n as o}from"./chunk-E2ZNV5FY-k59zNMXy.js";import{a as s,i as c,t as l}from"./chunk-4EA7E6EY-yvJMWemR.js";import{s as u}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{t as d}from"./rough.esm-Dy-Kn_BL.js";import{i as f,n as p,t as m}from"./chunk-XC4XBNZT-DjwT4Fb8.js";import{n as h}from"./chunk-DBDB3WZW-BIeIRFel.js";var g=e(async(e,a)=>{let l=r(),{theme:p,themeVariables:m,handDrawnSeed:h}=l,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=m,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=c(a),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(a.cssClasses||``)).attr(`id`,a.id).attr(`data-id`,a.id).attr(`data-et`,`cluster`).attr(`data-look`,a.look);u(w,a.colorIndex,p,v);let T=i(l.flowchart.htmlLabels),E=a.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await o(D,a.label,{style:a.labelStyle,useHtmlLabels:T,isNode:!0,width:a.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=a.padding??0,j=a.width<=k.width+A?k.width+A:a.width;a.diff=a.width<=k.width+A?(j-a.width)/2-A:-A;let M=a.height,N=a.y-M/2,P=a.y+M/2,F=a.x-j/2,I=a.swimlaneContentTop===void 0?N+M/3:a.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(a.look===`handDrawn`){let r=d.svg(w),i=s(a,{roughness:.7,fill:g,stroke:y,seed:h}),o=s(a,{roughness:.7,fill:`none`,stroke:y,seed:h}),c=r.rectangle(F,N,e,M,i);z=w.insert(()=>c,`:first-child`).attr(`class`,`swimlane-title`);let l=r.rectangle(t,N,n,M,o);B=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let r=F+e/2,i=a.y;D.attr(`transform`,`translate(${r}, ${i}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,r=Math.max(0,P-n),i=a.x-j/2;if(a.look===`handDrawn`){let e=d.svg(w),o=s(a,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:h}),c=s(a,{roughness:.7,fill:`none`,stroke:y,seed:h}),l=e.rectangle(i,N,j,t,o);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=e.rectangle(i,n,j,r,c);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,i).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,i).attr(`y`,n).attr(`width`,j).attr(`height`,r).attr(`fill`,`none`).attr(`stroke`,y);let o=a.x-k.width/2,c=N+(t-k.height)/2;D.attr(`transform`,`translate(${o}, ${c})`)}if(t.trace(`Swimlane data `,a,JSON.stringify(a)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return a.offsetX=0,a.width=j,a.height=M,a.offsetY=k.height-A/2,a.intersect=function(e){return f(a,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=r(),{theme:g,themeVariables:_,handDrawnSeed:v}=l,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=c(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);u(E,i.colorIndex,g,x);let D=a(l),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await o(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await m(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(a(l)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=d.svg(E),n=s(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=h(l);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return f(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=r(),{theme:o,themeVariables:s,handDrawnSeed:c}=i,{altBackground:l,borderColorArray:h,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=s,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);u(y,t.colorIndex,o,h);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await m(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(a(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=d.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:c}):n.rectangle(A,j,D,O,{seed:c});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?l:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:c});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(a(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return f(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=r(),{themeVariables:u,handDrawnSeed:m}=l,{clusterBkg:g,clusterBorder:_}=u,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=c(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=a(l),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await o(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(a(l)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=d.svg(S),n=s(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:m}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=h(l);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:i,handDrawnSeed:a}=r(),{altBackground:o,nodeBorder:s,borderColorArray:c}=i,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);u(l,t.colorIndex,n,c);let p=l.insert(`g`,`:first-child`),m=0*t.padding,h=t.width+m;t.diff=-t.padding;let g=t.height+m,_=t.x-h/2,v=t.y-g/2;t.width=h;let y;if(t.look===`handDrawn`){let e=d.svg(l).rectangle(_,v,h,g,{fill:o??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:s,seed:a});y=l.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=p.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return f(t,e)},{cluster:l,labelBBox:{}}},`divider`),S=e(async(e,i,l)=>{t.info(`Creating ${l.cssClass} for `,i.id,i);let g=r(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=c(i),C=e.insert(`g`).attr(`class`,`cluster `+l.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);u(C,i.colorIndex,_,b);let w=a(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await o(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await m(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=d.svg(C),t=s(i,{roughness:l.roughness,fill:l.fill,stroke:l.stroke,strokeWidth:l.strokeWidth,seed:y,...l.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...l.strokeDash?{strokeLineDash:l.strokeDash}:{}}),n=e.path(p(A,j,O,k,l.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,l.rx).attr(`ry`,l.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,l.fill).attr(`stroke`,l.stroke).attr(`stroke-width`,l.strokeWidth+`px`),l.strokeDash&&M.attr(`stroke-dasharray`,l.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=h(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=r();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let p=r(),{theme:m,themeVariables:g,handDrawnSeed:_}=p,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=c(i),{stylesMap:C}=l(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);u(E,i.colorIndex,m,b);let D=a(p),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await o(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=s(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=d.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=h(p);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t};
@@ -1,4 +1,4 @@
1
- import{w as e}from"./index-D8PP343M.js";import{n as t,t as n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{h as r,m as i}from"./src-oBChb5qS.js";var a={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{let t=e/255;return e>.03928?((t+.055)/1.055)**2.4:t/12.92},hue2rgb:(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return n*2.55;e/=360,t/=100,n/=100;let i=n<.5?n*(1+t):n+t-n*t,o=2*n-i;switch(r){case`r`:return a.hue2rgb(o,i,e+1/3)*255;case`g`:return a.hue2rgb(o,i,e)*255;case`b`:return a.hue2rgb(o,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255,t/=255,n/=255;let i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if(r===`l`)return o*100;if(i===a)return 0;let s=i-a,c=o>.5?s/(2-i-a):s/(i+a);if(r===`s`)return c*100;switch(i){case e:return((t-n)/s+(t<n?6:0))*60;case t:return((n-e)/s+2)*60;case n:return((e-t)/s+4)*60;default:return-1}}},o={channel:a,lang:{clamp:(e,t,n)=>t>n?Math.min(t,Math.max(n,e)):Math.min(n,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},unit:{dec2hex:e=>{let t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}}},s={};for(let e=0;e<=255;e++)s[e]=o.unit.dec2hex(e);var c={ALL:0,RGB:1,HSL:2},l=class{constructor(){this.type=c.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw Error(`Cannot change both RGB and HSL channels at the same time`);this.type=e}reset(){this.type=c.ALL}is(e){return this.type===e}},u=new class{constructor(e,t){this.color=t,this.changed=!1,this.data=e,this.type=new l}set(e,t){return this.color=t,this.changed=!1,this.data=e,this.type.type=c.ALL,this}_ensureHSL(){let e=this.data,{h:t,s:n,l:r}=e;t===void 0&&(e.h=o.channel.rgb2hsl(e,`h`)),n===void 0&&(e.s=o.channel.rgb2hsl(e,`s`)),r===void 0&&(e.l=o.channel.rgb2hsl(e,`l`))}_ensureRGB(){let e=this.data,{r:t,g:n,b:r}=e;t===void 0&&(e.r=o.channel.hsl2rgb(e,`r`)),n===void 0&&(e.g=o.channel.hsl2rgb(e,`g`)),r===void 0&&(e.b=o.channel.hsl2rgb(e,`b`))}get r(){let e=this.data,t=e.r;return!this.type.is(c.HSL)&&t!==void 0?t:(this._ensureHSL(),o.channel.hsl2rgb(e,`r`))}get g(){let e=this.data,t=e.g;return!this.type.is(c.HSL)&&t!==void 0?t:(this._ensureHSL(),o.channel.hsl2rgb(e,`g`))}get b(){let e=this.data,t=e.b;return!this.type.is(c.HSL)&&t!==void 0?t:(this._ensureHSL(),o.channel.hsl2rgb(e,`b`))}get h(){let e=this.data,t=e.h;return!this.type.is(c.RGB)&&t!==void 0?t:(this._ensureRGB(),o.channel.rgb2hsl(e,`h`))}get s(){let e=this.data,t=e.s;return!this.type.is(c.RGB)&&t!==void 0?t:(this._ensureRGB(),o.channel.rgb2hsl(e,`s`))}get l(){let e=this.data,t=e.l;return!this.type.is(c.RGB)&&t!==void 0?t:(this._ensureRGB(),o.channel.rgb2hsl(e,`l`))}get a(){return this.data.a}set r(e){this.type.set(c.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(c.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(c.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(c.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(c.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(c.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}({r:0,g:0,b:0,a:0},`transparent`),d={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;let t=e.match(d.re);if(!t)return;let n=t[1],r=parseInt(n,16),i=n.length,a=i%4==0,o=i>4,s=o?1:17,c=o?8:4,l=a?0:-1,f=o?255:15;return u.set({r:(r>>c*(l+3)&f)*s,g:(r>>c*(l+2)&f)*s,b:(r>>c*(l+1)&f)*s,a:a?(r&f)*s/255:1},e)},stringify:e=>{let{r:t,g:n,b:r,a:i}=e;return i<1?`#${s[Math.round(t)]}${s[Math.round(n)]}${s[Math.round(r)]}${s[Math.round(i*255)]}`:`#${s[Math.round(t)]}${s[Math.round(n)]}${s[Math.round(r)]}`}},f={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{let t=e.match(f.hueRe);if(t){let[,e,n]=t;switch(n){case`grad`:return o.channel.clamp.h(parseFloat(e)*.9);case`rad`:return o.channel.clamp.h(parseFloat(e)*180/Math.PI);case`turn`:return o.channel.clamp.h(parseFloat(e)*360)}}return o.channel.clamp.h(parseFloat(e))},parse:e=>{let t=e.charCodeAt(0);if(t!==104&&t!==72)return;let n=e.match(f.re);if(!n)return;let[,r,i,a,s,c]=n;return u.set({h:f._hue2deg(r),s:o.channel.clamp.s(parseFloat(i)),l:o.channel.clamp.l(parseFloat(a)),a:s?o.channel.clamp.a(c?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{let{h:t,s:n,l:r,a:i}=e;return i<1?`hsla(${o.lang.round(t)}, ${o.lang.round(n)}%, ${o.lang.round(r)}%, ${i})`:`hsl(${o.lang.round(t)}, ${o.lang.round(n)}%, ${o.lang.round(r)}%)`}},p={colors:{aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyanaqua:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,transparent:`#00000000`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},parse:e=>{e=e.toLowerCase();let t=p.colors[e];if(t)return d.parse(t)},stringify:e=>{let t=d.stringify(e);for(let e in p.colors)if(p.colors[e]===t)return e}},m={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{let t=e.charCodeAt(0);if(t!==114&&t!==82)return;let n=e.match(m.re);if(!n)return;let[,r,i,a,s,c,l,d,f]=n;return u.set({r:o.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:o.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:o.channel.clamp.b(l?parseFloat(c)*2.55:parseFloat(c)),a:d?o.channel.clamp.a(f?parseFloat(d)/100:parseFloat(d)):1},e)},stringify:e=>{let{r:t,g:n,b:r,a:i}=e;return i<1?`rgba(${o.lang.round(t)}, ${o.lang.round(n)}, ${o.lang.round(r)}, ${o.lang.round(i)})`:`rgb(${o.lang.round(t)}, ${o.lang.round(n)}, ${o.lang.round(r)})`}},h={format:{keyword:p,hex:d,rgb:m,rgba:m,hsl:f,hsla:f},parse:e=>{if(typeof e!=`string`)return e;let t=d.parse(e)||m.parse(e)||f.parse(e)||p.parse(e);if(t)return t;throw Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(c.HSL)||e.data.r===void 0?f.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?m.stringify(e):d.stringify(e)},g=(e,t)=>{let n=h.parse(e);for(let e in t)n[e]=o.channel.clamp[e](t[e]);return h.stringify(n)},_=(e,t,n=0,r=1)=>{if(typeof e!=`number`)return g(e,{a:t});let i=u.set({r:o.channel.clamp.r(e),g:o.channel.clamp.g(t),b:o.channel.clamp.b(n),a:o.channel.clamp.a(r)});return h.stringify(i)},ee=e=>{let{r:t,g:n,b:r}=h.parse(e),i=.2126*o.channel.toLinear(t)+.7152*o.channel.toLinear(n)+.0722*o.channel.toLinear(r);return o.lang.round(i)},te=e=>ee(e)>=.5,v=e=>!te(e),ne=(e,t,n)=>{let r=h.parse(e),i=r[t],a=o.channel.clamp[t](i+n);return i!==a&&(r[t]=a),h.stringify(r)},y=(e,t)=>ne(e,`l`,t),b=(e,t)=>ne(e,`l`,-t),x=(e,t)=>{let n=h.parse(e),r={};for(let e in t)t[e]&&(r[e]=n[e]+t[e]);return g(e,r)},S=(e,t,n=50)=>{let{r,g:i,b:a,a:o}=h.parse(e),{r:s,g:c,b:l,a:u}=h.parse(t),d=n/100,f=d*2-1,p=o-u,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,g=1-m;return _(r*m+s*g,i*m+c*g,a*m+l*g,o*d+u*(1-d))},C=(e,t=100)=>{let n=h.parse(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,S(n,e,t)};function re(e,t){this.v=e,this.k=t}function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ae(e){if(Array.isArray(e))return e}function oe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function se(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{w as e}from"./index-DXN0nanq.js";import{n as t,t as n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{h as r,m as i}from"./src-oBChb5qS.js";var a={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{let t=e/255;return e>.03928?((t+.055)/1.055)**2.4:t/12.92},hue2rgb:(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return n*2.55;e/=360,t/=100,n/=100;let i=n<.5?n*(1+t):n+t-n*t,o=2*n-i;switch(r){case`r`:return a.hue2rgb(o,i,e+1/3)*255;case`g`:return a.hue2rgb(o,i,e)*255;case`b`:return a.hue2rgb(o,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255,t/=255,n/=255;let i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if(r===`l`)return o*100;if(i===a)return 0;let s=i-a,c=o>.5?s/(2-i-a):s/(i+a);if(r===`s`)return c*100;switch(i){case e:return((t-n)/s+(t<n?6:0))*60;case t:return((n-e)/s+2)*60;case n:return((e-t)/s+4)*60;default:return-1}}},o={channel:a,lang:{clamp:(e,t,n)=>t>n?Math.min(t,Math.max(n,e)):Math.min(n,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},unit:{dec2hex:e=>{let t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}}},s={};for(let e=0;e<=255;e++)s[e]=o.unit.dec2hex(e);var c={ALL:0,RGB:1,HSL:2},l=class{constructor(){this.type=c.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw Error(`Cannot change both RGB and HSL channels at the same time`);this.type=e}reset(){this.type=c.ALL}is(e){return this.type===e}},u=new class{constructor(e,t){this.color=t,this.changed=!1,this.data=e,this.type=new l}set(e,t){return this.color=t,this.changed=!1,this.data=e,this.type.type=c.ALL,this}_ensureHSL(){let e=this.data,{h:t,s:n,l:r}=e;t===void 0&&(e.h=o.channel.rgb2hsl(e,`h`)),n===void 0&&(e.s=o.channel.rgb2hsl(e,`s`)),r===void 0&&(e.l=o.channel.rgb2hsl(e,`l`))}_ensureRGB(){let e=this.data,{r:t,g:n,b:r}=e;t===void 0&&(e.r=o.channel.hsl2rgb(e,`r`)),n===void 0&&(e.g=o.channel.hsl2rgb(e,`g`)),r===void 0&&(e.b=o.channel.hsl2rgb(e,`b`))}get r(){let e=this.data,t=e.r;return!this.type.is(c.HSL)&&t!==void 0?t:(this._ensureHSL(),o.channel.hsl2rgb(e,`r`))}get g(){let e=this.data,t=e.g;return!this.type.is(c.HSL)&&t!==void 0?t:(this._ensureHSL(),o.channel.hsl2rgb(e,`g`))}get b(){let e=this.data,t=e.b;return!this.type.is(c.HSL)&&t!==void 0?t:(this._ensureHSL(),o.channel.hsl2rgb(e,`b`))}get h(){let e=this.data,t=e.h;return!this.type.is(c.RGB)&&t!==void 0?t:(this._ensureRGB(),o.channel.rgb2hsl(e,`h`))}get s(){let e=this.data,t=e.s;return!this.type.is(c.RGB)&&t!==void 0?t:(this._ensureRGB(),o.channel.rgb2hsl(e,`s`))}get l(){let e=this.data,t=e.l;return!this.type.is(c.RGB)&&t!==void 0?t:(this._ensureRGB(),o.channel.rgb2hsl(e,`l`))}get a(){return this.data.a}set r(e){this.type.set(c.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(c.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(c.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(c.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(c.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(c.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}({r:0,g:0,b:0,a:0},`transparent`),d={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;let t=e.match(d.re);if(!t)return;let n=t[1],r=parseInt(n,16),i=n.length,a=i%4==0,o=i>4,s=o?1:17,c=o?8:4,l=a?0:-1,f=o?255:15;return u.set({r:(r>>c*(l+3)&f)*s,g:(r>>c*(l+2)&f)*s,b:(r>>c*(l+1)&f)*s,a:a?(r&f)*s/255:1},e)},stringify:e=>{let{r:t,g:n,b:r,a:i}=e;return i<1?`#${s[Math.round(t)]}${s[Math.round(n)]}${s[Math.round(r)]}${s[Math.round(i*255)]}`:`#${s[Math.round(t)]}${s[Math.round(n)]}${s[Math.round(r)]}`}},f={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{let t=e.match(f.hueRe);if(t){let[,e,n]=t;switch(n){case`grad`:return o.channel.clamp.h(parseFloat(e)*.9);case`rad`:return o.channel.clamp.h(parseFloat(e)*180/Math.PI);case`turn`:return o.channel.clamp.h(parseFloat(e)*360)}}return o.channel.clamp.h(parseFloat(e))},parse:e=>{let t=e.charCodeAt(0);if(t!==104&&t!==72)return;let n=e.match(f.re);if(!n)return;let[,r,i,a,s,c]=n;return u.set({h:f._hue2deg(r),s:o.channel.clamp.s(parseFloat(i)),l:o.channel.clamp.l(parseFloat(a)),a:s?o.channel.clamp.a(c?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{let{h:t,s:n,l:r,a:i}=e;return i<1?`hsla(${o.lang.round(t)}, ${o.lang.round(n)}%, ${o.lang.round(r)}%, ${i})`:`hsl(${o.lang.round(t)}, ${o.lang.round(n)}%, ${o.lang.round(r)}%)`}},p={colors:{aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyanaqua:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,transparent:`#00000000`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},parse:e=>{e=e.toLowerCase();let t=p.colors[e];if(t)return d.parse(t)},stringify:e=>{let t=d.stringify(e);for(let e in p.colors)if(p.colors[e]===t)return e}},m={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{let t=e.charCodeAt(0);if(t!==114&&t!==82)return;let n=e.match(m.re);if(!n)return;let[,r,i,a,s,c,l,d,f]=n;return u.set({r:o.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:o.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:o.channel.clamp.b(l?parseFloat(c)*2.55:parseFloat(c)),a:d?o.channel.clamp.a(f?parseFloat(d)/100:parseFloat(d)):1},e)},stringify:e=>{let{r:t,g:n,b:r,a:i}=e;return i<1?`rgba(${o.lang.round(t)}, ${o.lang.round(n)}, ${o.lang.round(r)}, ${o.lang.round(i)})`:`rgb(${o.lang.round(t)}, ${o.lang.round(n)}, ${o.lang.round(r)})`}},h={format:{keyword:p,hex:d,rgb:m,rgba:m,hsl:f,hsla:f},parse:e=>{if(typeof e!=`string`)return e;let t=d.parse(e)||m.parse(e)||f.parse(e)||p.parse(e);if(t)return t;throw Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(c.HSL)||e.data.r===void 0?f.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?m.stringify(e):d.stringify(e)},g=(e,t)=>{let n=h.parse(e);for(let e in t)n[e]=o.channel.clamp[e](t[e]);return h.stringify(n)},_=(e,t,n=0,r=1)=>{if(typeof e!=`number`)return g(e,{a:t});let i=u.set({r:o.channel.clamp.r(e),g:o.channel.clamp.g(t),b:o.channel.clamp.b(n),a:o.channel.clamp.a(r)});return h.stringify(i)},ee=e=>{let{r:t,g:n,b:r}=h.parse(e),i=.2126*o.channel.toLinear(t)+.7152*o.channel.toLinear(n)+.0722*o.channel.toLinear(r);return o.lang.round(i)},te=e=>ee(e)>=.5,v=e=>!te(e),ne=(e,t,n)=>{let r=h.parse(e),i=r[t],a=o.channel.clamp[t](i+n);return i!==a&&(r[t]=a),h.stringify(r)},y=(e,t)=>ne(e,`l`,t),b=(e,t)=>ne(e,`l`,-t),x=(e,t)=>{let n=h.parse(e),r={};for(let e in t)t[e]&&(r[e]=n[e]+t[e]);return g(e,r)},S=(e,t,n=50)=>{let{r,g:i,b:a,a:o}=h.parse(e),{r:s,g:c,b:l,a:u}=h.parse(t),d=n/100,f=d*2-1,p=o-u,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,g=1-m;return _(r*m+s*g,i*m+c*g,a*m+l*g,o*d+u*(1-d))},C=(e,t=100)=>{let n=h.parse(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,S(n,e,t)};function re(e,t){this.v=e,this.k=t}function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ae(e){if(Array.isArray(e))return e}function oe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function se(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ce(e,t){return ae(e)||oe(e,t)||le(e,t)||se()}function le(e,t){if(e){if(typeof e==`string`)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}function ue(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof re;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ue.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ue.prototype.next=function(e){return this._invoke(`next`,e)},ue.prototype.throw=function(e){return this._invoke(`throw`,e)},ue.prototype.return=function(e){return this._invoke(`return`,e)};var de=Object.entries,fe=Object.setPrototypeOf,pe=Object.isFrozen,me=Object.getPrototypeOf,he=Object.getOwnPropertyDescriptor,w=Object.freeze,T=Object.seal,ge=Object.create,_e=typeof Reflect<`u`&&Reflect,E=_e.apply,ve=_e.construct;w||=function(e){return e},T||=function(e){return e},E||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ve||=function(e){return new e(...[...arguments].slice(1))};var ye=k(Array.prototype.forEach);Array.prototype.indexOf;var be=k(Array.prototype.lastIndexOf),xe=k(Array.prototype.pop),Se=k(Array.prototype.push);Array.prototype.slice;var Ce=k(Array.prototype.splice),we=Array.isArray,Te=k(String.prototype.toLowerCase),Ee=k(String.prototype.toString),De=k(String.prototype.match),Oe=k(String.prototype.replace),ke=k(String.prototype.indexOf),Ae=k(String.prototype.trim),je=k(Number.prototype.toString),Me=k(Boolean.prototype.toString),Ne=typeof BigInt>`u`?null:k(BigInt.prototype.toString),Pe=typeof Symbol>`u`?null:k(Symbol.prototype.toString),D=k(Object.prototype.hasOwnProperty),Fe=k(Object.prototype.toString),O=k(RegExp.prototype.test),Ie=Le(TypeError);function k(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return E(e,t,n)}}function Le(e){return function(){return ve(e,[...arguments])}}function A(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te;if(fe&&fe(e,null),!we(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(pe(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Re(e){for(let t=0;t<e.length;t++)D(e,t)||(e[t]=null);return e}function j(e){let t=ge(null);for(let r of de(e)){var n=ce(r,2);let i=n[0],a=n[1];D(e,i)&&(t[i]=we(a)?Re(a):a&&typeof a==`object`&&a.constructor===Object?j(a):a)}return t}function ze(e){switch(typeof e){case`string`:return e;case`number`:return je(e);case`boolean`:return Me(e);case`bigint`:return Ne?Ne(e):`0`;case`symbol`:return Pe?Pe(e):`Symbol()`;case`undefined`:return Fe(e);case`function`:case`object`:{if(e===null)return Fe(e);let t=e,n=M(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Fe(e)}return Fe(e)}default:return Fe(e)}}function M(e,t){for(;e!==null;){let n=he(e,t);if(n){if(n.get)return k(n.get);if(typeof n.value==`function`)return k(n.value)}e=me(e)}function n(){return null}return n}function Be(e){try{return O(e,``),!0}catch{return!1}}var Ve=w(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),He=w(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ue=w([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),We=w([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ge=w(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ke=w([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),qe=w([`#text`]),Je=w(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ye=w(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Xe=w(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ze=w([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Qe=T(/{{[\w\W]*|^[\w\W]*}}/g),$e=T(/<%[\w\W]*|^[\w\W]*%>/g),et=T(/\${[\w\W]*/g),tt=T(/^data-[\-\w.\u00B7-\uFFFF]+$/),nt=T(/^aria-[\-\w]+$/),rt=T(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),it=T(/^(?:\w+script|data):/i),at=T(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ot=T(/^html$/i),st=T(/^[a-z][.\w]*(-[.\w]+)+$/i),ct=T(/<[/\w!]/g),lt=T(/<[/\w]/g),ut=T(/<\/no(script|embed|frames)/i),dt=T(/\/>/i),N={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},P=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],ft=w(A({},P)),pt=function(){let e={};return ye(P,t=>{e[t]=T(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),w(e)}(),mt=function(){return typeof window>`u`?null:window},ht=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},gt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_t=function(e,t,n,r){return D(e,t)&&we(e[t])?A(r.base?j(r.base):{},e[t],r.transform):n},vt=function(e,t,n){let r=D(e,t)?e[t]:void 0;return r&&typeof r==`object`?j(r):n()};function yt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mt(),t=e=>yt(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==N.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=M(d,`cloneNode`),p=M(d,`remove`),m=M(d,`removeAttributeNode`),h=M(d,`nextSibling`),g=M(d,`childNodes`),_=M(d,`parentNode`),ee=M(d,`shadowRoot`),te=M(d,`attributes`),v=o&&o.prototype?M(o.prototype,`nodeType`):null,ne=o&&o.prototype?M(o.prototype,`nodeName`):null,y=o&&o.prototype?M(o.prototype,`ownerDocument`):null,b=function(e){return v?v(e):e.nodeType},x=function(e){return ne?ne(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let S,C=``,re,ie=!1,ae=0,oe=function(){if(ae>0)throw Ie(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},se=function(e){oe(),ae++;try{return S.createHTML(e)}finally{ae--}},ce=function(e){oe(),ae++;try{return S.createScriptURL(e)}finally{ae--}},le=function(){return ie||=(re=ht(u,i),!0),re},ue=n,fe=ue.implementation,pe=ue.createNodeIterator,me=ue.createDocumentFragment,he=ue.getElementsByTagName,_e=r.importNode,E=gt();t.isSupported=typeof de==`function`&&typeof _==`function`&&fe&&fe.createHTMLDocument!==void 0;let ve=Qe,je=$e,Me=et,Ne=tt,Pe=nt,Fe=it,k=at,Le=st,Re=rt,P=null,bt=A({},[...Ve,...He,...Ue,...Ge,...qe]),F=null,xt=A({},[...Je,...Ye,...Xe,...Ze]),I=Object.seal(ge(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),St=null,Ct=null,L=Object.seal(ge(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),wt=!0,Tt=!0,Et=!1,Dt=!0,R=!1,Ot=!0,z=!1,B=!1,V=null,H=null,U=!1,kt=!1,W=!1,At=!1,jt=!0,Mt=!1,Nt=`user-content-`,Pt=!0,Ft=!1,It={},Lt=null,Rt=A({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),zt=null,Bt=A({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Vt=null,Ht=A({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ut=`http://www.w3.org/1998/Math/MathML`,Wt=`http://www.w3.org/2000/svg`,G=`http://www.w3.org/1999/xhtml`,Gt=G,Kt=!1,qt=null,Jt=A({},[Ut,Wt,G],Ee),Yt=w([`mi`,`mo`,`mn`,`ms`,`mtext`]),K=A({},Yt),q=w([`annotation-xml`]),Xt=A({},q),Zt=A({},[`title`,`style`,`font`,`a`,`script`]),Qt=null,$t=[`application/xhtml+xml`,`text/html`],J=null,en=null,tn=n.createElement(`form`),nn=function(e){return e instanceof RegExp||e instanceof Function},rn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(en&&en===e)return;(!e||typeof e!=`object`)&&(e={}),e=j(e),Qt=$t.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,J=Qt===`application/xhtml+xml`?Ee:Te,P=_t(e,`ALLOWED_TAGS`,bt,{transform:J}),F=_t(e,`ALLOWED_ATTR`,xt,{transform:J}),qt=_t(e,`ALLOWED_NAMESPACES`,Jt,{transform:Ee}),Vt=_t(e,`ADD_URI_SAFE_ATTR`,Ht,{transform:J,base:Ht}),zt=_t(e,`ADD_DATA_URI_TAGS`,Bt,{transform:J,base:Bt}),Lt=_t(e,`FORBID_CONTENTS`,Rt,{transform:J}),St=_t(e,`FORBID_TAGS`,j({}),{transform:J}),Ct=_t(e,`FORBID_ATTR`,j({}),{transform:J}),It=D(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?j(e.USE_PROFILES):e.USE_PROFILES:!1,wt=e.ALLOW_ARIA_ATTR!==!1,Tt=e.ALLOW_DATA_ATTR!==!1,Et=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,R=e.SAFE_FOR_TEMPLATES||!1,Ot=e.SAFE_FOR_XML!==!1,z=e.WHOLE_DOCUMENT||!1,kt=e.RETURN_DOM||!1,W=e.RETURN_DOM_FRAGMENT||!1,At=e.RETURN_TRUSTED_TYPE||!1,U=e.FORCE_BODY||!1,jt=e.SANITIZE_DOM!==!1,Mt=e.SANITIZE_NAMED_PROPS||!1,Pt=e.KEEP_CONTENT!==!1,Ft=e.IN_PLACE||!1,Re=Be(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:rt,Gt=typeof e.NAMESPACE==`string`?e.NAMESPACE:G,K=vt(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>A({},Yt)),Xt=vt(e,`HTML_INTEGRATION_POINTS`,()=>A({},q));let t=vt(e,`CUSTOM_ELEMENT_HANDLING`,()=>ge(null));if(I=ge(null),D(t,`tagNameCheck`)&&nn(t.tagNameCheck)&&(I.tagNameCheck=t.tagNameCheck),D(t,`attributeNameCheck`)&&nn(t.attributeNameCheck)&&(I.attributeNameCheck=t.attributeNameCheck),D(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(I.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),T(I),R&&(Tt=!1),W&&(kt=!0),It&&(P=A({},qe),F=ge(null),It.html===!0&&(A(P,Ve),A(F,Je)),It.svg===!0&&(A(P,He),A(F,Ye),A(F,Ze)),It.svgFilters===!0&&(A(P,Ue),A(F,Ye),A(F,Ze)),It.mathMl===!0&&(A(P,Ge),A(F,Xe),A(F,Ze))),L.tagCheck=null,L.attributeCheck=null,D(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?L.tagCheck=e.ADD_TAGS:we(e.ADD_TAGS)&&(P===bt&&(P=j(P)),A(P,e.ADD_TAGS,J))),D(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?L.attributeCheck=e.ADD_ATTR:we(e.ADD_ATTR)&&(F===xt&&(F=j(F)),A(F,e.ADD_ATTR,J))),D(e,`ADD_FORBID_CONTENTS`)&&we(e.ADD_FORBID_CONTENTS)&&(Lt===Rt&&(Lt=j(Lt)),A(Lt,e.ADD_FORBID_CONTENTS,J)),Pt&&(P[`#text`]=!0),z&&A(P,[`html`,`head`,`body`]),P.table&&(A(P,[`tbody`]),delete St.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Ie(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Ie(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=S;S=e.TRUSTED_TYPES_POLICY;try{C=se(``)}catch(e){throw S=t,e}}else e.TRUSTED_TYPES_POLICY===null?(S=void 0,C=``):(S===void 0&&(S=le()),S&&typeof C==`string`&&(C=se(``)));w&&w(e),en=e},an=A({},[...He,...Ue,...We]),on=A({},[...Ge,...Ke]),sn=function(e,t,n){return t.namespaceURI===G?e===`svg`:t.namespaceURI===Ut?e===`svg`&&(n===`annotation-xml`||K[n]):!!an[e]},cn=function(e,t,n){return t.namespaceURI===G?e===`math`:t.namespaceURI===Wt?e===`math`&&Xt[n]:!!on[e]},ln=function(e,t,n){return t.namespaceURI===Wt&&!Xt[n]||t.namespaceURI===Ut&&!K[n]?!1:!on[e]&&(Zt[e]||!an[e])},un=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Gt,tagName:`template`});let n=Te(e.tagName),r=Te(t.tagName);return qt[e.namespaceURI]?e.namespaceURI===Wt?sn(n,t,r):e.namespaceURI===Ut?cn(n,t,r):e.namespaceURI===G?ln(n,t,r):!!(Qt===`application/xhtml+xml`&&qt[e.namespaceURI]):!1},Y=function(e){Se(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Ie(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},X=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},dn=function(e){fn(e);let t=g(e);if(t){let e=[];ye(t,t=>{Se(e,t)}),ye(e,e=>{try{p(e)}catch{}})}let n=te(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&X(e,r,i)}},Z=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Se(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(kt||W)try{Y(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Q=function(e){let t=te(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||F[J(i)]||X(e,r,i)}},fn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();b(e)===N.element&&Q(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},pn=function(e,t){return Ot?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},mn=function(e){if(!Ot)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=b(e);if(n===N.processingInstruction||n===N.comment&&O(lt,e.data)){try{p(e)}catch{}continue}if(n===N.element){let t=e,n=J(x(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&pn(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},hn=function(e){let t=null,r=null;if(U)e=`<remove></remove>`+e;else{let t=De(e,/^[\r\n\t ]+/);r=t&&t[0]}Qt===`application/xhtml+xml`&&Gt===G&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=S?se(e):e;if(Gt===G)try{t=new l().parseFromString(i,Qt)}catch{}if(!t||!t.documentElement){t=fe.createDocument(Gt,`template`,null);try{t.documentElement.innerHTML=Kt?C:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Gt===G?he.call(t,z?`html`:`body`)[0]:z?t.documentElement:a},gn=function(e){let t=y?y(e):e.ownerDocument;return pe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},_n=function(e){return e=Oe(e,ve,` `),e=Oe(e,je,` `),e=Oe(e,Me,` `),e},vn=function(e){e.normalize();let t=y?y(e):e.ownerDocument,n=pe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=_n(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&ye(i,e=>{bn(e.content)&&vn(e.content)})},yn=function(e){let t=ne?ne(e):null;return typeof t!=`string`||J(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==te(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==v(e)||e.childNodes!==g(e)},bn=function(e){if(!v||typeof e!=`object`||!e)return!1;try{return v(e)===N.documentFragment}catch{return!1}},xn=function(e){if(!v||typeof e!=`object`||!e)return!1;try{return typeof v(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&ye(e,e=>{e.call(t,n,r,en)})}let Sn=function(e,t){return!!(Ot&&e.hasChildNodes()&&!xn(e.firstElementChild)&&O(ct,e.textContent)&&O(ct,e.innerHTML)||Ot&&e.namespaceURI===G&&ft[t]&&(xn(e.firstElementChild)||typeof e.textContent==`string`&&O(pt[t],e.textContent))||e.nodeType===N.processingInstruction||Ot&&e.nodeType===N.comment&&O(lt,e.data))},Cn=function(e,t){return e instanceof RegExp?O(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},wn=function(e,t,n){if(!St[t]&&An(t)&&Cn(I.tagNameCheck,t))return!1;if(Pt&&!Lt[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Y(e),!0},Tn=function(e,t,n,r){return e.length===0?t:t===n||t===r?j(t):t},En=function(e,t){return e===t||_(e)!==null?!1:(Ft&&fn(e),!0)},Dn=function(e,n){if($(E.beforeSanitizeElements,e,null),En(e,n))return!0;if(yn(e))return Y(e),!0;let r=J(x(e));if(P=Tn(E.uponSanitizeElement,P,bt,V),$(E.uponSanitizeElement,e,{tagName:r,allowedTags:P}),En(e,n))return!0;if(Sn(e,r))return Y(e),!0;if(St[r]||!(L.tagCheck instanceof Function&&L.tagCheck(r))&&!P[r]){let t=wn(e,r,n);return t===!1&&($(E.afterSanitizeElements,e,null),En(e,n))?!0:t}if(b(e)===N.element&&!un(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&O(ut,e.innerHTML))return Y(e),!0;if(R&&e.nodeType===N.text){let n=_n(e.textContent);e.textContent!==n&&(Se(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(E.afterSanitizeElements,e,null),En(e,n)},On=function(e,t,r){if(Ct[t]||pn(t,e)||jt&&(t===`id`||t===`name`)&&(r in n||r in tn))return!1;let i=F[t]||L.attributeCheck instanceof Function&&L.attributeCheck(t,e);return Tt&&O(Ne,t)||wt&&O(Pe,t)?!0:i?Vt[t]||O(Re,Oe(r,k,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ke(r,`data:`)===0&&zt[e]||Et&&!O(Fe,Oe(r,k,``))?!0:!r:An(e)&&Cn(I.tagNameCheck,e)&&Cn(I.attributeNameCheck,t,e)||t===`is`&&I.allowCustomizedBuiltInElements&&Cn(I.tagNameCheck,r)},kn=A({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[Te(e)]&&O(Le,e)},jn=function(e,t,n,r){if(S&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return se(r);case`TrustedScriptURL`:return ce(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!yn(e)||(Y(e),!1)}catch{return Z(t,e),!1}},Nn=function(e,n){if($(E.beforeSanitizeAttributes,e,null),En(e,n))return;let r=e.attributes;if(!r||yn(e))return;F=Tn(E.uponSanitizeAttribute,F,xt,H);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},a=r.length,o=J(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=J(s),d=l,f=s===`value`?d:Ae(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(E.uponSanitizeAttribute,e,i),f=i.attrValue,Mt&&(u===`id`||u===`name`)&&ke(f,Nt)!==0&&(Z(s,e,n),f=Nt+f,p=!0),Ot&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Z(s,e,n);continue}if(u===`attributename`&&De(f,`href`)){Z(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){Z(s,e,n);continue}if(!Dt&&O(dt,f)){Z(s,e,n);continue}if(R&&(f=_n(f)),!On(o,u,f)){Z(s,e,n);continue}f=jn(o,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&xe(t.removed)}}$(E.afterSanitizeAttributes,e,null),En(e,n)},Pn=function(e){let t=null,n=gn(e);for($(E.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(E.uponSanitizeShadowNode,t,null),Dn(t,e),Nn(t,e),bn(t.content)&&Pn(t.content),b(t)===N.element){let e=ee(t);bn(e)&&(Fn(e),Pn(e))}$(E.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=b(n)===N.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=ne?ne(n):null;if(typeof e==`string`&&J(e)===`template`){let e=n.content;bn(e)&&t.push({node:e,shadow:null})}}if(r){let e=ee(n);bn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Kt=!e,Kt&&(e=`<!-->`),typeof e!=`string`&&!xn(e)&&(e=ze(e),typeof e!=`string`))throw Ie(`dirty is not a string, aborting`);if(!t.isSupported)return e;B?(P=V,F=H):rn(n),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(P=j(P)),E.uponSanitizeAttribute.length>0&&(F=j(F)),t.removed=[];let c=Ft&&typeof e!=`string`&&xn(e);if(c){mn(e);let t=x(e);if(typeof t==`string`){let n=J(t);if(!P[n]||St[n])throw dn(e),Ie(`root node is forbidden and cannot be sanitized in-place`)}if(yn(e))throw dn(e),Ie(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw dn(e),t}}else if(xn(e))i=hn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===N.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!kt&&!R&&!z&&e.indexOf(`<`)===-1)return S&&At?se(e):e;if(i=hn(e),!i)return kt?null:At?C:``}i&&U&&Y(i.firstChild);let l=c?e:i;try{let e=gn(l);for(;o=e.nextNode();)Dn(o,l),Nn(o,l),bn(o.content)&&Pn(o.content)}catch(n){throw c&&(dn(e),ye(t.removed,e=>{e.element&&fn(e.element)})),n}if(c){let n=!1;if(ye(t.removed,t=>{t.element&&(t.element===e&&(n=!0),fn(t.element))}),n)throw Ie(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return R&&vn(e),e}if(kt){if(R&&vn(i),W)for(s=me.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(F.shadowroot||F.shadowrootmode)&&(s=_e.call(r,s,!0)),s}let u=z?i.outerHTML:i.innerHTML;return z&&P[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&O(ot,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
3
  `+u),R&&(u=_n(u)),S&&At?se(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rn(e),B=!0,V=P,H=F},t.clearConfig=function(){en=null,B=!1,V=null,H=null,S=re,C=``},t.isValidAttribute=function(e,t,n){en||rn({});let r=J(e),i=J(t);return On(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&D(E,e)&&Se(E[e],t)},t.removeHook=function(e,t){if(D(E,e)){if(t!==void 0){let n=be(E[e],t);return n===-1?void 0:Ce(E[e],n,1)[0]}return xe(E[e])}},t.removeHooks=function(e){D(E,e)&&(E[e]=[])},t.removeAllHooks=function(){E=gt()},t}var bt=yt(),F=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,xt=/\s/,I=t(e=>{let t=``,n=0,r=0;for(;r<e.length;){let i=e.indexOf(`%%`,r);if(i===-1)break;let a=e.indexOf(`
4
4
  `,i);if(a===-1)break;let o=i;for(;o>n&&xt.test(e[o-1]);)o--;t+=e.slice(n,o)+`
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{B as r,M as i,b as a,f as o,g as s,k as c,w as l,y as u,z as d}from"./chunk-VPRB5NB3-BneD2tFR.js";import{a as f,d as p,m,r as h}from"./chunk-3YJQHVM4-MV5Ex8sq.js";import{n as g,t as _}from"./chunk-HJ2JQQFS-D9pDNejT.js";import{n as v,r as y}from"./chunk-E2ZNV5FY-CYbRGGQf.js";import{a as b,i as x,r as S,t as C}from"./chunk-4EA7E6EY-CKvXXyhx.js";import{s as w}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{t as T}from"./rough.esm-Dy-Kn_BL.js";var E=1,D=3;async function O(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!k(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=a().fontSize?a().fontSize:window.getComputedStyle(document.body).fontSize,[n=o.fontSize]=m(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(O,`configureLabelImages`);function k(e){return e.nodeType===D?e.textContent?.trim()!==``:e.nodeType!==E||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(k)}e(k,`hasTextBesidesImages`);var A=3,j=32,M=e(async(e,t,r)=>{let i=a(),o=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,p(t.labelStyle)),c=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),l=t.width?Math.max(t.width-2*(t.padding??0),j):a().flowchart?.wrappingWidth??200,u=i.c4?.wrap??!0?l:1/0,m=await Promise.all(c.map(async e=>{let r=s.append(`g`).attr(`class`,e.cssClass),a=await v(r,d(f(e.text??``),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:u,style:t.labelStyle},i);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),h=Math.max(...m.map(({box:e})=>e.width),0),g=0;for(let{el:e,box:t}of m)e.attr(`transform`,`translate(${h/2-t.x-t.width/2}, ${g-t.y})`),g+=t.height+A;let _=m.length>0?g-A:0;return s.insert(`rect`,`:first-child`),s.attr(`transform`,`translate(${-h/2}, ${-_/2})`),{shapeSvg:o,bbox:s.node().getBBox(),halfPadding:(t.padding??0)/2,label:s}},`c4LabelHelper`),N=e((t,n)=>{let{x:r,y:i,width:a,height:o}=t;return a>=n?t:`left`in t?{x:r,y:i,width:n,height:o,top:i,left:r,bottom:i+o,right:r+n,toJSON:e(()=>({}),`toJSON`)}:{x:r-(n-a)/2,y:i,width:n,height:o}},`withMinWidth`),P=e(async(e,t,r)=>{if(t.stereotype!==void 0)return M(e,t,r);let i,o=t.useHtmlLabels||s(a()?.htmlLabels);i=r||`node default`;let c=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),l=c.insert(`g`).attr(`class`,`label`).attr(`style`,p(t.labelStyle)),u;u=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let m=!!t.icon||!!t.img,h=t.labelType===`markdown`,g=u&&!t.width?t.minWidth??0:0,_=await v(l,d(f(u),a()),{useHtmlLabels:o,width:t.width||t.wrappingWidth||a().flowchart?.wrappingWidth,minWidth:g,classes:h?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:m,markdown:h},a()),b=(t?.padding??0)/2,x;if(o){let e=_.children[0],t=n(_);await O(e),x=await y.measure(()=>e.getBoundingClientRect()),x=N(x,g),t.attr(`width`,x.width),t.attr(`height`,x.height)}else x=await y.measure(()=>_.getBBox()),x=N(x,g);return o?l.attr(`transform`,`translate(`+-x.width/2+`, `+-x.height/2+`)`):l.attr(`transform`,`translate(0, `+-x.height/2+`)`),t.centerLabel&&l.attr(`transform`,`translate(`+-x.width/2+`, `+-x.height/2+`)`),l.insert(`rect`,`:first-child`),{shapeSvg:c,bbox:x,halfPadding:b,label:l}},`labelHelper`),F=e(async(e,t,r)=>{let i=r.useHtmlLabels??l(a()),o=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await v(o,d(f(t),a()),{useHtmlLabels:i,width:r.width||a()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2,u;if(l(a())){let e=s.children[0],t=n(s);u=await y.measure(()=>e.getBoundingClientRect()),t.attr(`width`,u.width),t.attr(`height`,u.height)}else u=await y.measure(()=>s.getBBox());return i?o.attr(`transform`,`translate(`+-u.width/2+`, `+-u.height/2+`)`):o.attr(`transform`,`translate(0, `+-u.height/2+`)`),r.centerLabel&&o.attr(`transform`,`translate(`+-u.width/2+`, `+-u.height/2+`)`),o.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:u,halfPadding:c,label:o}},`insertLabel`),I=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),L=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function R(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(R,`createPathFromPoints`);function z(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(z,`generateFullSineWavePoints`);function B(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(B,`generateCirclePoints`);function ee(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var V=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function te(e,t){return e.intersect(t)}e(te,`intersectNode`);var H=te;function U(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(U,`intersectEllipse`);var ne=U;function re(e,t,n){return ne(e,t,t,n)}e(re,`intersectCircle`);var ie=re;function W(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,l=1e-6;if(s!==0&&c!==0&&G(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&G(p,m))return;let h=i*d-u*a;return h===0?void 0:{x:(a*f-d*o)/h,y:(u*o-i*f)/h}}}e(W,`intersectLine`);function G(e,t){return e*t>0}e(G,`sameSign`);var ae=W;function oe(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=ae(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(oe,`intersectPolygon`);var K={node:H,circle:ie,ellipse:ne,polygon:oe,rect:V},q=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),se=e(async(e,t,n,r=!1,i=!1)=>{let o=t||``;typeof o==`object`&&(o=o[0]);let s=a(),c=l(s);return await v(e,o,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function ce(e,n){let{labelStyles:r}=x(n);n.labelStyle=r;let i=L(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=T.svg(o),l=b(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,p(s)),I(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),K.circle(n,1,e)},o}e(ce,`anchor`);function le(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(le,`generateArcPoints`);function ue(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ue,`calculateArcSagitta`);async function de(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await P(t,n,L(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ue(f,p,m),g=(n?.width?n?.width:d.width)+o*2+h-h,_=f,{cssStyles:v}=n,y=[{x:g/2,y:-_/2},{x:-g/2,y:-_/2},...le(-g/2,-_/2,-g/2,_/2,p,m,!1),{x:g/2,y:_/2},...le(g/2,_/2,g/2,-_/2,p,m,!0)],S=T.svg(u),C=b(n,{});n.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=R(y),E=S.path(w,C),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),v&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,v),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${p/2}, 0)`),I(n,D),n.intersect=function(e){return K.polygon(n,y,e)},u}e(de,`bowTieRect`);async function fe(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(t,n,L(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,g=d*.72,_=[`M${-d/2},${m}`,`L${-g/2},${h}`,`A${g/2},${f} 0 0 0 ${g/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:v}=n,y=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=T.svg(o).path(_,b(n,{}));y.node()?.appendChild(e),v&&y.attr(`style`,v)}else y.append(`path`).attr(`d`,_).attr(`style`,a);y.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),I(n,y);let S=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${S-s.height/2-(s.y-(s.top??0))})`);let C=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),w=[...C(d/2,m,-1),...C(g/2,h,1).reverse()];return n.intersect=function(e){return K.polygon(n,w,e)},o}e(fe,`bucket`);var pe=20,me=8,he=80,ge=8;function _e(e){let{themeVariables:t}=a(),n=t.clusterBkg,r=t.clusterBorder;switch(e){case`flow`:return{rx:10,fill:`none`,stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:`flow-collapsed`};default:return{rx:ge,fill:n,stroke:r,cssClass:`collapsed-group`}}}e(_e,`getCollapsedStyle`);async function ve(e,t){let n=_e(t.metadata?.containerType),{fill:r,stroke:i}=n,{nodeStyles:o}=x(t),{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{theme:u,themeVariables:d}=a();w(s,t.colorIndex,u,d.borderColorArray);let f=t.padding??8,m=c.height,h=Math.max(c.width+f*2,he,t?.width??0),g=Math.max(m+me+pe+f*2,t?.height??0),_=-h/2,v=-g/2,y=-(me+pe)/2,S=s.select(`.label`);S&&(t.useHtmlLabels??l(a())?S.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+y})`):S.attr(`transform`,`translate(0, ${-c.height/2+y})`));let C;if(t.look===`handDrawn`){let e=T.svg(s),a=b(t,{fill:r,stroke:i,...n.strokeWidth===void 0?{}:{strokeWidth:n.strokeWidth},...r===`none`?{fillWeight:0}:{fillStyle:`solid`}}),o=e.path(q(_,v,h,g,n.rx),a);C=s.insert(()=>o,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,p(t.cssStyles))}else C=s.insert(`rect`,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,o).attr(`rx`,n.rx).attr(`ry`,n.rx).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`fill`,r).attr(`stroke`,i),n.strokeWidth!==void 0&&C.attr(`stroke-width`,n.strokeWidth+`px`);let E=v+f+m+me;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,_+8).attr(`y1`,E).attr(`x2`,_+h-8).attr(`y2`,E).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let D=E+pe/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,D).attr(`r`,2.5).attr(`fill`,i);return I(t,C),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},s}e(ve,`collapsedGroup`);function J(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(J,`insertPolygonShape`);var ye=[`right`,`left`,`up`,`down`],be=`point`,xe=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Se=e(e=>ye.filter(t=>e.has(t)).join(`|`)||be,`getDirectionKey`),Ce={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[be]:()=>[{x:0,y:0}]},we=e((e,t,n,r)=>{let i=xe(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(Ce[Se(i)]??Ce[be])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Te(e,t){let n=t,{shapeSvg:r,bbox:i}=await P(e,n,L(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=we(n.directions??[],i,n,u),f=J(r,u,o,d);return f.attr(`style`,n.style??null),I(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Te,`block_arrow`);async function Ee(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),b(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+9).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),I(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ee,`browser`);var De=12;async function Oe(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+De),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+De,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+De},{x:0+De,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(s,l,u,p);return r&&m.attr(`style`,r),I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},s}e(Oe,`card`);function ke(e,t){let{nodeStyles:n}=x(t);t.label=``;let r=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=T.svg(r),c=b(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=R(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(ke,`choice`);async function Ae(e,n,r){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await P(e,n,L(n)),l=r?.padding??c,u=Math.sqrt(s.width**2+s.height**2)/2,d=n.look===`neo`?u+32:u+l,f,{cssStyles:m}=n;if(n.look===`handDrawn`){let e=T.svg(o),t=b(n,{}),r=e.circle(0,0,d*2,t);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,p(m))}else f=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return I(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,d,e),K.circle(n,d,e)},o}e(Ae,`circle`);async function je(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await P(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),I(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(je,`composite`);async function Me(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),b(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),I(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Me,`consoleWindow`);function Ne(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{B as r,M as i,b as a,f as o,g as s,k as c,w as l,y as u,z as d}from"./chunk-VPRB5NB3-CCVn2tFZ.js";import{a as f,d as p,m,r as h}from"./chunk-3YJQHVM4-Dt99sj0b.js";import{n as g,t as _}from"./chunk-HJ2JQQFS-_yet-jCS.js";import{n as v,r as y}from"./chunk-E2ZNV5FY-k59zNMXy.js";import{a as b,i as x,r as S,t as C}from"./chunk-4EA7E6EY-yvJMWemR.js";import{s as w}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{t as T}from"./rough.esm-Dy-Kn_BL.js";var E=1,D=3;async function O(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!k(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=a().fontSize?a().fontSize:window.getComputedStyle(document.body).fontSize,[n=o.fontSize]=m(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(O,`configureLabelImages`);function k(e){return e.nodeType===D?e.textContent?.trim()!==``:e.nodeType!==E||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(k)}e(k,`hasTextBesidesImages`);var A=3,j=32,M=e(async(e,t,r)=>{let i=a(),o=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,p(t.labelStyle)),c=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),l=t.width?Math.max(t.width-2*(t.padding??0),j):a().flowchart?.wrappingWidth??200,u=i.c4?.wrap??!0?l:1/0,m=await Promise.all(c.map(async e=>{let r=s.append(`g`).attr(`class`,e.cssClass),a=await v(r,d(f(e.text??``),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:u,style:t.labelStyle},i);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),h=Math.max(...m.map(({box:e})=>e.width),0),g=0;for(let{el:e,box:t}of m)e.attr(`transform`,`translate(${h/2-t.x-t.width/2}, ${g-t.y})`),g+=t.height+A;let _=m.length>0?g-A:0;return s.insert(`rect`,`:first-child`),s.attr(`transform`,`translate(${-h/2}, ${-_/2})`),{shapeSvg:o,bbox:s.node().getBBox(),halfPadding:(t.padding??0)/2,label:s}},`c4LabelHelper`),N=e((t,n)=>{let{x:r,y:i,width:a,height:o}=t;return a>=n?t:`left`in t?{x:r,y:i,width:n,height:o,top:i,left:r,bottom:i+o,right:r+n,toJSON:e(()=>({}),`toJSON`)}:{x:r-(n-a)/2,y:i,width:n,height:o}},`withMinWidth`),P=e(async(e,t,r)=>{if(t.stereotype!==void 0)return M(e,t,r);let i,o=t.useHtmlLabels||s(a()?.htmlLabels);i=r||`node default`;let c=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),l=c.insert(`g`).attr(`class`,`label`).attr(`style`,p(t.labelStyle)),u;u=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let m=!!t.icon||!!t.img,h=t.labelType===`markdown`,g=u&&!t.width?t.minWidth??0:0,_=await v(l,d(f(u),a()),{useHtmlLabels:o,width:t.width||t.wrappingWidth||a().flowchart?.wrappingWidth,minWidth:g,classes:h?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:m,markdown:h},a()),b=(t?.padding??0)/2,x;if(o){let e=_.children[0],t=n(_);await O(e),x=await y.measure(()=>e.getBoundingClientRect()),x=N(x,g),t.attr(`width`,x.width),t.attr(`height`,x.height)}else x=await y.measure(()=>_.getBBox()),x=N(x,g);return o?l.attr(`transform`,`translate(`+-x.width/2+`, `+-x.height/2+`)`):l.attr(`transform`,`translate(0, `+-x.height/2+`)`),t.centerLabel&&l.attr(`transform`,`translate(`+-x.width/2+`, `+-x.height/2+`)`),l.insert(`rect`,`:first-child`),{shapeSvg:c,bbox:x,halfPadding:b,label:l}},`labelHelper`),F=e(async(e,t,r)=>{let i=r.useHtmlLabels??l(a()),o=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await v(o,d(f(t),a()),{useHtmlLabels:i,width:r.width||a()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2,u;if(l(a())){let e=s.children[0],t=n(s);u=await y.measure(()=>e.getBoundingClientRect()),t.attr(`width`,u.width),t.attr(`height`,u.height)}else u=await y.measure(()=>s.getBBox());return i?o.attr(`transform`,`translate(`+-u.width/2+`, `+-u.height/2+`)`):o.attr(`transform`,`translate(0, `+-u.height/2+`)`),r.centerLabel&&o.attr(`transform`,`translate(`+-u.width/2+`, `+-u.height/2+`)`),o.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:u,halfPadding:c,label:o}},`insertLabel`),I=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),L=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function R(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(R,`createPathFromPoints`);function z(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(z,`generateFullSineWavePoints`);function B(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(B,`generateCirclePoints`);function ee(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var V=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function te(e,t){return e.intersect(t)}e(te,`intersectNode`);var H=te;function U(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(U,`intersectEllipse`);var ne=U;function re(e,t,n){return ne(e,t,t,n)}e(re,`intersectCircle`);var ie=re;function W(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,l=1e-6;if(s!==0&&c!==0&&G(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&G(p,m))return;let h=i*d-u*a;return h===0?void 0:{x:(a*f-d*o)/h,y:(u*o-i*f)/h}}}e(W,`intersectLine`);function G(e,t){return e*t>0}e(G,`sameSign`);var ae=W;function oe(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=ae(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(oe,`intersectPolygon`);var K={node:H,circle:ie,ellipse:ne,polygon:oe,rect:V},q=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),se=e(async(e,t,n,r=!1,i=!1)=>{let o=t||``;typeof o==`object`&&(o=o[0]);let s=a(),c=l(s);return await v(e,o,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function ce(e,n){let{labelStyles:r}=x(n);n.labelStyle=r;let i=L(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=T.svg(o),l=b(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,p(s)),I(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),K.circle(n,1,e)},o}e(ce,`anchor`);function le(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(le,`generateArcPoints`);function ue(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ue,`calculateArcSagitta`);async function de(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await P(t,n,L(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ue(f,p,m),g=(n?.width?n?.width:d.width)+o*2+h-h,_=f,{cssStyles:v}=n,y=[{x:g/2,y:-_/2},{x:-g/2,y:-_/2},...le(-g/2,-_/2,-g/2,_/2,p,m,!1),{x:g/2,y:_/2},...le(g/2,_/2,g/2,-_/2,p,m,!0)],S=T.svg(u),C=b(n,{});n.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=R(y),E=S.path(w,C),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),v&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,v),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${p/2}, 0)`),I(n,D),n.intersect=function(e){return K.polygon(n,y,e)},u}e(de,`bowTieRect`);async function fe(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(t,n,L(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,g=d*.72,_=[`M${-d/2},${m}`,`L${-g/2},${h}`,`A${g/2},${f} 0 0 0 ${g/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:v}=n,y=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=T.svg(o).path(_,b(n,{}));y.node()?.appendChild(e),v&&y.attr(`style`,v)}else y.append(`path`).attr(`d`,_).attr(`style`,a);y.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),I(n,y);let S=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${S-s.height/2-(s.y-(s.top??0))})`);let C=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),w=[...C(d/2,m,-1),...C(g/2,h,1).reverse()];return n.intersect=function(e){return K.polygon(n,w,e)},o}e(fe,`bucket`);var pe=20,me=8,he=80,ge=8;function _e(e){let{themeVariables:t}=a(),n=t.clusterBkg,r=t.clusterBorder;switch(e){case`flow`:return{rx:10,fill:`none`,stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:`flow-collapsed`};default:return{rx:ge,fill:n,stroke:r,cssClass:`collapsed-group`}}}e(_e,`getCollapsedStyle`);async function ve(e,t){let n=_e(t.metadata?.containerType),{fill:r,stroke:i}=n,{nodeStyles:o}=x(t),{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{theme:u,themeVariables:d}=a();w(s,t.colorIndex,u,d.borderColorArray);let f=t.padding??8,m=c.height,h=Math.max(c.width+f*2,he,t?.width??0),g=Math.max(m+me+pe+f*2,t?.height??0),_=-h/2,v=-g/2,y=-(me+pe)/2,S=s.select(`.label`);S&&(t.useHtmlLabels??l(a())?S.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+y})`):S.attr(`transform`,`translate(0, ${-c.height/2+y})`));let C;if(t.look===`handDrawn`){let e=T.svg(s),a=b(t,{fill:r,stroke:i,...n.strokeWidth===void 0?{}:{strokeWidth:n.strokeWidth},...r===`none`?{fillWeight:0}:{fillStyle:`solid`}}),o=e.path(q(_,v,h,g,n.rx),a);C=s.insert(()=>o,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,p(t.cssStyles))}else C=s.insert(`rect`,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,o).attr(`rx`,n.rx).attr(`ry`,n.rx).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`fill`,r).attr(`stroke`,i),n.strokeWidth!==void 0&&C.attr(`stroke-width`,n.strokeWidth+`px`);let E=v+f+m+me;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,_+8).attr(`y1`,E).attr(`x2`,_+h-8).attr(`y2`,E).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let D=E+pe/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,D).attr(`r`,2.5).attr(`fill`,i);return I(t,C),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},s}e(ve,`collapsedGroup`);function J(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(J,`insertPolygonShape`);var ye=[`right`,`left`,`up`,`down`],be=`point`,xe=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Se=e(e=>ye.filter(t=>e.has(t)).join(`|`)||be,`getDirectionKey`),Ce={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[be]:()=>[{x:0,y:0}]},we=e((e,t,n,r)=>{let i=xe(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(Ce[Se(i)]??Ce[be])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Te(e,t){let n=t,{shapeSvg:r,bbox:i}=await P(e,n,L(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=we(n.directions??[],i,n,u),f=J(r,u,o,d);return f.attr(`style`,n.style??null),I(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Te,`block_arrow`);async function Ee(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),b(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+9).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),I(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ee,`browser`);var De=12;async function Oe(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+De),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+De,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+De},{x:0+De,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(s,l,u,p);return r&&m.attr(`style`,r),I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},s}e(Oe,`card`);function ke(e,t){let{nodeStyles:n}=x(t);t.label=``;let r=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=T.svg(r),c=b(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=R(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(ke,`choice`);async function Ae(e,n,r){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await P(e,n,L(n)),l=r?.padding??c,u=Math.sqrt(s.width**2+s.height**2)/2,d=n.look===`neo`?u+32:u+l,f,{cssStyles:m}=n;if(n.look===`handDrawn`){let e=T.svg(o),t=b(n,{}),r=e.circle(0,0,d*2,t);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,p(m))}else f=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return I(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,d,e),K.circle(n,d,e)},o}e(Ae,`circle`);async function je(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await P(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),I(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(je,`composite`);async function Me(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),b(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),I(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Me,`consoleWindow`);function Ne(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
2
2
  M ${i.x},${i.y} L ${o.x},${o.y}`}e(Ne,`createLine`);function Pe(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r,n.label=``;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=T.svg(a),l=b(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=Ne(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),I(n,p),n.intersect=function(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),K.circle(n,o,e)},a}e(Pe,`crossedCircle`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(Y,`generateCirclePoints`);async function Fe(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Y(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...Y(l/2+d*2,-d,d,20,-180,-270),...Y(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...Y(l/2,u/2,d,20,0,90)],m=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...Y(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...Y(l/2+l*.1,-d,d,20,-180,-270),...Y(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...Y(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],h=T.svg(i),g=b(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=R(p).replace(`Z`,``),v=h.path(_,g),y=R(m),S=h.path(y,{...g}),C=i.insert(`g`,`:first-child`);return C.insert(()=>S,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>v,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Fe,`curlyBraceLeft`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}e(X,`generateCirclePoints`);async function Ie(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...X(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...X(l/2,u/2,d,20,0,90)],m=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...X(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...X(l/2+d*2,-d,d,20,-180,-270),...X(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...X(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],h=T.svg(i),g=b(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=R(p).replace(`Z`,``),v=h.path(_,g),y=R(m),S=h.path(y,{...g}),C=i.insert(`g`,`:first-child`);return C.insert(()=>S,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>v,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Ie,`curlyBraceRight`);function Z(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(Z,`generateCirclePoints`);async function Le(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Z(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...Z(l/2+d*2,-d,d,20,-180,-270),...Z(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...Z(l/2,u/2,d,20,0,90)],m=[...Z(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...Z(-l/2-d/2,-d,d,20,0,90),...Z(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...Z(-l/2+d+d/2,u/2,d,30,-180,-270)],h=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...Z(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...Z(l/2+d*2,-d,d,20,-180,-270),...Z(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...Z(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...Z(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...Z(-l/2-d/2,-d,d,20,0,90),...Z(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...Z(-l/2+d+d/2,u/2,d,30,-180,-270)],g=T.svg(i),_=b(t,{fill:`none`});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=R(p).replace(`Z`,``),y=g.path(v,_),S=R(m).replace(`Z`,``),C=g.path(S,_),w=R(h),E=g.path(w,{..._}),D=i.insert(`g`,`:first-child`);return D.insert(()=>E,`:first-child`).attr(`stroke-opacity`,0),D.insert(()=>y,`:first-child`),D.insert(()=>C,`:first-child`),D.attr(`class`,`text`),f&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Le,`curlyBraces`);async function Re(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(5,c.height+o*2,t?.height??0),u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=Math.max(l/4,d),p=Math.max(20,c.width+a*2+f*2,(c.width+a*2)*1.25,t?.width??0),{cssStyles:m}=t,h=T.svg(s),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=p,v=l,y=_-u,S=v/4,C=[{x:y,y:0},{x:S,y:0},{x:0,y:v/2},{x:S,y:v},{x:y,y:v},...B(-y,-v/2,u,50,270,90)],w=R(C),E=h.path(w,g),D=s.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,r),D.attr(`transform`,`translate(${-p/2}, ${-l/2})`),I(t,D),t.intersect=function(e){return K.polygon(t,C,e)},s}e(Re,`curvedTrapezoid`);async function ze(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),f=Math.min(c*.177,d*.45),p=d+2*l-u,m=-p/2,h=m+2*l-u,g=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:_}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=e.path(q(-c/2,h,c,d,f),n),a=e.circle(0,m+l,l*2,n);g.insert(()=>a,`:first-child`),g.insert(()=>r,`:first-child`),_&&g.attr(`style`,_)}else g.append(`rect`).attr(`x`,-c/2).attr(`y`,h).attr(`width`,c).attr(`height`,d).attr(`rx`,f).attr(`ry`,f).attr(`style`,r),g.append(`circle`).attr(`cx`,0).attr(`cy`,m+l).attr(`r`,l).attr(`style`,r);I(t,g);let v=h+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${v-a.height/2-(a.y-(a.top??0))})`);let y=m+l,S=Math.asin(Math.min(1,(h-y)/l))*180/Math.PI,C=[...B(0,-y,l,24,180+S,-S),...B(-(-c/2+f),-(h+f),f,12,90,0),...B(-(-c/2+f),-(p/2-f),f,12,360,270),...B(-(c/2-f),-(p/2-f),f,12,270,180),...B(-(c/2-f),-(h+f),f,12,180,90)];return t.intersect=function(e){return K.polygon(t,C,e)},i}e(ze,`person`);var Be=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Ve=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),He=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Ue=8,We=8;async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.width<We&&(t.width=We)),t.height){let e=s/2/(2.5+s/50);t.height=t.height-a-e*3,t.height<Ue&&(t.height=Ue)}let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=Math.max(t.width??0,l.width)+o,f=d/2,m=f/(2.5+d/50),h=Math.max(t.height??0,l.height)+a+m,g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=T.svg(c),n=Ve(0,0,d,h,f,m),r=He(0,m,d,h,f,m),i=b(t,{}),a=e.path(n,i),o=e.path(r,b(t,{fill:`none`}));g=c.insert(()=>o,`:first-child`),g=c.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=Be(0,0,d,h,f,m);g=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(_)).attr(`style`,r)}return g.attr(`label-offset-y`,m),g.attr(`transform`,`translate(${-d/2}, ${-(h/2+m)})`),I(t,g),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-m)){let i=m*m*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=m-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e(Ge,`cylinder`);async function Ke(e,t,n){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await P(e,t,L(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:m}=t,{cssStyles:h}=t;if(n?.rx&&n.ry&&(f=n.rx,m=n.ry),t.look===`handDrawn`){let e=T.svg(a),n=b(t,{}),r=f||m?e.path(q(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,p(h))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,p(f)).attr(`ry`,p(m)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return I(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},a}e(Ke,`drawRect`);async function qe(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ke(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=T.svg(c),n=b(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(qe,`datastore`);async function Je(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=T.svg(o),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=o.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),I(t,y),t.intersect=function(e){return K.rect(t,e)},o}e(Je,`dividedRectangle`);async function Ye(e,n){let{labelStyles:r,nodeStyles:i}=x(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await P(e,n,L(n)),u=Math.sqrt(l.width**2+l.height**2)/2,d=(n?.width?n?.width/2:u)+(s??0),f=d+a,m,{cssStyles:h}=n;if(n.look===`handDrawn`){let e=T.svg(c),t=b(n,{roughness:.2,strokeWidth:2.5}),r=b(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,f*2,t),a=e.circle(0,0,d*2,r);m=c.insert(`g`,`:first-child`),m.attr(`class`,p(n.cssClasses)).attr(`style`,p(h)),m.node()?.appendChild(i),m.node()?.appendChild(a)}else{m=c.insert(`g`,`:first-child`);let e=m.insert(`circle`,`:first-child`),t=m.insert(`circle`);m.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,f).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return I(n,m),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,f,e),K.circle(n,f,e)},c}e(Ye,`doublecircle`);async function Xe(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:o,halfPadding:s}=await P(e,t,L(t)),{theme:c,themeVariables:l}=a();w(i,t.colorIndex,c,l.borderColorArray);let u=s??10,d=o.width/2+u*2,f=o.height/2+u*2,p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=e.ellipse(0,0,d*2,f*2,n);p=i.insert(()=>r,`:first-child`),p.attr(`class`,`basic label-container`),m&&p.attr(`style`,m)}else p=i.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`rx`,d).attr(`ry`,f).attr(`cx`,0).attr(`cy`,0);return t.width=d*2,t.height=f*2,I(t,p),t.calcIntersect=function(e,t){let n=e.width/2,r=e.height/2;return K.ellipse(e,n,r,t)},t.intersect=function(e){return K.ellipse(t,d,f,e)},i}e(Xe,`usecaseEllipse`);function Ze(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=x(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=T.svg(o),{nodeBorder:l}=r,u=b(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),I(n,f),n.intersect=function(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),K.circle(n,7,e)},o}e(Ze,`filledCircle`);var Qe=10,$e=10;async function et(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.height<Qe&&(n.height=Qe),n.width=(n?.width??0)-o-o/2,n.width<$e&&(n.width=$e));let{shapeSvg:s,bbox:c,label:l}=await P(e,n,L(n)),u=(n?.width?n?.width:c.width)+(o??0),d=n?.height?n?.height:u+c.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:m}=n,h=T.svg(s),g=b(n,{});n.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=R(p),v=h.path(_,g),y=s.insert(()=>v,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,I(n,y),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,p,e),K.polygon(n,p,e)},s}e(et,`flippedTriangle`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),f=d-u,p=Math.max(c*.38,28),m=-d/2,h=[{x:-c/2,y:m},{x:-c/2+p,y:m},{x:-c/2+p,y:m+u},{x:c/2,y:m+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],g=[`M${h[0].x},${h[0].y}`,...h.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:_}=t,v;if(t.look===`handDrawn`){let e=T.svg(i).path(g,b(t,{}));v=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),_&&v.attr(`style`,_)}else v=i.insert(`path`,`:first-child`).attr(`d`,g).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?I(t,v):I(t,v,{width:c,height:d});let y=m+u+f/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${y-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return K.polygon(t,h,e)},i}e(tt,`folder`);function nt(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=x(t);t.label=``;let o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);(n===`LR`||n===`RL`)&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=T.svg(o),p=b(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),I(t,h);let g=r?.padding??0;return t.width&&t.height&&(t.width+=g/2||0,t.height+=g/2||0),t.intersect=function(e){return K.rect(t,e)},o}e(nt,`forkJoin`);async function rt(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await P(e,n,L(n)),l=(n?.height?n?.height:Math.max(10,c.height))+o*2,u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=(n?.width?n?.width:Math.max(15,c.width)+d*2)+a*2,{cssStyles:p}=n,m=T.svg(s),h=b(n,{});n.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-f/2,y:-l/2},{x:f/2-u,y:-l/2},...B(-f/2+u,0,u,50,90,270),{x:f/2-u,y:l/2},{x:-f/2,y:l/2}],_=R(g),v=m.path(_,h),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),p&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,p),i&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,i),I(n,y),n.intersect=function(e){return t.info(`Pill intersect`,n,{radius:u,point:e}),K.polygon(n,g,e)},s}e(rt,`halfRoundedRectangle`);var it=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function at(e,t){let{labelStyles:n,nodeStyles:r}=x(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await P(e,t,L(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(c),n=b(t,{}),r=it(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},c}e(at,`hexagon`);async function ot(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await P(e,n,L(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=T.svg(a),u=b(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=R(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),I(n,m),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),K.polygon(n,d,e)},a}e(ot,`hourglass`);async function st(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:g}=r,{stylesMap:v}=C(n),y=-h/2,S=-m/2,w=n.label?8:0,E=T.svg(u),D=b(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(y,S,h,m,D),k=Math.max(h,d.width),A=m+d.height+w,j=E.rectangle(-k/2,-A/2,k,A,{...D,fill:`transparent`,stroke:`none`}),M=u.insert(()=>O,`:first-child`),N=u.insert(()=>j);if(n.icon){let e=u.append(`g`);e.html(`<g>${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${v.get(`stroke`)??g};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-A/2:A/2-d.height})`),M.attr(`transform`,`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),I(n,N),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+h/2,y:i-a/2+d.height+w},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],K.polygon(n,o,e)},u}e(st,`icon`);async function ct(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:g}=r,{stylesMap:v}=C(n),y=T.svg(u),S=b(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`),S.stroke=v.get(`fill`)??g;let w=u.append(`g`);n.icon&&w.html(`<g>${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let E=w.node().getBBox(),D=E.width,O=E.height,k=E.x,A=E.y,j=Math.max(D,O)*Math.SQRT2+40,M=y.circle(0,0,j,S),N=Math.max(j,d.width),F=j+d.height+p,L=y.rectangle(-N/2,-F/2,N,F,{...S,fill:`transparent`,stroke:`none`}),R=u.insert(()=>M,`:first-child`),z=u.insert(()=>L);return w.attr(`transform`,`translate(${-D/2-k},${m?d.height/2+p/2-O/2-A:-d.height/2-p/2-O/2-A})`),w.attr(`style`,`color: ${v.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),R.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),I(n,z),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),K.rect(n,e)},u}e(ct,`iconCircle`);async function lt(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:S}=C(n),w=-g/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=b(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=S.get(`fill`)??y;let A=O.path(q(w,E,g,h,5),k),j=Math.max(g,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`).attr(`class`,`icon-shape2`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`<g>${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??v};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+g/2,y:i-a/2+d.height+D},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(lt,`iconRounded`);async function ut(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:S}=C(n),w=-g/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=b(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=S.get(`fill`)??y;let A=O.path(q(w,E,g,h,.1),k),j=Math.max(g,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`<g>${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??v};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+g/2,y:i-a/2+d.height+D},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(ut,`iconSquare`);async function dt(e,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=x(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await P(e,n,`image-shape default`),h=n.pos===`t`,g=-u/2,_=-d/2,v=n.label?8:0,y=T.svg(f),S=b(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=y.rectangle(g,_,u,d,S),w=Math.max(u,p.width),E=d+p.height+v,D=y.rectangle(-w/2,-E/2,w,E,{...S,fill:`none`,stroke:`none`}),O=f.insert(()=>C,`:first-child`),k=f.insert(()=>D);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?E/2-d:-E/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-v/2:d/2-p.height/2+v/2})`),O.attr(`transform`,`translate(0,${h?p.height/2+v/2:-p.height/2-v/2})`),I(n,k),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+v},{x:r+u/2,y:i-a/2+p.height+v},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+v},{x:r-p.width/2,y:i-a/2+p.height+v}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],K.polygon(n,o,e)},f}e(dt,`imageSquare`);async function ft(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ft,`inv_trapezoid`);async function pt(e,t){let{shapeSvg:n,bbox:r,label:i}=await P(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),I(t,a),t.intersect=function(e){return K.rect(t,e)},n}e(pt,`labelRect`);async function mt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(mt,`lean_left`);async function ht(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ht,`lean_right`);function gt(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.label=``,n.labelStyle=r;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=T.svg(a),d=b(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=R(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),I(n,m),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),K.polygon(n,l,e)},a}e(gt,`lightningBolt`);var _t=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),vt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),yt=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),bt=10,xt=10;async function St(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<xt&&(t.width=xt);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<bt&&(t.height=bt)}let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,f=d/(2.5+u/50),m=(t?.height?t?.height:c.height)+f+o*2,h=m*.1,g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=vt(0,0,u,m,d,f,h),r=yt(0,f,u,m,d,f),i=b(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),g=s.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=_t(0,0,u,m,d,f,h);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(_)).attr(`style`,r)}return g.attr(`label-offset-y`,f),g.attr(`transform`,`translate(${-u/2}, ${-(m/2+f)})`),I(t,g),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(St,`linedCylinder`);async function Ct(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=T.svg(s),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...z(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),y.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f-(c.y-(c.top??0))})`),I(t,y),t.intersect=function(e){return K.polygon(t,_,e)},s}e(Ct,`linedWaveEdgedRect`);var wt=56,Tt=72,Et=8,Dt=2,Ot=8,kt={normal:`usecase-actor-shape usecase-actor-normal`,hollow:`usecase-actor-hollow`,awesome:`usecase-actor-awesome`,icon:`usecase-actor-icon`},At=Math.PI/3,jt=.6,Mt=e((e,t)=>{let n=t*jt,r=t*Math.sqrt(1-jt**2),i=Math.cos(At),a=-Math.sin(At),o=n*-a,s=e+n*i,c=r*i,l=r*a;return`M ${o-c} ${s-l} L ${o+c} ${s+l}`},`businessMarkerPathForCircle`),Nt={normal:Mt(-24,12),hollow:Mt(-23,9),awesome:Mt(-21,13),icon:`M 12 -8 L 26 -26`},Pt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`),Ft=e((e,t,n,r,i=!1)=>{if(t.look===`handDrawn`){let a=T.svg(e).path(n,b(t,i?{fill:`none`}:{}));return e.insert(()=>a,`:first-child`).attr(`class`,r)}let a=e.append(`path`).attr(`class`,r).attr(`d`,n);return i&&a.attr(`fill`,`none`),a},`appendActorPath`),It=e((e,t,n,r,i,a,o=!1)=>{if(t.look===`handDrawn`){let s=T.svg(e).circle(n,r,i*2,b(t,o?{fill:`none`}:{}));return e.insert(()=>s,`:first-child`).attr(`class`,a)}let s=e.append(`circle`).attr(`class`,a).attr(`cx`,n).attr(`cy`,r).attr(`r`,i);return o&&s.attr(`fill`,`none`),s},`appendActorCircle`),Lt=e((e,t,n)=>{t.business&&e.append(`path`).attr(`class`,`usecase-business-marker usecase-actor-business-marker`).attr(`d`,Nt[n]).attr(`fill`,`none`).attr(`style`,`stroke: inherit !important; stroke-width: inherit !important`)},`appendBusinessActorMarker`);async function Rt(e,t,n,r){let{labelStyles:i,nodeStyles:o}=x(t);t.labelStyle=i;let{shapeSvg:s,bbox:c,label:l}=await P(e,n===`icon`||t.stereotype!==void 0?{...t,icon:n===`icon`?void 0:t.icon,stereotype:void 0}:t,L(t,`usecase-actor-variant usecase-actor-${n}`)),u=t.accessibleName??t.label;u&&s.attr(`role`,`img`).attr(`aria-label`,u),l.attr(`class`,`label actor-label usecase-actor-label`);let{theme:d,themeVariables:f}=a();w(s,t.colorIndex,d,f.borderColorArray);let p,m;if(t.stereotype){let e=await F(s,`\xAB${t.stereotype}\xBB`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=e.label.attr(`class`,`label usecase-stereotype`),m=e.bbox}let h=s.append(`g`).attr(`class`,`usecase-actor-glyph ${kt[n]}`).attr(`style`,o||null);await r(h,t),Lt(h,t,n);let g=t.padding??Ot,_=m?.height??0,v=Tt+Et+c.height+(m?_+Dt:0),y=Math.max(wt,c.width,m?.width??0)+g*2,b=v+g*2,S=-v/2;h.attr(`transform`,`translate(0,${S+Tt/2})`);let C=S+Tt+Et;return p&&m&&(C+=_/2,Pt(p,m,C),C+=_/2+Dt),Pt(l,c,C+c.height/2),I(t,s.insert(`rect`,`:first-child`).attr(`class`,`usecase-actor-outline`).attr(`x`,-y/2).attr(`y`,-b/2).attr(`width`,y).attr(`height`,b).attr(`opacity`,0).attr(`aria-hidden`,`true`)),t.intersect=e=>K.rect(t,e),s}e(Rt,`renderUsecaseActor`);var zt=[`M 0 -12`,`C 6.627 -12 12 -17.373 12 -24`,`C 12 -30.627 6.627 -36 0 -36`,`C -6.627 -36 -12 -30.627 -12 -24`,`C -12 -17.373 -6.627 -12 0 -12 Z`,`M 0 -12 V 8`,`M -17 -5 H 17`,`M 0 8 L -15 28`,`M 0 8 L 15 28`].join(` `);async function Bt(e,t){return Rt(e,t,`normal`,(e,t)=>{Ft(e,t,zt,`usecase-actor-stick`)})}e(Bt,`usecaseActor`);var Vt=[`M 0 -34`,`C 7.18 -34 13 -28.18 13 -21`,`C 13 -13.82 7.18 -8 0 -8`,`C -7.18 -8 -13 -13.82 -13 -21`,`C -13 -28.18 -7.18 -34 0 -34 Z`,`M -24 25`,`C -24 7 -14 -3 0 -3`,`C 14 -3 24 7 24 25`,`C 24 28 21 30 18 30`,`H -18`,`C -21 30 -24 28 -24 25 Z`].join(` `);async function Ht(e,t){return Rt(e,t,`awesome`,(e,t)=>{Ft(e,t,Vt,`usecase-actor-awesome-silhouette`)})}e(Ht,`usecaseActorAwesome`);var Ut=[`M -22 -10`,`H 22`,`V 0`,`H 6`,`L 22 17`,`L 13 28`,`L 0 13`,`L -13 28`,`L -22 17`,`L -6 0`,`H -22`,`Z`].join(` `);async function Wt(e,t){return Rt(e,t,`hollow`,(e,t)=>{It(e,t,0,-23,9,`usecase-actor-hollow-head`,!0),Ft(e,t,Ut,`usecase-actor-hollow-body`,!0)})}e(Wt,`usecaseActorHollow`);var Gt=52,Kt=42,qt=-2,Jt=e(async(e,t)=>{let n=-Gt/2,r=qt-Gt/2;if(t.look===`handDrawn`){let i=T.svg(e).rectangle(n,r,Gt,Gt,b(t,{}));e.insert(()=>i,`:first-child`).attr(`class`,`usecase-actor-icon-frame`)}else e.append(`rect`).attr(`class`,`usecase-actor-icon-frame`).attr(`x`,n).attr(`y`,r).attr(`width`,Gt).attr(`height`,Gt).attr(`rx`,4).attr(`ry`,4);let i=t.icon??``,a=await g(i.includes(`:`)?i:`fa:${i}`),o=await _(i,{height:Kt,width:Kt,fallbackPrefix:`fa`}),s=e.append(`g`).attr(`class`,`usecase-actor-icon-symbol${a?``:` usecase-actor-icon-fallback`}`).attr(`aria-hidden`,`true`).html(`<g>${o}</g>`),c=s.node()?.getBBox();c&&s.attr(`transform`,`translate(${-c.width/2-c.x},${qt-c.height/2-c.y})`)},`drawIconActor`);async function Yt(e,t){return Rt(e,t,`icon`,Jt)}e(Yt,`usecaseActorIcon`);var Xt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`);async function Zt(e,t){let n=t,{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:o,bbox:s,halfPadding:c,label:l}=await P(e,n.stereotype?{...t,stereotype:void 0}:t,L(t,`usecase-business-shape`));l.attr(`class`,`label usecase-label`);let{theme:u,themeVariables:d}=a();w(o,t.colorIndex,u,d.borderColorArray);let f,p;if(n.stereotype){let e=await F(o,`\xAB${n.stereotype}\xBB`,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=e.label.attr(`class`,`label usecase-stereotype`),p=e.bbox}let m=p?2:0,h=s.height+(p?.height??0)+m,g=Math.max(s.width,p?.width??0),_=c??10,v=g/2+_*2,y=h/2+_*2,S=Math.min(Math.max(_/5,1),_/2),C=g/2+S,E=v-S,D=C/v,O=E/v,k=y*Math.sqrt(Math.max(0,1-D*D)),A=-y*Math.sqrt(Math.max(0,1-O*O));f&&p&&Xt(f,p,-h/2+p.height/2),Xt(l,s,h/2-s.height/2);let j;if(t.look===`handDrawn`){let e=T.svg(o).ellipse(0,0,v*2,y*2,b(t,{}));j=o.insert(()=>e,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`)}else j=o.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`).attr(`style`,i).attr(`rx`,v).attr(`ry`,y).attr(`cx`,0).attr(`cy`,0);o.append(`path`).attr(`class`,`usecase-business-marker`).attr(`d`,`M ${C} ${k} L ${E} ${A}`).attr(`fill`,`none`).attr(`style`,i||null);let M=n.accessibleName??n.label;return M&&o.attr(`role`,`img`).attr(`aria-label`,M),I(t,j),t.calcIntersect=(e,t)=>K.ellipse(e,e.width/2,e.height/2,t),t.intersect=e=>K.ellipse(t,v,y,e),o}e(Zt,`usecaseBusiness`);var Qt=8,$t=4,en=1,tn=e((e,t,n,r)=>{let i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${n-t.width/2-i},${r-t.height/2-a})`)},`positionLabel`),nn=e(e=>{let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:en},`numericStrokeWidth`);async function rn(t,n){let r=n,{labelStyles:i,nodeStyles:a}=x(n),{stylesMap:o}=C(n);n.labelStyle=i;let{shapeSvg:s,bbox:c,label:l}=await P(t,n,L(n,`usecase-json-table`));s.attr(`role`,`img`),r.accessibleName&&s.attr(`aria-label`,r.accessibleName),l.attr(`class`,`label usecase-json-title`);let u=s.append(`g`).attr(`class`,`usecase-json-table-grid`),d=[];for(let e of r.jsonRows??[]){let t=await F(u,e.key,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0}),r=await F(u,e.value,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0});d.push({key:{label:t.label.attr(`class`,`label usecase-json-key`),bbox:t.bbox},value:{label:r.label.attr(`class`,`label usecase-json-value`),bbox:r.bbox}})}let f=Math.max(0,...d.map(({key:e})=>e.bbox.width))+Qt*2,p=Math.max(0,...d.map(({value:e})=>e.bbox.width))+Qt*2,m=c.width+Qt*2,h=Math.max(m,f+p),g=p+Math.max(0,h-f-p),_=c.height+$t*2,v=d.map(({key:e,value:t})=>Math.max(e.bbox.height,t.bbox.height)+$t*2),y=_+v.reduce((e,t)=>e+t,0),S=nn(o.get(`stroke-width`)),w=h+S*2,E=y+S*2,D=-h/2,O=-y/2,k=n.look===`handDrawn`?T.svg(s):void 0,A=k?b(n,{}):void 0,j=e((e,t,n,r,i,o)=>{if(k&&A){let a=k.rectangle(n,r,i,o,A);return e.insert(()=>a,`:first-child`).attr(`class`,t)}return e.insert(`rect`,`:first-child`).attr(`class`,t).attr(`x`,n).attr(`y`,r).attr(`width`,i).attr(`height`,o).attr(`style`,a)},`insertCell`),M=j(s,`label-container usecase-json-border`,-w/2,-E/2,w,E);j(u,`usecase-json-cell usecase-json-title-cell`,D,O,h,_),u.node()?.append(l.node()),tn(l,c,0,O+_/2);let N=O+_;return d.forEach(({key:e,value:t},n)=>{let r=v[n],i=u.append(`g`).attr(`class`,`usecase-json-row`).attr(`data-row-index`,n).attr(`transform`,`translate(0,${N})`);j(i,`usecase-json-cell usecase-json-key-cell`,D,0,f,r),j(i,`usecase-json-cell usecase-json-value-cell`,D+f,0,g,r),i.node()?.append(e.label.node(),t.label.node()),tn(e.label,e.bbox,D+f/2,r/2),tn(t.label,t.bbox,D+f+g/2,r/2),N+=r}),I(n,M),n.intersect=e=>K.rect(n,e),s}e(rn,`usecaseJsonTable`);async function an(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,g=-m/2,{cssStyles:_}=t,v=T.svg(c),y=b(t,{}),S=[{x:h-s,y:g+s},{x:h-s,y:g+m+s},{x:h+p-s,y:g+m+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g+m-s},{x:h+p+s,y:g+m-s},{x:h+p+s,y:g-s},{x:h+s,y:g-s},{x:h+s,y:g},{x:h,y:g},{x:h,y:g+s}],C=[{x:h,y:g+s},{x:h+p-s,y:g+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g},{x:h,y:g}];t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let w=R(S),E=v.path(w,y),D=R(C),O=v.path(D,y);t.look!==`handDrawn`&&(E=ee(E),O=ee(O));let k=c.insert(`g`,`:first-child`);return k.insert(()=>E),k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),I(t,k),t.intersect=function(e){return K.polygon(t,S,e)},c}e(an,`multiRect`);async function on(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,g=-m/2,{cssStyles:_}=t,v=z(h-10,g+m+10,h+d-10,g+m+10,p,.8),y=v?.[v.length-1],S=[{x:h-10,y:g+10},{x:h-10,y:g+m+10},...v,{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:y.y-20},{x:h+d+10,y:y.y-20},{x:h+d+10,y:g-10},{x:h+10,y:g-10},{x:h+10,y:g},{x:h,y:g},{x:h,y:g+10}],C=[{x:h,y:g+10},{x:h+d-10,y:g+10},{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:g},{x:h,y:g}],w=T.svg(i),E=b(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=R(S),O=w.path(D,E),k=R(C),A=w.path(k,E),j=i.insert(()=>O,`:first-child`);return j.insert(()=>A),j.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p-(a.y-(a.top??0))})`),I(t,j),t.intersect=function(e){return K.polygon(t,S,e)},i}e(on,`multiWaveEdgedRectangle`);async function sn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r,t.useHtmlLabels||l(u())||(t.centerLabel=!0);let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=Math.max(o.width+(t.padding??0)*2,t?.width??0),d=Math.max(o.height+(t.padding??0)*2,t?.height??0),f=-c/2,p=-d/2,{cssStyles:m}=t,h=T.svg(a),g=b(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=h.rectangle(f,p,c,d,g),v=a.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),s.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,i),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),I(t,v),t.intersect=function(e){return K.rect(t,e)},a}e(sn,`note`);var cn=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function ln(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=cn(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=J(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),I(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];return K.polygon(e,r,t)},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(ln,`question`);async function un(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),f=d/4,p=-Math.max(u,(t.width??0)-f)/2,m=-d/2,h=m/2,g=[{x:p+h,y:m},{x:p,y:0},{x:p+h,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:_}=t,v=T.svg(s),y=b(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=R(g),C=v.path(S,y),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-h/2},0)`),l.attr(`transform`,`translate(${-h/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,g,e)},s}e(un,`rect_left_inv_arrow`);async function dn(e,r){let{labelStyles:i,nodeStyles:o}=x(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),u=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,o),f=r.description,p=r.label,m=await se(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(l(a())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}t.info(`Text 2`,f);let g=f||[],_=m.getBBox(),v=await se(d,Array.isArray(g)?g.join(`<br/>`):g,r.labelStyle,!0,!0),y=v.children[0],S=n(v);h=y.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let C=(r.padding||0)/2;n(v).attr(`transform`,`translate( `+(h.width>_.width?0:(_.width-h.width)/2)+`, `+(_.height+C+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<_.width?0:-(_.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-C+3)+`)`);let w=h.width+(r.padding||0),E=h.height+(r.padding||0),D=-h.width/2-C,O=-h.height/2-C,k,A;if(r.look===`handDrawn`){let e=T.svg(c),n=b(r,{}),i=e.path(q(D,O,w,E,r.rx||0),n),a=e.line(-h.width/2-C,-h.height/2-C+_.height+C,h.width/2+C,-h.height/2-C+_.height+C,n);A=c.insert(()=>(t.debug(`Rough node insert CXC`,i),a),`:first-child`),k=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else k=u.insert(`rect`,`:first-child`),A=u.insert(`line`),k.attr(`class`,`outer title-state`).attr(`style`,o).attr(`x`,-h.width/2-C).attr(`y`,-h.height/2-C).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),A.attr(`class`,`divider`).attr(`x1`,-h.width/2-C).attr(`x2`,h.width/2+C).attr(`y1`,-h.height/2-C+_.height+C).attr(`y2`,-h.height/2-C+_.height+C);return I(r,k),r.intersect=function(e){return K.rect(r,e)},c}e(dn,`rectWithTitle`);async function fn(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ke(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(fn,`roundedRect`);var pn=8;async function mn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?pn:pn*2),u=(t?.height??s.height)+a*2,d=l-pn,f=u,m=pn-l/2,h=-u/2,{cssStyles:g}=t,_=T.svg(o),v=b(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:m,y:h},{x:m+d,y:h},{x:m+d,y:h+f},{x:m-pn,y:h+f},{x:m-pn,y:h},{x:m,y:h},{x:m,y:h+f}],S=_.polygon(y.map(e=>[e.x,e.y]),v),C=o.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`).attr(`style`,p(g)),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),g&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${pn/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.rect(t,e)},o}e(mn,`shadedProcess`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:g}=t,_=T.svg(s),v=b(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],S=R(y),C=_.path(S,v),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,r),w.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,y,e)},s}e(hn,`slopedRect`);async function gn(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n,o=await Ke(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i});if(t.colorIndex!==void 0){let{theme:e,themeVariables:n}=a();w(o,t.colorIndex,e,n.borderColorArray)}return o}e(gn,`squareRect`);var _n=50,vn=e((e,t,n)=>{let r=e.height+n,i=r*Math.cos(Math.PI/(2*(_n-1))),a=Math.sqrt(Math.max(0,i**2-e.height**2));return{w:Math.max(e.width+r/4+t,1.5*r+(r-i),e.width+t+r-a),h:r}},`stadiumDimensions`);async function yn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?40:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{w:l,h:u}=vn(c,a,o),d=u/2,{cssStyles:f}=t,p=T.svg(s),m=b(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2+d,y:-u/2},{x:l/2-d,y:-u/2},...B(-l/2+d,0,d,_n,90,270),{x:l/2-d,y:u/2},...B(l/2-d,0,d,_n,270,450)],g=R(h),_=p.path(g,m),v=s.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),I(t,v),t.intersect=function(e){return K.polygon(t,h,e)},s}e(yn,`stadium`);async function bn(e,t){return Ke(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(bn,`state`);function xn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=T.svg(u),f=b(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,g=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),_=u.insert(()=>p,`:first-child`);if(_.insert(()=>g),t.look!==`handDrawn`&&_.attr(`class`,`outer-path`),a&&_.selectAll(`path`).attr(`style`,a),i&&_.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;_.attr(`style`,`filter:url(#${n})`)}return I(t,_),t.intersect=function(e){return K.circle(t,(t.width??0)/2,e)},u}e(xn,`stateEnd`);function Sn(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=T.svg(a).circle(0,0,t.width,S(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return I(t,o),t.intersect=function(e){return K.circle(t,(t.width??7)/2,e)},a}e(Sn,`stateStart`);var Cn=8;async function wn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.width+2*Cn+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*Cn,f=u,m=-l/2,h=-u/2,g=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=e.rectangle(m,h,d+16,f,n),i=e.line(m+Cn,h,m+Cn,h+f,n),a=e.line(m+Cn+d,h,m+Cn+d,h+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,p(c)),I(t,o)}else{let e=J(s,d,f,g);r&&e.attr(`style`,r),I(t,e)}return t.intersect=function(e){return K.polygon(t,g,e)},s}e(wn,`subroutine`);var Tn=.2;async function En(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Tn*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.height?t?.height:c.height)+o*2,u=Tn*l,d=Tn*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:g}=t,_=T.svg(s),v=b(t,{}),y=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],S=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let C=R(y),w=_.path(C,v),E=R(S),D=_.path(E,{...v,fillStyle:`solid`}),O=s.insert(()=>D,`:first-child`);return O.insert(()=>w,`:first-child`),O.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),I(t,O),t.intersect=function(e){return K.polygon(t,y,e)},s}e(En,`taggedRect`);async function Dn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=T.svg(i),h=b(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...z(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],_=-s/2+s/2*.1,v=-f/2-d*.4,y=[{x:_+s-u,y:(v+c)*1.3},{x:_+s,y:v+c-d},{x:_+s,y:(v+c)*.9},...z(_+s,(v+c)*1.25,_+s-u,(v+c)*1.3,-c*.02,.5)],S=R(g),C=m.path(S,h),w=R(y),E=m.path(w,{...h,fillStyle:`solid`}),D=i.insert(()=>E,`:first-child`);return D.insert(()=>C,`:first-child`),D.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,g,e)},i}e(Dn,`taggedWaveEdgedRectangle`);async function On(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),I(t,u),t.intersect=function(e){return K.rect(t,e)},i}e(On,`text`);var kn=e((e,t,n,r,i,a)=>`M${e},${t}
3
3
  a${i},${a} 0,0,1 0,${-r}
4
4
  l${n},0