loopat 0.1.51 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -2
- package/server/src/git-host.ts +1 -0
- package/server/src/github.ts +101 -2
- package/server/src/index.ts +97 -3
- package/server/src/loops.ts +52 -1
- package/server/src/paths.ts +2 -0
- package/server/src/podman.ts +5 -2
- package/server/src/session.ts +25 -0
- package/web/dist/assets/{CodeEditor-JV36Z3V5.js → CodeEditor-ROIg2ylA.js} +1 -1
- package/web/dist/assets/Editor-BN7Q5g4N.js +1 -0
- package/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/dist/assets/Markdown-DvFvJx3d.js +3 -0
- package/web/dist/assets/MilkdownEditor-DsqsnlSK.js +123 -0
- package/web/dist/assets/{Terminal-Vi3Ufhgi.js → Terminal-DQxchB0u.js} +2 -2
- package/web/dist/assets/arc-JSCNOeGh.js +1 -0
- package/web/dist/assets/architecture-7EHR7CIX-C6TANlSv.js +1 -0
- package/web/dist/assets/architectureDiagram-3BPJPVTR-BiL4yrd-.js +36 -0
- package/web/dist/assets/array-CwG8vNfn.js +1 -0
- package/web/dist/assets/blockDiagram-GPEHLZMM-BlIpPvY3.js +132 -0
- package/web/dist/assets/c4Diagram-AAUBKEIU-CzsNYAS-.js +10 -0
- package/web/dist/assets/channel-BadMOAUe.js +1 -0
- package/web/dist/assets/chunk-2J33WTMH-jzikTe5Z.js +1 -0
- package/web/dist/assets/chunk-3OPIFGDE-CPRLtc-k.js +62 -0
- package/web/dist/assets/chunk-4BX2VUAB-C4VZq7p9.js +1 -0
- package/web/dist/assets/chunk-4EGX6M5U-BgefWETD.js +1 -0
- package/web/dist/assets/chunk-55IACEB6-DUDG-guT.js +1 -0
- package/web/dist/assets/chunk-5DO6E6H7-CXaGVrrt.js +1 -0
- package/web/dist/assets/chunk-5ZQYHXKU-DAcci771.js +2 -0
- package/web/dist/assets/chunk-62oNxeRG.js +1 -0
- package/web/dist/assets/chunk-727SXJPM-DB5VAPjb.js +206 -0
- package/web/dist/assets/chunk-AQP2D5EJ-zKFdEFYM.js +231 -0
- package/web/dist/assets/chunk-BR22UD5L-D9r29Y8a.js +1 -0
- package/web/dist/assets/chunk-BSJP7CBP-DF8jhsUx.js +1 -0
- package/web/dist/assets/chunk-CSCIHK7Q-KZCheCnJ.js +125 -0
- package/web/dist/assets/chunk-FHYWG6QK-5gBLDG6p.js +1 -0
- package/web/dist/assets/chunk-FMBD7UC4-BruiH2nG.js +15 -0
- package/web/dist/assets/chunk-KSCS5N6A-Cc-HIfIs.js +10 -0
- package/web/dist/assets/chunk-L5ZTLDWV-4FtjsXMJ.js +1 -0
- package/web/dist/assets/chunk-MPE355IW-RWzERmdt.js +1 -0
- package/web/dist/assets/chunk-MZUSXYTE-Xjzy1goZ.js +1 -0
- package/web/dist/assets/chunk-N66VUXT2-7wnXYZTH.js +1 -0
- package/web/dist/assets/chunk-ND2GUHAM-CLZCc4eF.js +1 -0
- package/web/dist/assets/chunk-NNHCCRGN-DHWtWlDY.js +159 -0
- package/web/dist/assets/chunk-NZK2D7GU-OE2TAhC6.js +1 -0
- package/web/dist/assets/chunk-O5CBEL6O-Bg6sZtyT.js +70 -0
- package/web/dist/assets/chunk-PUPMXCY4-C1dr9z9P.js +1 -0
- package/web/dist/assets/chunk-QZHKN3VN-DxLqo3gI.js +1 -0
- package/web/dist/assets/chunk-UIBZB4QT-DBYf6fSv.js +1 -0
- package/web/dist/assets/chunk-WCWK7LTN-DpJdbsk3.js +1 -0
- package/web/dist/assets/classDiagram-4FO5ZUOK-DGIJJBY5.js +1 -0
- package/web/dist/assets/classDiagram-v2-Q7XG4LA2-BdsZBmZ_.js +1 -0
- package/web/dist/assets/cose-bilkent-S5V4N54A-CWucooZw.js +1 -0
- package/web/dist/assets/cytoscape.esm-fMM2C9dj.js +321 -0
- package/web/dist/assets/dagre-BM42HDAG-CZ5AtThh.js +4 -0
- package/web/dist/assets/dagre-DtjYhTY3.js +1 -0
- package/web/dist/assets/defaultLocale-Dda4OpKy.js +1 -0
- package/web/dist/assets/diagram-2AECGRRQ-DE80i5fc.js +43 -0
- package/web/dist/assets/diagram-5GNKFQAL-Egr34zuZ.js +10 -0
- package/web/dist/assets/diagram-KO2AKTUF-CvajPPQL.js +3 -0
- package/web/dist/assets/diagram-LMA3HP47-f9ekzEBK.js +24 -0
- package/web/dist/assets/diagram-OG6HWLK6-CJhcoTKU.js +24 -0
- package/web/dist/assets/dist-Qo4xPaJL.js +1 -0
- package/web/dist/assets/erDiagram-TEJ5UH35-CYNgf9or.js +85 -0
- package/web/dist/assets/eventmodeling-FCH6USID-CFdOE-LK.js +1 -0
- package/web/dist/assets/flowDiagram-I6XJVG4X-BXTQ7QRg.js +162 -0
- package/web/dist/assets/ganttDiagram-6RSMTGT7-9CPIXrRu.js +292 -0
- package/web/dist/assets/gitGraph-WXDBUCRP-CQyqjuxy.js +1 -0
- package/web/dist/assets/gitGraphDiagram-PVQCEYII-D8BksuAg.js +106 -0
- package/web/dist/assets/graphlib-CVvj2XkR.js +1 -0
- package/web/dist/assets/index-BbAx7IhR.js +452 -0
- package/web/dist/assets/index-COolIbl3.css +1 -0
- package/web/dist/assets/info-J43DQDTF-_TOGLt_U.js +1 -0
- package/web/dist/assets/infoDiagram-5YYISTIA-Be0OcURm.js +2 -0
- package/web/dist/assets/init-D6KNwrax.js +1 -0
- package/web/dist/assets/isObject-6BN_nwjc.js +1 -0
- package/web/dist/assets/ishikawaDiagram-YF4QCWOH-BFyPbPqD.js +70 -0
- package/web/dist/assets/journeyDiagram-JHISSGLW-DR1RevaB.js +139 -0
- package/web/dist/assets/jsx-runtime-ZP0XCtgh.js +1 -0
- package/web/dist/assets/kanban-definition-UN3LZRKU-C5BAKIQX.js +89 -0
- package/web/dist/assets/katex-SDxE4_FN.js +257 -0
- package/web/dist/assets/{lib-B8L80SIn.js → lib-B1ZjR0ui.js} +3 -3
- package/web/dist/assets/line-C1hQ6Yic.js +1 -0
- package/web/dist/assets/linear-BTFE1p_D.js +1 -0
- package/web/dist/assets/mermaid-parser.core-B4wi-4x8.js +4 -0
- package/web/dist/assets/mindmap-definition-RKZ34NQL-DqgCcW-r.js +96 -0
- package/web/dist/assets/now-CfACN9Ld.js +1 -0
- package/web/dist/assets/ordinal-SeL1F7Yj.js +1 -0
- package/web/dist/assets/packet-YPE3B663-CsilPsGk.js +1 -0
- package/web/dist/assets/path-DNPd7Py7.js +1 -0
- package/web/dist/assets/pie-LRSECV5Y-B-D_L-Uc.js +1 -0
- package/web/dist/assets/pieDiagram-4H26LBE5-BP9tC1HT.js +30 -0
- package/web/dist/assets/quadrantDiagram-W4KKPZXB-BBjjuCms.js +7 -0
- package/web/dist/assets/radar-GUYGQ44K-DHD2KQPQ.js +1 -0
- package/web/dist/assets/requirementDiagram-4Y6WPE33-B_O_cEpd.js +84 -0
- package/web/dist/assets/rough.esm-DEh6Frf9.js +1 -0
- package/web/dist/assets/sankeyDiagram-5OEKKPKP-Cv_l_I0A.js +40 -0
- package/web/dist/assets/sequenceDiagram-3UESZ5HK-DBBZS2WD.js +162 -0
- package/web/dist/assets/src-BTV4tisa.js +1 -0
- package/web/dist/assets/stateDiagram-AJRCARHV-BaH2s_og.js +1 -0
- package/web/dist/assets/stateDiagram-v2-BHNVJYJU-Ryor5k_i.js +1 -0
- package/web/dist/assets/timeline-definition-PNZ67QCA-BNvy_0DN.js +120 -0
- package/web/dist/assets/treeView-BLDUP644-C8olDR1G.js +1 -0
- package/web/dist/assets/treemap-LRROVOQU-BIYIGzet.js +1 -0
- package/web/dist/assets/vennDiagram-CIIHVFJN-D5RSWRYm.js +34 -0
- package/web/dist/assets/viz-BR7pXPfi.js +7215 -0
- package/web/dist/assets/wardley-L42UT6IY-CfnZRM3V.js +1 -0
- package/web/dist/assets/wardleyDiagram-YWT4CUSO-5PntQ1A_.js +78 -0
- package/web/dist/assets/xychartDiagram-2RQKCTM6-B_1m_ITe.js +7 -0
- package/web/dist/index.html +23 -4
- package/web/dist/manifest.json +18 -0
- package/web/dist/assets/Editor-5Z34f3Gn.js +0 -1
- package/web/dist/assets/Markdown-DizYBjeA.js +0 -5
- package/web/dist/assets/MilkdownEditor-t_CG4MJj.js +0 -123
- package/web/dist/assets/index-D-WGDCY6.css +0 -1
- package/web/dist/assets/index-DDLq89pd.js +0 -145
- package/web/dist/assets/jsx-runtime-DAYmCNe8.js +0 -1
- /package/web/dist/assets/{w3c-keyname-DXh_HxYD.js → w3c-keyname-BoNxyEq0.js} +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import{A as e,B as t,M as n,T as r,b as i,g as a,x as o,z as s}from"./chunk-CSCIHK7Q-KZCheCnJ.js";import{g as c,h as l,p as u}from"./src-BTV4tisa.js";import{a as d,r as f,u as p}from"./chunk-5ZQYHXKU-DAcci771.js";import{n as m,t as h}from"./chunk-L5ZTLDWV-4FtjsXMJ.js";import{a as g,i as _,r as v,t as y}from"./chunk-NZK2D7GU-OE2TAhC6.js";import{n as b,r as x}from"./chunk-O5CBEL6O-Bg6sZtyT.js";import{t as S}from"./rough.esm-DEh6Frf9.js";var C=l(async(e,t,n)=>{let r,i=t.useHtmlLabels||a(o()?.htmlLabels);r=n||`node default`;let c=e.insert(`g`).attr(`class`,r).attr(`id`,t.domId||t.id),l=c.insert(`g`).attr(`class`,`label`).attr(`style`,p(t.labelStyle)),f;f=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let m=!!t.icon||!!t.img,g=t.labelType===`markdown`,_=await b(l,s(d(f),o()),{useHtmlLabels:i,width:t.width||o().flowchart?.wrappingWidth,classes:g?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:m,markdown:g},o()),v=_.getBBox(),y=(t?.padding??0)/2;if(i){let e=_.children[0],t=u(_);await h(e,f),v=e.getBoundingClientRect(),t.attr(`width`,v.width),t.attr(`height`,v.height)}return i?l.attr(`transform`,`translate(`+-v.width/2+`, `+-v.height/2+`)`):l.attr(`transform`,`translate(0, `+-v.height/2+`)`),t.centerLabel&&l.attr(`transform`,`translate(`+-v.width/2+`, `+-v.height/2+`)`),l.insert(`rect`,`:first-child`),{shapeSvg:c,bbox:v,halfPadding:y,label:l}},`labelHelper`),w=l(async(e,t,n)=>{let i=n.useHtmlLabels??r(o()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,n.labelStyle||``),c=await b(a,s(d(t),o()),{useHtmlLabels:i,width:n.width||o()?.flowchart?.wrappingWidth,style:n.labelStyle,addSvgBackground:!!n.icon||!!n.img}),l=c.getBBox(),f=n.padding/2;if(r(o())){let e=c.children[0],t=u(c);l=e.getBoundingClientRect(),t.attr(`width`,l.width),t.attr(`height`,l.height)}return i?a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):a.attr(`transform`,`translate(0, `+-l.height/2+`)`),n.centerLabel&&a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:f,label:a}},`insertLabel`),T=l((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),E=l((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function D(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}l(D,`createPathFromPoints`);function O(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}l(O,`generateFullSineWavePoints`);function k(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}l(k,`generateCirclePoints`);function A(e){let t=Array.from(e.childNodes).filter(e=>e.tagName===`path`),n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),r=t.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);n.setAttribute(`d`,r);let i=t.find(e=>e.getAttribute(`fill`)!==`none`),a=t.find(e=>e.getAttribute(`stroke`)!==`none`),o=l((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(i){let e={fill:o(i,`fill`),"fill-opacity":o(i,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&n.setAttribute(e,t)})}if(a){let e={stroke:o(a,`stroke`),"stroke-width":o(a,`stroke-width`)??`1`,"stroke-opacity":o(a,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&n.setAttribute(e,t)})}let s=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return s.appendChild(n),s}l(A,`mergePaths`);var j=l((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`),M=l(async(e,t,n,i=!1,a=!1)=>{let s=t||``;typeof s==`object`&&(s=s[0]);let c=o(),l=r(c);return await b(e,s,{style:n,isTitle:i,useHtmlLabels:l,markdown:!1,isNode:a,width:1/0},c)},`createLabel`),N=l((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`),P=l(async(e,t)=>{c.info(`Creating subgraph rect for `,t.id,t);let n=o(),{themeVariables:i,handDrawnSeed:a}=n,{clusterBkg:s,clusterBorder:l}=i,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:h}=_(t),v=e.insert(`g`).attr(`class`,`cluster `+t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),y=r(n),x=v.insert(`g`).attr(`class`,`cluster-label `),C;C=t.labelType===`markdown`?await b(x,t.label,{style:t.labelStyle,useHtmlLabels:y,isNode:!0,width:t.width}):await M(x,t.label,t.labelStyle||``,!1,!0);let w=C.getBBox();if(r(n)){let e=C.children[0],t=u(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=t.width<=w.width+t.padding?w.width+t.padding:t.width;t.width<=w.width+t.padding?t.diff=(T-t.width)/2-t.padding:t.diff=-t.padding;let E=t.height,D=t.x-T/2,O=t.y-E/2;c.trace(`Data `,t,JSON.stringify(t));let k;if(t.look===`handDrawn`){let e=S.svg(v),n=g(t,{roughness:.7,fill:s,stroke:l,fillWeight:3,seed:a}),r=e.path(N(D,O,T,E,0),n);k=v.insert(()=>(c.debug(`Rough node insert CXC`,r),r),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,h.join(`;`).replace(`fill`,`stroke`))}else k=v.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=m(n);if(x.attr(`transform`,`translate(${t.x-w.width/2}, ${t.y-t.height/2+A})`),d){let e=x.select(`span`);e&&e.attr(`style`,d)}let P=k.node().getBBox();return t.offsetX=0,t.width=P.width,t.height=P.height,t.offsetY=w.height-t.padding/2,t.intersect=function(e){return j(t,e)},{cluster:v,labelBBox:w}},`rect`),F={rect:P,squareRect:P,roundedWithTitle:l(async(e,t)=>{let n=o(),{themeVariables:i,handDrawnSeed:a}=n,{altBackground:s,compositeBackground:c,compositeTitleBackground:l,nodeBorder:d}=i,f=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look),p=f.insert(`g`,`:first-child`),m=f.insert(`g`).attr(`class`,`cluster-label`),h=f.append(`rect`),g=await M(m,t.label,t.labelStyle,void 0,!0),_=g.getBBox();if(r(n)){let e=g.children[0],t=u(g);_=e.getBoundingClientRect(),t.attr(`width`,_.width),t.attr(`height`,_.height)}let v=0*t.padding,y=v/2,b=(t.width<=_.width+t.padding?_.width+t.padding:t.width)+v;t.width<=_.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height+v,C=t.height+v-_.height-6,w=t.x-b/2,T=t.y-x/2;t.width=b;let E=t.y-t.height/2-y+_.height+2,D;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=S.svg(f),r=t.rx||t.ry?n.path(N(w,T,b,x,10),{roughness:.7,fill:l,fillStyle:`solid`,stroke:d,seed:a}):n.rectangle(w,T,b,x,{seed:a});D=f.insert(()=>r,`:first-child`);let i=n.rectangle(w,E,b,C,{fill:e?s:c,fillStyle:e?`hachure`:`solid`,stroke:d,seed:a});D=f.insert(()=>r,`:first-child`),h=f.insert(()=>i)}else D=p.insert(`rect`,`:first-child`),D.attr(`class`,`outer`).attr(`x`,w).attr(`y`,T).attr(`width`,b).attr(`height`,x).attr(`data-look`,t.look),h.attr(`class`,`inner`).attr(`x`,w).attr(`y`,E).attr(`width`,b).attr(`height`,C);return m.attr(`transform`,`translate(${t.x-_.width/2}, ${T+1-(r(n)?0:3)})`),t.height=D.node().getBBox().height,t.offsetX=0,t.offsetY=_.height-t.padding/2,t.labelBBox=_,t.intersect=function(e){return j(t,e)},{cluster:f,labelBBox:_}},`roundedWithTitle`),noteGroup:l((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 j(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),divider:l((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=o(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),s=a.insert(`g`,`:first-child`),c=0*t.padding,l=t.width+c;t.diff=-t.padding;let u=t.height+c,d=t.x-l/2,f=t.y-u/2;t.width=l;let p;if(t.look===`handDrawn`){let e=S.svg(a).rectangle(d,f,l,u,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else{p=s.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),p.attr(`class`,e).attr(`x`,d).attr(`y`,f).attr(`width`,l).attr(`height`,u).attr(`data-look`,t.look)}return t.height=p.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return j(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:l(async(e,t)=>{c.info(`Creating subgraph rect for `,t.id,t);let n=o(),{themeVariables:i,handDrawnSeed:a}=n,{clusterBkg:s,clusterBorder:l}=i,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:h}=_(t),v=e.insert(`g`).attr(`class`,`cluster `+t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),y=r(n),x=v.insert(`g`).attr(`class`,`cluster-label `),C=await b(x,t.label,{style:t.labelStyle,useHtmlLabels:y,isNode:!0,width:t.width}),w=C.getBBox();if(r(n)){let e=C.children[0],t=u(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=t.width<=w.width+t.padding?w.width+t.padding:t.width;t.width<=w.width+t.padding?t.diff=(T-t.width)/2-t.padding:t.diff=-t.padding;let E=t.height,D=t.x-T/2,O=t.y-E/2;c.trace(`Data `,t,JSON.stringify(t));let k;if(t.look===`handDrawn`){let e=S.svg(v),n=g(t,{roughness:.7,fill:s,stroke:l,fillWeight:4,seed:a}),r=e.path(N(D,O,T,E,t.rx),n);k=v.insert(()=>(c.debug(`Rough node insert CXC`,r),r),`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),k.select(`path`).attr(`style`,h.join(`;`).replace(`fill`,`stroke`))}else k=v.insert(`rect`,`:first-child`),k.attr(`style`,f).attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,D).attr(`y`,O).attr(`width`,T).attr(`height`,E);let{subGraphTitleTopMargin:A}=m(n);if(x.attr(`transform`,`translate(${t.x-w.width/2}, ${t.y-t.height/2+A})`),d){let e=x.select(`span`);e&&e.attr(`style`,d)}let M=k.node().getBBox();return t.offsetX=0,t.width=M.width,t.height=M.height,t.offsetY=w.height-t.padding/2,t.intersect=function(e){return j(t,e)},{cluster:v,labelBBox:w}},`kanbanSection`)},I=new Map,ee=l(async(e,t)=>{let n=await F[t.shape||`rect`](e,t);return I.set(t.id,n),n},`insertCluster`),te=l(()=>{I=new Map},`clear`);function L(e,t){return e.intersect(t)}l(L,`intersectNode`);var R=L;function ne(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}}l(ne,`intersectEllipse`);var z=ne;function B(e,t,n){return z(e,t,t,n)}l(B,`intersectCircle`);var V=B;function H(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&&re(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&&re(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}l(H,`intersectLine`);function re(e,t){return e*t>0}l(re,`sameSign`);var ie=H;function U(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=ie(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}l(U,`intersectPolygon`);var W={node:R,circle:V,ellipse:z,polygon:U,rect:j};function G(e,t){let{labelStyles:n}=_(t);t.labelStyle=n;let r=E(t),i=r;r||(i=`anchor`);let a=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),{cssStyles:o}=t,s=S.svg(a),l=g(t,{fill:`black`,stroke:`none`,fillStyle:`solid`});t.look!==`handDrawn`&&(l.roughness=0);let u=s.circle(0,0,2,l),d=a.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,p(o)),T(t,d),t.intersect=function(e){return c.info(`Circle intersect`,t,1,e),W.circle(t,1,e)},a}l(G,`anchor`);function K(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}l(K,`generateArcPoints`);function ae(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}l(ae,`calculateArcSagitta`);async function oe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=l(e=>e+o,`calcTotalHeight`),c=l(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await C(e,t,E(t)),f=s(t?.height?t?.height:d.height),[p,m]=c(f),h=ae(f,p,m),v=(t?.width?t?.width:d.width)+a*2+h-h,y=f,{cssStyles:b}=t,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...K(-v/2,-y/2,-v/2,y/2,p,m,!1),{x:v/2,y:y/2},...K(v/2,y/2,v/2,-y/2,p,m,!0)],w=S.svg(u),O=g(t,{});t.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`);let k=D(x),A=w.path(k,O),j=u.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),b&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,b),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(${p/2}, 0)`),T(t,j),t.intersect=function(e){return W.polygon(t,x,e)},u}l(oe,`bowTieRect`);function q(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+`)`)}l(q,`insertPolygonShape`);var se=12;async function ce(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+se),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+se,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+se},{x:0+se,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=D(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=q(s,l,u,p);return r&&m.attr(`style`,r),T(t,m),t.intersect=function(e){return W.polygon(t,p,e)},s}l(ce,`card`);function le(e,t){let{nodeStyles:n}=_(t);t.label=``;let r=e.insert(`g`).attr(`class`,E(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=S.svg(r),c=g(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=D(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 W.polygon(t,o,e)},r}l(le,`choice`);async function ue(e,t,n){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s}=await C(e,t,E(t)),l=n?.padding??s,u=t.look===`neo`?o.width/2+32:o.width/2+l,d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=S.svg(a),n=g(t,{}),r=e.circle(0,0,u*2,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,p(f))}else d=a.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return T(t,d),t.calcIntersect=function(e,t){let n=e.width/2;return W.circle(e,n,t)},t.intersect=function(e){return c.info(`Circle intersect`,t,u,e),W.circle(t,u,e)},a}l(ue,`circle`);function de(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
|
+
M ${i.x},${i.y} L ${o.x},${o.y}`}l(de,`createLine`);function fe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n,t.label=``;let i=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:o}=t,s=S.svg(i),l=g(t,{});t.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=s.circle(0,0,a*2,l),d=de(a),f=s.path(d,l),p=i.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),o&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,o),r&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,r),T(t,p),t.intersect=function(e){return c.info(`crossedCircle intersect`,t,{radius:a,point:e}),W.circle(t,a,e)},i}l(fe,`crossedCircle`);function J(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}l(J,`generateCirclePoints`);async function pe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(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=[...J(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...J(l/2+d*2,-d,d,20,-180,-270),...J(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...J(l/2,u/2,d,20,0,90)],m=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...J(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...J(l/2+l*.1,-d,d,20,-180,-270),...J(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...J(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],h=S.svg(i),v=g(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p).replace(`Z`,``),b=h.path(y,v),x=D(m),w=h.path(x,{...v}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.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))})`),T(t,O),t.intersect=function(e){return W.polygon(t,m,e)},i}l(pe,`curlyBraceLeft`);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}l(Y,`generateCirclePoints`);async function me(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(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=[...Y(l/2,-u/2,d,20,-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+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),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],h=S.svg(i),v=g(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p).replace(`Z`,``),b=h.path(y,v),x=D(m),w=h.path(x,{...v}),O=i.insert(`g`,`:first-child`);return O.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),O.insert(()=>b,`:first-child`),O.attr(`class`,`text`),f&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.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))})`),T(t,O),t.intersect=function(e){return W.polygon(t,m,e)},i}l(me,`curlyBraceRight`);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}l(X,`generateCirclePoints`);async function he(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(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,30,-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+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-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},...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-d-d/2,y:u/2+d},...X(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...X(-l/2-d/2,-d,d,20,0,90),...X(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...X(-l/2+d+d/2,u/2,d,30,-180,-270)],v=S.svg(i),y=g(t,{fill:`none`});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=D(p).replace(`Z`,``),x=v.path(b,y),w=D(m).replace(`Z`,``),O=v.path(w,y),k=D(h),A=v.path(k,{...y}),j=i.insert(`g`,`:first-child`);return j.insert(()=>A,`:first-child`).attr(`stroke-opacity`,0),j.insert(()=>x,`:first-child`),j.insert(()=>O,`:first-child`),j.attr(`class`,`text`),f&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.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))})`),T(t,j),t.intersect=function(e){return W.polygon(t,h,e)},i}l(he,`curlyBraces`);async function ge(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:f}=t,p=S.svg(s),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=l,v=u,y=h-d,b=v/4,x=[{x:y,y:0},{x:b,y:0},{x:0,y:v/2},{x:b,y:v},{x:y,y:v},...k(-y,-v/2,d,50,270,90)],w=D(x),O=p.path(w,m),A=s.insert(()=>O,`:first-child`);return A.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&A.selectChildren(`path`).attr(`style`,r),A.attr(`transform`,`translate(${-l/2}, ${-u/2})`),T(t,A),t.intersect=function(e){return W.polygon(t,x,e)},s}l(ge,`curvedTrapezoid`);var _e=l((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=l((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`),ye=l((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),be=8,xe=8;async function Se(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-o,t.width<xe&&(t.width=xe);let n=e/2/(2.5+e/50);t.height=(t.height??0)-a-n*3,t.height<be&&(t.height=be)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=(t.width?t.width:c.width)+o,d=u/2,f=d/(2.5+u/50),m=(t.height?t.height:c.height)+a+f,h,{cssStyles:v}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=ve(0,0,u,m,d,f),r=ye(0,f,u,m,d,f),i=g(t,{}),a=e.path(n,i),o=e.path(r,g(t,{fill:`none`}));h=s.insert(()=>o,`:first-child`),h=s.insert(()=>a,`:first-child`),h.attr(`class`,`basic label-container`),v&&h.attr(`style`,v)}else{let e=_e(0,0,u,m,d,f);h=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(v)).attr(`style`,r)}return h.attr(`label-offset-y`,f),h.attr(`transform`,`translate(${-u/2}, ${-(m/2+f)})`),T(t,h),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(e){let n=W.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}l(Se,`cylinder`);async function Ce(e,t,n){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await C(e,t,E(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=S.svg(a),n=g(t,{}),r=f||m?e.path(N(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 T(t,d),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return W.rect(t,e)},a}l(Ce,`drawRect`);async function we(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ce(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=S.svg(c),n=g(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}l(we,`datastore`);async function Te(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=S.svg(o),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{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}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.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))})`),T(t,x),t.intersect=function(e){return W.rect(t,e)},o}l(Te,`dividedRectangle`);async function Ee(e,t){let{labelStyles:n,nodeStyles:r}=_(t),i=t.look===`neo`?12:5;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?16:a,{shapeSvg:s,bbox:l}=await C(e,t,E(t)),u=(t?.width?t?.width/2:l.width/2)+(o??0),d=u-i,f,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{roughness:.2,strokeWidth:2.5}),r=g(t,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,u*2,n),a=e.circle(0,0,d*2,r);f=s.insert(`g`,`:first-child`),f.attr(`class`,p(t.cssClasses)).attr(`style`,p(m)),f.node()?.appendChild(i),f.node()?.appendChild(a)}else{f=s.insert(`g`,`:first-child`);let e=f.insert(`circle`,`:first-child`),t=f.insert(`circle`);f.attr(`class`,`basic label-container`).attr(`style`,r),e.attr(`class`,`outer-circle`).attr(`style`,r).attr(`r`,u).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,r).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return T(t,f),t.intersect=function(e){return c.info(`DoubleCircle intersect`,t,u,e),W.circle(t,u,e)},s}l(Ee,`doublecircle`);function De(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.label=``,t.labelStyle=r;let a=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:o}=t,s=S.svg(a),{nodeBorder:l}=n,u=g(t,{fillStyle:`solid`});t.look!==`handDrawn`&&(u.roughness=0);let d=s.circle(0,0,14,u),f=a.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),o&&o.length>0&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,o),i&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,i),T(t,f),t.intersect=function(e){return c.info(`filledCircle intersect`,t,{radius:7,point:e}),W.circle(t,7,e)},a}l(De,`filledCircle`);var Oe=10,ke=10;async function Ae(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?i*2:i;(t.width||t.height)&&(t.height=t?.height??0,t.height<Oe&&(t.height=Oe),t.width=(t?.width??0)-a-a/2,t.width<ke&&(t.width=ke));let{shapeSvg:o,bbox:s,label:l}=await C(e,t,E(t)),u=(t?.width?t?.width:s.width)+(a??0),d=t?.height?t?.height:u+s.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:m}=t,h=S.svg(o),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=D(p),b=h.path(y,v),x=o.insert(()=>b,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,r),t.width=u,t.height=d,T(t,x),l.attr(`transform`,`translate(${-s.width/2-(s.x-(s.left??0))}, ${-d/2+(t.padding??0)/2+(s.y-(s.top??0))})`),t.intersect=function(e){return c.info(`Triangle intersect`,t,p,e),W.polygon(t,p,e)},o}l(Ae,`flippedTriangle`);function je(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=_(t);t.label=``;let o=e.insert(`g`).attr(`class`,E(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`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=S.svg(o),p=g(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),T(t,h);let v=r?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(e){return W.rect(t,e)},o}l(je,`forkJoin`);async function Me(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10),t.width=(t?.width??0)-i*2,t.width<15&&(t.width=15));let{shapeSvg:o,bbox:s}=await C(e,t,E(t)),l=(t?.width?t?.width:Math.max(15,s.width))+i*2,u=(t?.height?t?.height:Math.max(10,s.height))+a*2,d=u/2,{cssStyles:f}=t,p=S.svg(o),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...k(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],v=D(h),y=p.path(v,m),b=o.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),T(t,b),t.intersect=function(e){return c.info(`Pill intersect`,t,{radius:d,point:e}),W.polygon(t,h,e)},o}l(Me,`halfRoundedRectangle`);var Ne=l((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 Pe(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(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=S.svg(c),n=g(t,{}),r=Ne(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=q(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,T(t,m),t.intersect=function(e){return W.polygon(t,p,e)},c}l(Pe,`hexagon`);async function Fe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.label=``,t.labelStyle=n;let{shapeSvg:i}=await C(e,t,E(t)),a=Math.max(30,t?.width??0),o=Math.max(30,t?.height??0),{cssStyles:s}=t,l=S.svg(i),u=g(t,{});t.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],f=D(d),p=l.path(f,u),m=i.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),s&&t.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,s),r&&t.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,r),m.attr(`transform`,`translate(${-a/2}, ${-o/2})`),T(t,m),t.intersect=function(e){return c.info(`Pill intersect`,t,{points:d}),W.polygon(t,d,e)},i}l(Fe,`hourglass`);async function Ie(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=_(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,label:f}=await C(e,t,`icon-shape default`),p=t.pos===`t`,m=s,h=s,{nodeBorder:v}=n,{stylesMap:b}=y(t),w=-h/2,E=-m/2,D=t.label?8:0,O=S.svg(u),k=g(t,{stroke:`none`,fill:`none`});t.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`);let A=O.rectangle(w,E,h,m,k),j=Math.max(h,d.width),M=m+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),P=u.insert(()=>A,`:first-child`),F=u.insert(()=>N);if(t.icon){let e=u.append(`g`);e.html(`<g>${await x(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??v};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-M/2:M/2-d.height})`),P.attr(`transform`,`translate(0,${p?d.height/2+D/2:-d.height/2-D/2})`),T(t,F),t.intersect=function(e){if(c.info(`iconSquare intersect`,t,e),!t.label)return W.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=p?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+D},{x:n+h/2,y:r-i/2+d.height+D},{x:n+h/2,y:r+i/2},{x:n-h/2,y:r+i/2},{x:n-h/2,y:r-i/2+d.height+D},{x:n-d.width/2,y:r-i/2+d.height+D}]:[{x:n-h/2,y:r-i/2},{x:n+h/2,y:r-i/2},{x:n+h/2,y:r-i/2+m},{x:n+d.width/2,y:r-i/2+m},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+m},{x:n-h/2,y:r-i/2+m}],W.polygon(t,a,e)},u}l(Ie,`icon`);async function Le(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=_(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,label:f}=await C(e,t,`icon-shape default`),p=t.label?8:0,m=t.pos===`t`,{nodeBorder:h,mainBkg:v}=n,{stylesMap:b}=y(t),w=S.svg(u),E=g(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`),E.stroke=b.get(`fill`)??v;let D=u.append(`g`);t.icon&&D.html(`<g>${await x(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let O=D.node().getBBox(),k=O.width,A=O.height,j=O.x,M=O.y,N=Math.max(k,A)*Math.SQRT2+40,P=w.circle(0,0,N,E),F=Math.max(N,d.width),I=N+d.height+p,ee=w.rectangle(-F/2,-I/2,F,I,{...E,fill:`transparent`,stroke:`none`}),te=u.insert(()=>P,`:first-child`),L=u.insert(()=>ee);return D.attr(`transform`,`translate(${-k/2-j},${m?d.height/2+p/2-A/2-M:-d.height/2-p/2-A/2-M})`),D.attr(`style`,`color: ${b.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),te.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),T(t,L),t.intersect=function(e){return c.info(`iconSquare intersect`,t,e),W.rect(t,e)},u}l(Le,`iconCircle`);async function Re(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=_(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await C(e,t,`icon-shape default`),m=t.pos===`t`,h=s+f*2,v=s+f*2,{nodeBorder:b,mainBkg:w}=n,{stylesMap:E}=y(t),D=-v/2,O=-h/2,k=t.label?8:0,A=S.svg(u),j=g(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,v,h,5),j),P=Math.max(v,d.width),F=h+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>M,`:first-child`).attr(`class`,`icon-shape2`),te=u.insert(()=>I);if(t.icon){let e=u.append(`g`);e.html(`<g>${await x(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),ee.attr(`transform`,`translate(0,${m?d.height/2+k/2:-d.height/2-k/2})`),T(t,te),t.intersect=function(e){if(c.info(`iconSquare intersect`,t,e),!t.label)return W.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=m?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+k},{x:n+v/2,y:r-i/2+d.height+k},{x:n+v/2,y:r+i/2},{x:n-v/2,y:r+i/2},{x:n-v/2,y:r-i/2+d.height+k},{x:n-d.width/2,y:r-i/2+d.height+k}]:[{x:n-v/2,y:r-i/2},{x:n+v/2,y:r-i/2},{x:n+v/2,y:r-i/2+h},{x:n+d.width/2,y:r-i/2+h},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+h},{x:n-v/2,y:r-i/2+h}],W.polygon(t,a,e)},u}l(Re,`iconRounded`);async function ze(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=_(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await C(e,t,`icon-shape default`),m=t.pos===`t`,h=s+f*2,v=s+f*2,{nodeBorder:b,mainBkg:w}=n,{stylesMap:E}=y(t),D=-v/2,O=-h/2,k=t.label?8:0,A=S.svg(u),j=g(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`),j.stroke=E.get(`fill`)??w;let M=A.path(N(D,O,v,h,.1),j),P=Math.max(v,d.width),F=h+d.height+k,I=A.rectangle(-P/2,-F/2,P,F,{...j,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>M,`:first-child`),te=u.insert(()=>I);if(t.icon){let e=u.append(`g`);e.html(`<g>${await x(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+k/2-i/2-o:-d.height/2-k/2-i/2-o})`),e.attr(`style`,`color: ${E.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),ee.attr(`transform`,`translate(0,${m?d.height/2+k/2:-d.height/2-k/2})`),T(t,te),t.intersect=function(e){if(c.info(`iconSquare intersect`,t,e),!t.label)return W.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=m?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+k},{x:n+v/2,y:r-i/2+d.height+k},{x:n+v/2,y:r+i/2},{x:n-v/2,y:r+i/2},{x:n-v/2,y:r-i/2+d.height+k},{x:n-d.width/2,y:r-i/2+d.height+k}]:[{x:n-v/2,y:r-i/2},{x:n+v/2,y:r-i/2},{x:n+v/2,y:r-i/2+h},{x:n+d.width/2,y:r-i/2+h},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+h},{x:n-v/2,y:r-i/2+h}],W.polygon(t,a,e)},u}l(ze,`iconSquare`);async function Be(e,t,{config:{flowchart:n}}){let r=new Image;r.src=t?.img??``,await r.decode();let i=Number(r.naturalWidth.toString().replace(`px`,``)),a=Number(r.naturalHeight.toString().replace(`px`,``));t.imageAspectRatio=i/a;let{labelStyles:o}=_(t);t.labelStyle=o;let s=n?.wrappingWidth;t.defaultWidth=n?.wrappingWidth;let l=Math.max(t.label?s??0:0,t?.assetWidth??i),u=t.constraint===`on`&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,d=t.constraint===`on`?u/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(u,s??0);let{shapeSvg:f,bbox:p,label:m}=await C(e,t,`image-shape default`),h=t.pos===`t`,v=-u/2,y=-d/2,b=t.label?8:0,x=S.svg(f),w=g(t,{});t.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let E=x.rectangle(v,y,u,d,w),D=Math.max(u,p.width),O=d+p.height+b,k=x.rectangle(-D/2,-O/2,D,O,{...w,fill:`none`,stroke:`none`}),A=f.insert(()=>E,`:first-child`),j=f.insert(()=>k);if(t.img){let e=f.append(`image`);e.attr(`href`,t.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?O/2-d:-O/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),A.attr(`transform`,`translate(0,${h?p.height/2+b/2:-p.height/2-b/2})`),T(t,j),t.intersect=function(e){if(c.info(`iconSquare intersect`,t,e),!t.label)return W.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=h?[{x:n-p.width/2,y:r-i/2},{x:n+p.width/2,y:r-i/2},{x:n+p.width/2,y:r-i/2+p.height+b},{x:n+u/2,y:r-i/2+p.height+b},{x:n+u/2,y:r+i/2},{x:n-u/2,y:r+i/2},{x:n-u/2,y:r-i/2+p.height+b},{x:n-p.width/2,y:r-i/2+p.height+b}]:[{x:n-u/2,y:r-i/2},{x:n+u/2,y:r-i/2},{x:n+u/2,y:r-i/2+d},{x:n+p.width/2,y:r-i/2+d},{x:n+p.width/2/2,y:r+i/2},{x:n-p.width/2,y:r+i/2},{x:n-p.width/2,y:r-i/2+d},{x:n-u/2,y:r-i/2+d}],W.polygon(t,a,e)},f}l(Be,`imageSquare`);async function Ve(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=Math.max(c.width+(o??0)*2,t?.width??0),u=Math.max(c.height+(a??0)*2,t?.height??0),d=[{x:0,y:0},{x:l,y:0},{x:l+3*u/6,y:-u},{x:-3*u/6,y:-u}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=D(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),p&&f.attr(`style`,p)}else f=q(s,l,u,d);return r&&f.attr(`style`,r),t.width=l,t.height=u,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}l(Ve,`inv_trapezoid`);async function He(e,t){let{shapeSvg:n,bbox:r,label:i}=await C(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))})`),T(t,a),t.intersect=function(e){return W.rect(t,e)},n}l(He,`labelRect`);async function Ue(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,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=S.svg(s),n=g(t,{}),r=D(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=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}l(Ue,`lean_left`);async function We(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,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=S.svg(s),n=g(t,{}),r=D(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=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}l(We,`lean_right`);function Ge(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.label=``,t.labelStyle=n;let i=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,t?.width??0),s=Math.max(35,t?.height??0),l=[{x:o,y:0},{x:0,y:s+7/2},{x:o-14,y:s+7/2},{x:0,y:2*s},{x:o,y:s-7/2},{x:14,y:s-7/2}],u=S.svg(i),d=g(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=D(l),p=u.path(f,d),m=i.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),a&&t.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,a),r&&t.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,r),m.attr(`transform`,`translate(-${o/2},${-s})`),T(t,m),t.intersect=function(e){return c.info(`lightningBolt intersect`,t,e),W.polygon(t,l,e)},i}l(Ge,`lightningBolt`);var Ke=l((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`),qe=l((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`),Je=l((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Ye=10,Xe=10;async function Ze(e,t){let{labelStyles:n,nodeStyles:r}=_(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<Xe&&(t.width=Xe);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<Ye&&(t.height=Ye)}let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(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,v,{cssStyles:y}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=qe(0,0,u,m,d,f,h),r=Je(0,f,u,m,d,f),i=g(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),v=s.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=Ke(0,0,u,m,d,f,h);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,p(y)).attr(`style`,r)}return v.attr(`label-offset-y`,f),v.attr(`transform`,`translate(${-u/2}, ${-(m/2+f)})`),T(t,v),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=W.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}l(Ze,`linedCylinder`);async function Qe(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(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=S.svg(s),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...O(-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}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.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/2-(c.y-(c.top??0))})`),T(t,x),t.intersect=function(e){return W.polygon(t,y,e)},s}l(Qe,`linedWaveEdgedRect`);async function $e(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(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,v=-m/2,{cssStyles:y}=t,b=S.svg(c),x=g(t,{}),w=[{x:h-s,y:v+s},{x:h-s,y:v+m+s},{x:h+p-s,y:v+m+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v+m-s},{x:h+p+s,y:v+m-s},{x:h+p+s,y:v-s},{x:h+s,y:v-s},{x:h+s,y:v},{x:h,y:v},{x:h,y:v+s}],O=[{x:h,y:v+s},{x:h+p-s,y:v+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v},{x:h,y:v}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let k=D(w),j=b.path(k,x),M=D(O),N=b.path(M,x);t.look!==`handDrawn`&&(j=A(j),N=A(N));let P=c.insert(`g`,`:first-child`);return P.insert(()=>j),P.insert(()=>N),P.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&P.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&P.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))})`),T(t,P),t.intersect=function(e){return W.polygon(t,w,e)},c}l($e,`multiRect`);async function et(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(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,v=-m/2,{cssStyles:y}=t,b=O(h-10,v+m+10,h+d-10,v+m+10,p,.8),x=b?.[b.length-1],w=[{x:h-10,y:v+10},{x:h-10,y:v+m+10},...b,{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:x.y-20},{x:h+d+10,y:x.y-20},{x:h+d+10,y:v-10},{x:h+10,y:v-10},{x:h+10,y:v},{x:h,y:v},{x:h,y:v+10}],k=[{x:h,y:v+10},{x:h+d-10,y:v+10},{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:v},{x:h,y:v}],A=S.svg(i),j=g(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`);let M=D(w),N=A.path(M,j),P=D(k),F=A.path(P,j),I=i.insert(()=>N,`:first-child`);return I.insert(()=>F),I.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&I.selectAll(`path`).attr(`style`,r),I.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p/2-(a.y-(a.top??0))})`),T(t,I),t.intersect=function(e){return W.polygon(t,w,e)},i}l(et,`multiWaveEdgedRectangle`);async function tt(e,t,{config:{themeVariables:n}}){let{labelStyles:a,nodeStyles:o}=_(t);t.labelStyle=a,t.useHtmlLabels||r(i())||(t.centerLabel=!0);let{shapeSvg:s,bbox:c,label:l}=await C(e,t,E(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:m}=t,h=S.svg(s),v=g(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=h.rectangle(f,p,u,d,v),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,m),o&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,o),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,b),t.intersect=function(e){return W.rect(t,e)},s}l(tt,`note`);var nt=l((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 rt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(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=S.svg(i),n=g(t,{}),r=nt(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=q(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),T(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}],i=W.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}l(rt,`question`);async function it(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(t)),u=(t?.width??c.width)+(t.look===`neo`?a*2:a),d=(t?.height??c.height)+(t.look===`neo`?o*2:o),f=-u/2,p=-d/2,m=p/2,h=[{x:f+m,y:p},{x:f,y:0},{x:f+m,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:v}=t,y=S.svg(s),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=D(h),w=y.path(x,b),O=s.insert(()=>w,`:first-child`);return O.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(${-m/2},0)`),l.attr(`transform`,`translate(${-m/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),T(t,O),t.intersect=function(e){return W.polygon(t,h,e)},s}l(it,`rect_left_inv_arrow`);async function at(e,t){let{labelStyles:n,nodeStyles:i}=_(t);t.labelStyle=n;let a;a=t.cssClasses?`node `+t.cssClasses:`node default`;let s=e.insert(`g`).attr(`class`,a).attr(`id`,t.domId||t.id),l=s.insert(`g`),d=s.insert(`g`).attr(`class`,`label`).attr(`style`,i),f=t.description,p=t.label,m=await M(d,p,t.labelStyle,!0,!0),h={width:0,height:0};if(r(o())){let e=m.children[0],t=u(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}c.info(`Text 2`,f);let v=f||[],y=m.getBBox(),b=await M(d,Array.isArray(v)?v.join(`<br/>`):v,t.labelStyle,!0,!0),x=b.children[0],C=u(b);h=x.getBoundingClientRect(),C.attr(`width`,h.width),C.attr(`height`,h.height);let w=(t.padding||0)/2;u(b).attr(`transform`,`translate( `+(h.width>y.width?0:(y.width-h.width)/2)+`, `+(y.height+w+5)+`)`),u(m).attr(`transform`,`translate( `+(h.width<y.width?0:-(y.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-w+3)+`)`);let E=h.width+(t.padding||0),D=h.height+(t.padding||0),O=-h.width/2-w,k=-h.height/2-w,A,j;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=e.path(N(O,k,E,D,t.rx||0),n),i=e.line(-h.width/2-w,-h.height/2-w+y.height+w,h.width/2+w,-h.height/2-w+y.height+w,n);j=s.insert(()=>(c.debug(`Rough node insert CXC`,r),i),`:first-child`),A=s.insert(()=>(c.debug(`Rough node insert CXC`,r),r),`:first-child`)}else A=l.insert(`rect`,`:first-child`),j=l.insert(`line`),A.attr(`class`,`outer title-state`).attr(`style`,i).attr(`x`,-h.width/2-w).attr(`y`,-h.height/2-w).attr(`width`,h.width+(t.padding||0)).attr(`height`,h.height+(t.padding||0)),j.attr(`class`,`divider`).attr(`x1`,-h.width/2-w).attr(`x2`,h.width/2+w).attr(`y1`,-h.height/2-w+y.height+w).attr(`y2`,-h.height/2-w+y.height+w);return T(t,A),t.intersect=function(e){return W.rect(t,e)},s}l(at,`rectWithTitle`);async function ot(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ce(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}l(ot,`roundedRect`);var Z=8;async function st(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?Z:Z*2),u=(t?.height??s.height)+a*2,d=l-Z,f=u,m=Z-l/2,h=-u/2,{cssStyles:v}=t,y=S.svg(o),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m+d,y:h},{x:m+d,y:h+f},{x:m-Z,y:h+f},{x:m-Z,y:h},{x:m,y:h},{x:m,y:h+f}],w=y.polygon(x.map(e=>[e.x,e.y]),b),D=o.insert(()=>w,`:first-child`);return D.attr(`class`,`basic label-container outer-path`).attr(`style`,p(v)),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),v&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${Z/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),T(t,D),t.intersect=function(e){return W.rect(t,e)},o}l(st,`shadedProcess`);async function ct(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(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:v}=t,y=S.svg(s),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],w=D(x),O=y.path(w,b),k=s.insert(()=>O,`:first-child`);return k.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,r),k.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))})`),T(t,k),t.intersect=function(e){return W.polygon(t,x,e)},s}l(ct,`slopedRect`);async function lt(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return Ce(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}l(lt,`squareRect`);async function ut(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:f}=t,p=S.svg(s),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...k(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...k(u/2-d,0,d,50,270,450)],v=D(h),y=p.path(v,m),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),T(t,b),t.intersect=function(e){return W.polygon(t,h,e)},s}l(ut,`stadium`);async function dt(e,t){return Ce(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}l(dt,`state`);function ft(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(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=S.svg(u),f=g(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,v=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),y=u.insert(()=>p,`:first-child`);if(y.insert(()=>v),t.look!==`handDrawn`&&y.attr(`class`,`outer-path`),a&&y.selectAll(`path`).attr(`style`,a),i&&y.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`;y.attr(`style`,`filter:url(#${n})`)}return T(t,y),t.intersect=function(e){return W.circle(t,(t.width??0)/2,e)},u}l(ft,`stateEnd`);function pt(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=S.svg(a).circle(0,0,t.width,v(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 T(t,o),t.intersect=function(e){return W.circle(t,(t.width??7)/2,e)},a}l(pt,`stateStart`);var mt=8;async function ht(e,t){let{labelStyles:n,nodeStyles:r}=_(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 C(e,t,E(t)),l=(t?.width??c.width)+2*mt+a,u=(t?.height??c.height)+o,d=l-2*mt,f=u,m=-l/2,h=-u/2,v=[{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=S.svg(s),n=g(t,{}),r=e.rectangle(m,h,d+16,f,n),i=e.line(m+mt,h,m+mt,h+f,n),a=e.line(m+mt+d,h,m+mt+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)),T(t,o)}else{let e=q(s,d,f,v);r&&e.attr(`style`,r),T(t,e)}return t.intersect=function(e){return W.polygon(t,v,e)},s}l(ht,`subroutine`);var gt=.2;async function _t(e,t){let{labelStyles:n,nodeStyles:r}=_(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-gt*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height?t?.height:c.height)+o*2,u=gt*l,d=gt*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:v}=t,y=S.svg(s),b=g(t,{}),x=[{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}],w=[{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`&&(b.roughness=0,b.fillStyle=`solid`);let O=D(x),k=y.path(O,b),A=D(w),j=y.path(A,{...b,fillStyle:`solid`}),M=s.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),T(t,M),t.intersect=function(e){return W.polygon(t,x,e)},s}l(_t,`taggedRect`);async function vt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await C(e,t,E(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=S.svg(i),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-s/2-s/2*.1,y:f/2},...O(-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}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-u,y:(b+c)*1.3},{x:y+s,y:b+c-d},{x:y+s,y:(b+c)*.9},...O(y+s,(b+c)*1.25,y+s-u,(b+c)*1.3,-c*.02,.5)],w=D(v),k=m.path(w,h),A=D(x),j=m.path(A,{...h,fillStyle:`solid`}),M=i.insert(()=>j,`:first-child`);return M.insert(()=>k,`:first-child`),M.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&M.selectAll(`path`).attr(`style`,r),M.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))})`),T(t,M),t.intersect=function(e){return W.polygon(t,v,e)},i}l(vt,`taggedWaveEdgedRectangle`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await C(e,t,E(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),T(t,u),t.intersect=function(e){return W.rect(t,e)},i}l(yt,`text`);var bt=l((e,t,n,r,i,a)=>`M${e},${t}
|
|
3
|
+
a${i},${a} 0,0,1 0,${-r}
|
|
4
|
+
l${n},0
|
|
5
|
+
a${i},${a} 0,0,1 0,${r}
|
|
6
|
+
M${n},${-r}
|
|
7
|
+
a${i},${a} 0,0,0 0,${r}
|
|
8
|
+
l${-n},0`,`createCylinderPathD`),xt=l((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),St=l((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Ct=5,wt=10;async function Tt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2;if(t.width||t.height){let e=t.height??0;t.height=(t.height??0)-a,t.height<Ct&&(t.height=Ct);let n=e/2/(2.5+e/50);t.width=(t.width??0)-a-n*3,t.width<wt&&(t.width=wt)}let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t.height?t.height:s.height)+a,u=l/2,d=u/(2.5+l/50),f=(t.width?t.width:s.width)+d+a,{cssStyles:m}=t,h;if(t.look===`handDrawn`){let e=S.svg(o),n=xt(0,0,f,l,d,u),r=St(0,0,f,l,d,u),i=e.path(n,g(t,{})),a=e.path(r,g(t,{fill:`none`}));h=o.insert(()=>a,`:first-child`),h=o.insert(()=>i,`:first-child`),h.attr(`class`,`basic label-container`),m&&h.attr(`style`,m)}else{let e=bt(0,0,f,l,d,u);h=o.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,p(m)).attr(`style`,r),h.attr(`class`,`basic label-container outer-path`),m&&h.selectAll(`path`).attr(`style`,m),r&&h.selectAll(`path`).attr(`style`,r)}return h.attr(`label-offset-x`,d),h.attr(`transform`,`translate(${-f/2}, ${l/2} )`),c.attr(`transform`,`translate(${-(s.width/2)-d-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),T(t,h),t.intersect=function(e){let n=W.rect(t,e),r=n.y-(t.y??0);if(u!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-d)){let i=d*d*(1-r*r/(u*u));i!=0&&(i=Math.sqrt(Math.abs(i))),i=d-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},o}l(Tt,`tiltedCylinder`);async function Et(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=S.svg(s),n=g(t,{}),r=D(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=q(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,T(t,f),t.intersect=function(e){return W.polygon(t,d,e)},s}l(Et,`trapezoid`);async function Dt(e,t){let{labelStyles:n,nodeStyles:r}=_(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=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=S.svg(s),p=g(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],h=D(m),v=f.path(h,p),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),T(t,y),t.intersect=function(e){return W.polygon(t,m,e)},s}l(Dt,`trapezoidalPentagon`);var Ot=10,kt=10;async function At(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,s=t.look===`neo`?i*2:i;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<kt&&(t.width=kt),t.height=t?.height??0,t.height<Ot&&(t.height=Ot));let{shapeSvg:l,bbox:u,label:d}=await C(e,t,E(t)),f=a(o().flowchart?.htmlLabels),p=(t?.width?t?.width:u.width)+s,m=t?.height?t?.height:p+u.height,h=m,v=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-m}],{cssStyles:y}=t,b=S.svg(l),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=D(v),O=b.path(w,x),k=l.insert(()=>O,`:first-child`).attr(`transform`,`translate(${-m/2}, ${m/2})`).attr(`class`,`outer-path`);return y&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&k.selectChildren(`path`).attr(`style`,r),t.width=p,t.height=m,T(t,k),d.attr(`transform`,`translate(${-u.width/2-(u.x-(u.left??0))}, ${m/2-(u.height+(t.padding??0)/(f?2:1)-(u.y-(u.top??0)))})`),t.intersect=function(e){return c.info(`Triangle intersect`,t,v,e),W.polygon(t,v,e)},l}l(At,`triangle`);async function jt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await C(e,t,E(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,v=14-d,y=v>0?v/2:0,b=S.svg(c),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=[{x:-d/2-y,y:m/2},...O(-d/2-y,m/2,d/2+y,m/2,p,.8),{x:d/2+y,y:-m/2},{x:-d/2-y,y:-m/2}],k=D(w),A=b.path(k,x),j=c.insert(()=>A,`:first-child`);return j.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),T(t,j),t.intersect=function(e){return W.polygon(t,w,e)},c}l(jt,`waveEdgedRectangle`);async function Mt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await C(e,t,E(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=S.svg(s),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-l/2,y:f/2},...O(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...O(l/2,-f/2,-l/2,-f/2,d,-1)],y=D(v),b=m.path(y,h),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),T(t,x),t.intersect=function(e){return W.polygon(t,v,e)},s}l(Mt,`waveRectangle`);var Q=10;async function Nt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,m=-f/2,{cssStyles:h}=t,v=S.svg(o),y=g(t,{}),b=[{x:p-Q,y:m-Q},{x:p-Q,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-Q}],x=`M${p-Q},${m-Q} L${p+d},${m-Q} L${p+d},${m+f} L${p-Q},${m+f} L${p-Q},${m-Q}
|
|
9
|
+
M${p-Q},${m} L${p+d},${m}
|
|
10
|
+
M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let w=v.path(x,y),D=o.insert(()=>w,`:first-child`);return D.attr(`transform`,`translate(${Q/2}, ${Q/2})`),D.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),T(t,D),t.intersect=function(e){return W.polygon(t,b,e)},o}l(Nt,`windowPane`);var Pt=new Set([`redux-color`,`redux-dark-color`]),Ft=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function It(e,t){let n=t;n.alias&&(t.label=n.alias);let{theme:r,themeVariables:o}=i(),{rowEven:s,rowOdd:c,nodeBorder:l,borderColorArray:d}=o;if(t.look===`handDrawn`){let{themeVariables:n}=i(),{background:r}=n;await It(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let p=i();t.useHtmlLabels=p.htmlLabels;let m=p.er?.diagramPadding??10,h=p.er?.entityPadding??6,{cssStyles:v}=t,{labelStyles:y,nodeStyles:b}=_(t);if(n.attributes.length===0&&t.label){let i={rx:0,ry:0,labelPaddingX:m,labelPaddingY:m*1.5,classes:``};f(t.label,p)+i.labelPaddingX*2<p.er.minEntityWidth&&(t.width=p.er.minEntityWidth);let o=await Ce(e,t,i);if(r!=null&&Pt.has(r)){let e=n.colorIndex??0;o.attr(`data-color-id`,`color-${e%d.length}`)}if(!a(p.htmlLabels)){let e=o.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return o}p.htmlLabels||(m*=1.25,h*=1.25);let x=E(t);x||=`node default`;let C=e.insert(`g`).attr(`class`,x).attr(`id`,t.domId||t.id),w=await Lt(C,t.label??``,p,0,0,[`name`],y);w.height+=h;let D=0,O=[],k=[],A=0,j=0,M=0,N=0,P=!0,F=!0;for(let e of n.attributes){let t=await Lt(C,e.type,p,0,D,[`attribute-type`],y);A=Math.max(A,t.width+m);let n=await Lt(C,e.name,p,0,D,[`attribute-name`],y);j=Math.max(j,n.width+m);let r=await Lt(C,e.keys.join(),p,0,D,[`attribute-keys`],y);M=Math.max(M,r.width+m);let i=await Lt(C,e.comment,p,0,D,[`attribute-comment`],y);N=Math.max(N,i.width+m);let a=Math.max(t.height,n.height,r.height,i.height)+h;k.push({yOffset:D,rowHeight:a}),D+=a}let I=4;M<=m&&(P=!1,M=0,I--),N<=m&&(F=!1,N=0,I--);let ee=C.node().getBBox();if(w.width+m*2-(A+j+M+N)>0){let e=w.width+m*2-(A+j+M+N);A+=e/I,j+=e/I,M>0&&(M+=e/I),N>0&&(N+=e/I)}let te=A+j+M+N,L=S.svg(C),R=g(t,{});t.look!==`handDrawn`&&(R.roughness=0,R.fillStyle=`solid`);let ne=0;k.length>0&&(ne=k.reduce((e,t)=>e+(t?.rowHeight??0),0));let z=Math.max(ee.width+m*2,t?.width||0,te),B=Math.max((ne??0)+w.height,t?.height||0),V=-z/2,H=-B/2;if(C.selectAll(`g:not(:first-child)`).each((e,t,n)=>{let r=u(n[t]),i=r.attr(`transform`),a=0,o=0;if(i){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);e&&(a=parseFloat(e[1]),o=parseFloat(e[2]),r.attr(`class`).includes(`attribute-name`)?a+=A:r.attr(`class`).includes(`attribute-keys`)?a+=A+j:r.attr(`class`).includes(`attribute-comment`)&&(a+=A+j+M))}r.attr(`transform`,`translate(${V+m/2+a}, ${o+H+w.height+h/2})`)}),C.select(`.name`).attr(`transform`,`translate(`+-w.width/2+`, `+(H+h/2)+`)`),r!=null&&Pt.has(r)){let e=n.colorIndex??0;C.attr(`data-color-id`,`color-${e%d.length}`)}let re=L.rectangle(V,H,z,B,R),ie=C.insert(()=>re,`:first-child`).attr(`class`,`outer-path`).attr(`style`,v.join(``));O.push(0);for(let[e,t]of k.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=L.rectangle(V,w.height+H+t?.yOffset,z,t?.rowHeight,{...R,fill:n?s:c,stroke:l});C.insert(()=>r,`g.label`).attr(`style`,v.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let U=1e-4,G=Rt(V,w.height+H,z+V,w.height+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R);if(C.insert(()=>K).attr(`class`,`divider`),G=Rt(A+V,w.height+H,A+V,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`),P){let e=A+j+V;G=Rt(e,w.height+H,e,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}if(F){let e=A+j+M+V;G=Rt(e,w.height+H,e,B+H,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}for(let e of O){let t=w.height+H+e;G=Rt(V,t,z+V,t,U),K=L.polygon(G.map(e=>[e.x,e.y]),R),C.insert(()=>K).attr(`class`,`divider`)}if(T(t,ie),b&&t.look!==`handDrawn`)if(r!=null&&Ft.has(r))C.selectAll(`path`).attr(`style`,b);else{let e=b.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);C.selectAll(`path`).attr(`style`,e??``),C.selectAll(`.row-rect-even path`).attr(`style`,b)}return t.intersect=function(e){return W.rect(t,e)},C}l(It,`erBox`);async function Lt(e,t,r,i=0,o=0,s=[],c=``){let l=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,c);t!==n(t)&&(t=n(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=l.node().appendChild(await b(l,t,{width:f(t,r)+100,style:c,useHtmlLabels:r.htmlLabels},r));if(t.includes(`<`)||t.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let p=d.getBBox();if(a(r.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let t=u(d);p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}return p}l(Lt,`addText`);function Rt(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}l(Rt,`lineToPolygon`);async function zt(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,E(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await Bt(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await Bt(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await Bt(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await Bt(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}l(zt,`textHelper`);async function Bt(n,r,o,s=[]){let c=n.insert(`g`).attr(`class`,`label`).attr(`style`,s.join(`; `)),p=i(),m=`useHtmlLabels`in r?r.useHtmlLabels:a(p.htmlLabels)??!0,h=``;h=`text`in r?r.text:r.label,!m&&h.startsWith(`\\`)&&(h=h.substring(1)),e(h)&&(m=!0);let g=await b(c,t(d(h)),{width:f(h,p)+50,classes:`markdown-node-label`,useHtmlLabels:m},p),_,v=1;if(m){let e=g.children[0],t=u(g);v=e.innerHTML.split(`<br>`).length,e.innerHTML.includes(`</math>`)&&(v+=e.innerHTML.split(`<mrow>`).length-1);let n=e.getElementsByTagName(`img`);if(n){let e=h.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...n].map(t=>new Promise(n=>{function r(){if(t.style.display=`flex`,t.style.flexDirection=`column`,e){let e=p.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,n=parseInt(e,10)*5+`px`;t.style.minWidth=n,t.style.maxWidth=n}else t.style.width=`100%`;n(t)}l(r,`setupImage`),setTimeout(()=>{t.complete&&r()}),t.addEventListener(`error`,r),t.addEventListener(`load`,r)})))}_=e.getBoundingClientRect(),t.attr(`width`,_.width),t.attr(`height`,_.height)}else{s.includes(`font-weight: bolder`)&&u(g).selectAll(`tspan`).attr(`font-weight`,``),v=g.children.length;let e=g.children[0];(g.textContent===``||g.textContent.includes(`>`))&&(e.textContent=h[0]+h.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),h[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),_=g.getBBox()}return c.attr(`transform`,`translate(0,`+(-_.height/(2*v)+o)+`)`),_.height}l(Bt,`addText`);async function Vt(e,t){let n=o(),{themeVariables:r}=n,{useGradient:i}=r,s=n.class.padding??12,c=s,l=t.useHtmlLabels??a(n.htmlLabels)??!0,d=t;d.annotations=d.annotations??[],d.members=d.members??[],d.methods=d.methods??[];let{shapeSvg:f,bbox:p}=await zt(e,t,n,l,c),{labelStyles:m,nodeStyles:h}=_(t);t.labelStyle=m,t.cssStyles=d.styles||``;let v=d.styles?.join(`;`)||h||``;t.cssStyles||=v.replaceAll(`!important`,``).split(`;`);let y=d.members.length===0&&d.methods.length===0&&!n.class?.hideEmptyMembersBox,b=S.svg(f),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let C=Math.max(t.width??0,p.width),w=Math.max(t.height??0,p.height),E=(t.height??0)>p.height;d.members.length===0&&d.methods.length===0?w+=c:d.members.length>0&&d.methods.length===0&&(w+=c*2);let D=-C/2,O=-w/2,k=y?s*2:d.members.length===0&&d.methods.length===0?-s:0;E&&(k=s*2);let A=b.rectangle(D-s,O-s-(y?s:d.members.length===0&&d.methods.length===0?-s/2:0),C+2*s,w+2*s+k,x),j=f.insert(()=>A,`:first-child`);j.attr(`class`,`basic label-container outer-path`);let M=j.node().getBBox(),N=f.select(`.annotation-group`).node().getBBox().height-(y?s/2:0)||0,P=f.select(`.label-group`).node().getBBox().height-(y?s/2:0)||0,F=f.select(`.members-group`).node().getBBox().height-(y?s/2:0)||0,I=(N+P+O+s-(O-s-(y?s:d.members.length===0&&d.methods.length===0?-s/2:0)))/2;if(f.selectAll(`.text`).each((e,t,r)=>{let i=u(r[t]),a=i.attr(`transform`),o=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[2]))}let p=o+O+s-(y?s:d.members.length===0&&d.methods.length===0?-s/2:0);if(i.attr(`class`).includes(`methods-group`)){let e=Math.max(F,c/2);p=E?Math.max(I,N+P+e+O+c*2+s)+c*2:N+P+e+O+c*4+s}d.members.length===0&&d.methods.length===0&&n.class?.hideEmptyMembersBox&&(p=d.annotations.length>0?o-c:o),l||(p-=4);let m=D;(i.attr(`class`).includes(`label-group`)||i.attr(`class`).includes(`annotation-group`))&&(m=-i.node()?.getBBox().width/2||0,f.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(m=0)})),i.attr(`transform`,`translate(${m}, ${p})`)}),d.members.length>0||d.methods.length>0||y){let e=N+P+O+s,n=b.line(M.x,e,M.x+M.width,e+.001,x);f.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!i?` neo-line`:``}`).attr(`style`,v)}if(y||d.members.length>0||d.methods.length>0){let e=N+P+F+O+c*2+s,n=b.line(M.x,E?Math.max(I,e):e,M.x+M.width,(E?Math.max(I,e):e)+.001,x);f.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!i?` neo-line`:``}`).attr(`style`,v)}if(d.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,v),j.select(`:nth-child(2)`).attr(`style`,v),f.selectAll(`.divider`).select(`path`).attr(`style`,v),t.labelStyle?f.selectAll(`span`).attr(`style`,t.labelStyle):f.selectAll(`span`).attr(`style`,v),!l){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(v);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}else if(m){let t=e.exec(m);if(t){let e=t[0].replace(`color`,`fill`);f.selectAll(`tspan`).attr(`style`,e)}}}return T(t,j),t.intersect=function(e){return W.rect(t,e)},f}l(Vt,`classBox`);async function Ht(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t,a=t,s=`verifyMethod`in t,c=E(t),{themeVariables:l}=o(),{borderColorArray:d,requirementEdgeLabelBackground:f}=l,p=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),m;m=s?await $(p,`<<${i.type}>>`,0,t.labelStyle):await $(p,`<<Element>>`,0,t.labelStyle);let h=m,v=await $(p,i.name,h,t.labelStyle+`; font-weight: bold;`);if(h+=v+20,s){let e=await $(p,`${i.requirementId?`ID: ${i.requirementId}`:``}`,h,t.labelStyle);h+=e;let n=await $(p,`${i.text?`Text: ${i.text}`:``}`,h,t.labelStyle);h+=n;let r=await $(p,`${i.risk?`Risk: ${i.risk}`:``}`,h,t.labelStyle);h+=r,await $(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:``}`,h,t.labelStyle)}else{let e=await $(p,`${a.type?`Type: ${a.type}`:``}`,h,t.labelStyle);h+=e,await $(p,`${a.docRef?`Doc Ref: ${a.docRef}`:``}`,h,t.labelStyle)}let y=(p.node()?.getBBox().width??200)+20,b=(p.node()?.getBBox().height??200)+20,x=-y/2,C=-b/2,w=S.svg(p),D=g(t,{});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=w.rectangle(x,C,y,b,D),k=p.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,r),d?.length){let e=t.colorIndex??0;p.attr(`data-color-id`,`color-${e%d.length}`)}if(p.selectAll(`.label`).each((e,t,n)=>{let r=u(n[t]),i=r.attr(`transform`),a=0,o=0;if(i){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);e&&(a=parseFloat(e[1]),o=parseFloat(e[2]))}let s=o-b/2,c=x+20/2;(t===0||t===1)&&(c=a),r.attr(`transform`,`translate(${c}, ${s+20})`)}),h>m+v+20){let e=C+m+v+20,n;if(t.look===`neo`){let t=.001,r=[[x,e],[x+y,e],[x+y,e+t],[x,e+t]];n=w.polygon(r,D)}else n=w.line(x,e,x+y,e,D);p.insert(()=>n).attr(`class`,`divider`)}return T(t,k),t.intersect=function(e){return W.rect(t,e)},r&&t.look!==`handDrawn`&&(f||d?.length)&&p.selectAll(`path`).attr(`style`,r),p}l(Ht,`requirementBox`);async function $(e,n,r,i=``){if(n===``)return 0;let a=e.insert(`g`).attr(`class`,`label`).attr(`style`,i),s=o(),c=s.htmlLabels??!0,l=await b(a,t(d(n)),{width:f(n,s)+50,classes:`markdown-node-label`,useHtmlLabels:c,style:i},s),p;if(c){let e=l.children[0],t=u(l);p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=l.children[0];for(let t of e.children)i&&t.setAttribute(`style`,i);p=l.getBBox(),p.height+=6}return a.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}l($,`addText`);var Ut=l(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function Wt(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await C(e,t,E(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await w(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await w(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:v}=await w(o,`assigned`in t&&t.assigned||``,f);t.width=a;let y=t?.width||0,b=Math.max(m.height,v.height)/2,x=Math.max(s.height+20,t?.height||0)+b,D=-y/2,O=-x/2;c.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+y/2-v.width-20)+`, `+(-b+s.height/2)+`)`);let k,{rx:A,ry:j}=t,{cssStyles:M}=t;if(t.look===`handDrawn`){let e=S.svg(o),n=g(t,{}),r=A||j?e.path(N(D,O,y,x,A||0),n):e.rectangle(D,O,y,x,n);k=o.insert(()=>r,`:first-child`),k.attr(`class`,`basic label-container`).attr(`style`,M||null)}else{k=o.insert(`rect`,`:first-child`),k.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,A??5).attr(`ry`,j??5).attr(`x`,D).attr(`y`,O).attr(`width`,y).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=D+2,r=O+Math.floor((A??0)/2),i=O+x-Math.floor((A??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Ut(e))}}return T(t,k),t.height=x,t.intersect=function(e){return W.rect(t,e)},o}l(Wt,`kanbanItem`);async function Gt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await C(e,t,E(t)),l=a.width+10*o,u=a.height+8*o,d=.15*l,{cssStyles:f}=t,m=a.width+20,h=a.height+20,v=Math.max(l,m),y=Math.max(u,h);s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`);let b,x=`M0 0
|
|
11
|
+
a${d},${d} 1 0,0 ${v*.25},${-1*y*.1}
|
|
12
|
+
a${d},${d} 1 0,0 ${v*.25},0
|
|
13
|
+
a${d},${d} 1 0,0 ${v*.25},0
|
|
14
|
+
a${d},${d} 1 0,0 ${v*.25},${y*.1}
|
|
15
|
+
|
|
16
|
+
a${d},${d} 1 0,0 ${v*.15},${y*.33}
|
|
17
|
+
a${d*.8},${d*.8} 1 0,0 0,${y*.34}
|
|
18
|
+
a${d},${d} 1 0,0 ${-1*v*.15},${y*.33}
|
|
19
|
+
|
|
20
|
+
a${d},${d} 1 0,0 ${-1*v*.25},${y*.15}
|
|
21
|
+
a${d},${d} 1 0,0 ${-1*v*.25},0
|
|
22
|
+
a${d},${d} 1 0,0 ${-1*v*.25},0
|
|
23
|
+
a${d},${d} 1 0,0 ${-1*v*.25},${-1*y*.15}
|
|
24
|
+
|
|
25
|
+
a${d},${d} 1 0,0 ${-1*v*.1},${-1*y*.33}
|
|
26
|
+
a${d*.8},${d*.8} 1 0,0 0,${-1*y*.34}
|
|
27
|
+
a${d},${d} 1 0,0 ${v*.1},${-1*y*.33}
|
|
28
|
+
H0 V0 Z`;if(t.look===`handDrawn`){let e=S.svg(i),n=g(t,{}),r=e.path(x,n);b=i.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,p(f))}else b=i.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`d`,x);return b.attr(`transform`,`translate(${-v/2}, ${-y/2})`),T(t,b),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return c.info(`Bang intersect`,t,e),W.rect(t,e)},i}l(Gt,`bang`);async function Kt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await C(e,t,E(t)),l=a.width+2*o,u=a.height+2*o,d=.15*l,f=.25*l,m=.35*l,h=.2*l,{cssStyles:v}=t,y,b=`M0 0
|
|
29
|
+
a${d},${d} 0 0,1 ${l*.25},${-1*l*.1}
|
|
30
|
+
a${m},${m} 1 0,1 ${l*.4},${-1*l*.1}
|
|
31
|
+
a${f},${f} 1 0,1 ${l*.35},${l*.2}
|
|
32
|
+
|
|
33
|
+
a${d},${d} 1 0,1 ${l*.15},${u*.35}
|
|
34
|
+
a${h},${h} 1 0,1 ${-1*l*.15},${u*.65}
|
|
35
|
+
|
|
36
|
+
a${f},${d} 1 0,1 ${-1*l*.25},${l*.15}
|
|
37
|
+
a${m},${m} 1 0,1 ${-1*l*.5},0
|
|
38
|
+
a${d},${d} 1 0,1 ${-1*l*.25},${-1*l*.15}
|
|
39
|
+
|
|
40
|
+
a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35}
|
|
41
|
+
a${h},${h} 1 0,1 ${l*.1},${-1*u*.65}
|
|
42
|
+
H0 V0 Z`;if(t.look===`handDrawn`){let e=S.svg(i),n=g(t,{}),r=e.path(b,n);y=i.insert(()=>r,`:first-child`),y.attr(`class`,`basic label-container`).attr(`style`,p(v))}else y=i.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`d`,b);return s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),y.attr(`transform`,`translate(${-l/2}, ${-u/2})`),T(t,y),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return c.info(`Cloud intersect`,t,e),W.rect(t,e)},i}l(Kt,`cloud`);async function qt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await C(e,t,E(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?`
|
|
43
|
+
M${-c/2} ${l/2-5}
|
|
44
|
+
v${-l+10}
|
|
45
|
+
q0,-5 5,-5
|
|
46
|
+
h${c-10}
|
|
47
|
+
q5,0 5,5
|
|
48
|
+
v${l-5}
|
|
49
|
+
H${-c/2}
|
|
50
|
+
Z
|
|
51
|
+
`:`
|
|
52
|
+
M${-c/2} ${l/2-5}
|
|
53
|
+
v${-l+10}
|
|
54
|
+
q0,-5 5,-5
|
|
55
|
+
h${c-10}
|
|
56
|
+
q5,0 5,5
|
|
57
|
+
v${l-10}
|
|
58
|
+
q0,5 -5,5
|
|
59
|
+
h${-(c-10)}
|
|
60
|
+
q-5,0 -5,-5
|
|
61
|
+
Z
|
|
62
|
+
`;if(!t.domId)throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let d=i.append(`path`).attr(`id`,t.domId).attr(`class`,`node-bkg node-`+t.type).attr(`style`,r).attr(`d`,u);return i.append(`line`).attr(`class`,`node-line-`).attr(`x1`,-c/2).attr(`y1`,l/2).attr(`x2`,c/2).attr(`y2`,l/2),s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),T(t,d),t.calcIntersect=function(e,t){return W.rect(e,t)},t.intersect=function(e){return W.rect(t,e)},i}l(qt,`defaultMindmapNode`);async function Jt(e,t){return ue(e,t,{padding:t.padding??0})}l(Jt,`mindmapCircle`);var Yt=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:lt},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:ot},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:ut},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:ht},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:Se},{semanticName:`Data Store`,name:`Data Store`,shortName:`datastore`,description:`Data flow diagram data store`,aliases:[`data-store`],handler:we},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:ue},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:Gt},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:Kt},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:rt},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:Pe},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:We},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:Ue},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:Et},{semanticName:`Manual Operation`,name:`Trapezoid Base Top`,shortName:`trap-t`,description:`Represents a manual task`,aliases:[`manual`,`trapezoid-top`,`inv-trapezoid`],internalAliases:[`inv_trapezoid`],handler:Ve},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:Ee},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:yt},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:ce},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:st},{semanticName:`Start`,name:`Small Circle`,shortName:`sm-circ`,description:`Small starting point`,aliases:[`start`,`small-circle`],internalAliases:[`stateStart`],handler:pt},{semanticName:`Stop`,name:`Framed Circle`,shortName:`fr-circ`,description:`Stop point`,aliases:[`stop`,`framed-circle`],internalAliases:[`stateEnd`],handler:ft},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:je},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:Fe},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:pe},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:me},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:he},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:Ge},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:jt},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:Me},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:Tt},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:Ze},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:ge},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:Te},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:At},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:Nt},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:De},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:Dt},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:Ae},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:ct},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:et},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:$e},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:oe},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:fe},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:vt},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:_t},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:Mt},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:it},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:Qe}],Xt=l(()=>{let e=[...Object.entries({state:dt,choice:le,note:tt,rectWithTitle:at,labelRect:He,iconSquare:ze,iconCircle:Le,icon:Ie,iconRounded:Re,imageSquare:Be,anchor:G,kanbanItem:Wt,mindmapCircle:Jt,defaultMindmapNode:qt,classBox:Vt,erBox:It,requirementBox:Ht}),...Yt.flatMap(e=>[e.shortName,...`aliases`in e?e.aliases:[],...`internalAliases`in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(e)},`generateShapeMap`)();function Zt(e){return e in Xt}l(Zt,`isValidShape`);var Qt=new Map;async function $t(e,t,n){let r,i;t.shape===`rect`&&(t.rx&&t.ry?t.shape=`roundedRect`:t.shape=`squareRect`);let a=t.shape?Xt[t.shape]:void 0;if(!a)throw Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;n.config.securityLevel===`sandbox`?o=`_top`:t.linkTarget&&(o=t.linkTarget||`_blank`),r=e.insert(`svg:a`).attr(`xlink:href`,t.link).attr(`target`,o??null),i=await a(r,t,n)}else i=await a(e,t,n),r=i;return r.attr(`data-look`,p(t.look)),t.tooltip&&i.attr(`title`,t.tooltip),Qt.set(t.id,r),t.haveCallback&&r.attr(`class`,r.attr(`class`)+` clickable`),r}l($t,`insertNode`);var en=l((e,t)=>{Qt.set(t.id,e)},`setNodeElem`),tn=l(()=>{Qt.clear()},`clear`),nn=l(e=>{let t=Qt.get(e.id);c.trace(`Transforming node`,e.diff,e,`translate(`+(e.x-e.width/2-5)+`, `+e.width/2+`)`);let n=e.diff||0;return e.clusterNode?t.attr(`transform`,`translate(`+(e.x+n-e.width/2)+`, `+(e.y-e.height/2-8)+`)`):t.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`),n},`positionNode`);export{$t as a,nn as c,ee as i,en as l,tn as n,Zt as o,M as r,C as s,te as t,T as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./src-BTV4tisa.js";function t(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}e(t,`populateCommonDb`);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t,g as n,l as r,n as i,r as a,t as o,v as s,y as c}from"./chunk-NNHCCRGN-DHWtWlDY.js";var l=class extends o{static{n(this,`ArchitectureTokenBuilder`)}constructor(){super([`architecture`])}},u=class extends i{static{n(this,`ArchitectureValueConverter`)}runCustomConverter(e,t,n){if(e.name===`ARCH_ICON`)return t.replace(/[()]/g,``).trim();if(e.name===`ARCH_TEXT_ICON`)return t.replace(/["()]/g,``);if(e.name===`ARCH_TITLE`){let e=t.replace(/^\[|]$/g,``).trim();return(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))&&(e=e.slice(1,-1),e=e.replace(/\\"/g,`"`).replace(/\\'/g,`'`)),e.trim()}}},d={parser:{TokenBuilder:n(()=>new l,`TokenBuilder`),ValueConverter:n(()=>new u,`ValueConverter`)}};function f(n=t){let i=c(s(n),r),o=c(e({shared:i}),a,d);return i.ServiceRegistry.register(o),{shared:i,Architecture:o}}n(f,`createArchitectureServices`);export{f as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,p as t}from"./src-BTV4tisa.js";var n=e((e,n)=>{let r;return n===`sandbox`&&(r=t(`#i`+e)),t(n===`sandbox`?r.nodes()[0].contentDocument.body:`body`).select(`[id="${e}"]`)},`getDiagramElement`);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t,c as n,g as r,i,l as a,t as o,v as s,y as c}from"./chunk-NNHCCRGN-DHWtWlDY.js";var l=class extends o{static{r(this,`InfoTokenBuilder`)}constructor(){super([`info`,`showInfo`])}},u={parser:{TokenBuilder:r(()=>new l,`TokenBuilder`),ValueConverter:r(()=>new i,`ValueConverter`)}};function d(r=t){let i=c(s(r),a),o=c(e({shared:i}),n,u);return i.ServiceRegistry.register(o),{shared:i,Info:o}}r(d,`createInfoServices`);export{d as n,u as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{R as e,h as t,p as n,r,s as i}from"./chunk-CSCIHK7Q-KZCheCnJ.js";import{g as a,h as o,p as s}from"./src-BTV4tisa.js";import{t as c}from"./dist-Qo4xPaJL.js";function l(e){this._context=e}l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function u(e){return new l(e)}var d=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function f(e){return new d(e,!0)}function ee(e){return new d(e,!1)}function p(){}function m(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function h(e){this._context=e}h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:m(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function te(e){return new h(e)}function ne(e){this._context=e}ne.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function re(e){return new ne(e)}function ie(e){this._context=e}ie.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ae(e){return new ie(e)}function oe(e,t){this._basis=new h(e),this._beta=t}oe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var se=(function e(t){function n(e){return t===1?new h(e):new oe(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function g(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function _(e,t){this._context=e,this._k=(1-t)/6}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:g(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:g(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ce=(function e(t){function n(e){return new _(e,t)}return n.tension=function(t){return e(+t)},n})(0);function v(e,t){this._context=e,this._k=(1-t)/6}v.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:g(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var le=(function e(t){function n(e){return new v(e,t)}return n.tension=function(t){return e(+t)},n})(0);function y(e,t){this._context=e,this._k=(1-t)/6}y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:g(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ue=(function e(t){function n(e){return new y(e,t)}return n.tension=function(t){return e(+t)},n})(0);function b(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function de(e,t){this._context=e,this._alpha=t}de.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:b(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var fe=(function e(t){function n(e){return t?new de(e,t):new _(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function pe(e,t){this._context=e,this._alpha=t}pe.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:b(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var me=(function e(t){function n(e){return t?new pe(e,t):new v(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function he(e,t){this._context=e,this._alpha=t}he.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:b(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ge=(function e(t){function n(e){return t?new he(e,t):new y(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function _e(e){this._context=e}_e.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ve(e){return new _e(e)}function ye(e){return e<0?-1:1}function be(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(ye(a)+ye(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function xe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function x(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function S(e){this._context=e}S.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:x(this,this._t0,xe(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,x(this,xe(this,n=be(this,e,t)),n);break;default:x(this,this._t0,n=be(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Se(e){this._context=new Ce(e)}(Se.prototype=Object.create(S.prototype)).point=function(e,t){S.prototype.point.call(this,t,e)};function Ce(e){this._context=e}Ce.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function we(e){return new S(e)}function Te(e){return new Se(e)}function Ee(e){this._context=e}Ee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=De(e),i=De(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function De(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Oe(e){return new Ee(e)}function C(e,t){this._context=e,this._t=t}C.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function w(e){return new C(e,.5)}function T(e){return new C(e,0)}function ke(e){return new C(e,1)}function E(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ae(){}function je(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function D(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Me=`[object RegExp]`,O=`[object String]`,k=`[object Number]`,A=`[object Boolean]`,j=`[object Arguments]`,Ne=`[object Symbol]`,Pe=`[object Date]`,Fe=`[object Map]`,Ie=`[object Set]`,Le=`[object Array]`,Re=`[object ArrayBuffer]`,ze=`[object Object]`,M=`[object DataView]`,Be=`[object Uint8Array]`,Ve=`[object Uint8ClampedArray]`,He=`[object Uint16Array]`,Ue=`[object Uint32Array]`,We=`[object Int8Array]`,Ge=`[object Int16Array]`,Ke=`[object Int32Array]`,qe=`[object Float32Array]`,Je=`[object Float64Array]`,Ye=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)();function N(e){return Ye.Buffer!==void 0&&Ye.Buffer.isBuffer(e)}function Xe(e){return Number.isSafeInteger(e)&&e>=0}function Ze(e){return e!=null&&typeof e!=`function`&&Xe(e.length)}function Qe(e){return e===`__proto__`}function P(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function F(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $e(e,t){return I(e,void 0,e,new Map,t)}function I(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(P(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=I(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,I(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(I(a,void 0,n,r,i));return t}if(N(e))return e.subarray();if(F(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=I(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),L(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),L(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),L(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,L(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),L(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),L(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),L(t,e,n,r,i),t}if(typeof e==`object`&&et(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),L(t,e,n,r,i),t}return e}function L(e,t,n=e,r,i){let a=[...Object.keys(t),...je(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=I(t[s],s,n,r,i))}}function et(e){switch(D(e)){case j:case Le:case Re:case M:case A:case Pe:case qe:case Je:case We:case Ge:case Ke:case Fe:case k:case ze:case Me:case Ie:case O:case Ne:case Be:case Ve:case He:case Ue:return!0;default:return!1}}function tt(e,t){return $e(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(D(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),L(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case k:case O:case A:{let t=new e.constructor(e?.valueOf());return L(t,e),t}case j:{let t={};return L(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function nt(e){return tt(e)}function R(e){return typeof e==`object`&&!!e&&D(e)===`[object Arguments]`}function z(e){return typeof e==`object`&&!!e}function rt(e){return z(e)&&Ze(e)}function B(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(B.Cache||Map),n}B.Cache=Map;function V(e){return F(e)}function it(e){if(P(e))return e;if(Array.isArray(e)||F(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function at(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=H(i,t,r,new Map)}return i}function H(e,t,n,r){if(P(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return it(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...je(t)];for(let a=0;a<i.length;a++){let o=i[a];if(Qe(o))continue;let s=t[o],c=e[o];if(R(s)&&(s={...s}),R(c)&&(c={...c}),N(s)&&(s=nt(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(rt(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||z(c)&&z(s)&&(E(c)||E(s)||V(c)||V(s))?e[o]=H(c,s,n,r):c==null&&E(s)?e[o]=H({},s,n,r):c==null&&V(s)?e[o]=nt(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function ot(e,...t){return at(e,...t,Ae)}var st=c(),ct={curveBasis:te,curveBasisClosed:re,curveBasisOpen:ae,curveBumpX:f,curveBumpY:ee,curveBundle:se,curveCardinalClosed:le,curveCardinalOpen:ue,curveCardinal:ce,curveCatmullRomClosed:me,curveCatmullRomOpen:ge,curveCatmullRom:fe,curveLinear:u,curveLinearClosed:ve,curveMonotoneX:we,curveMonotoneY:Te,curveNatural:Oe,curveStep:w,curveStepAfter:ke,curveStepBefore:T},lt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ut=o(function(t,i){let a=dt(t,/(?:init\b)|(?:initialize\b)/),o={};if(Array.isArray(a)){let t=a.map(e=>e.args);e(t),o=r(o,[...t])}else o=a.args;if(!o)return;let s=n(t,i),c=`config`;return o[c]!==void 0&&(s===`flowchart-v2`&&(s=`flowchart`),o[s]=o[c],delete o[c]),o},`detectInit`),dt=o(function(e,n=null){try{let r=RegExp(`[%]{2}(?![{]${lt.source})(?=[}][%]{2}).*
|
|
2
|
+
`,`ig`);e=e.trim().replace(r,``).replace(/'/gm,`"`),a.debug(`Detecting diagram directive${n===null?``:` type:`+n} based on the text:${e}`);let i,o=[];for(;(i=t.exec(e))!==null;)if(i.index===t.lastIndex&&t.lastIndex++,i&&!n||n&&i[1]?.match(n)||n&&i[2]?.match(n)){let e=i[1]?i[1]:i[2],t=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:e,args:t})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(t){return a.error(`ERROR: ${t.message} - Unable to parse directive type: '${n}' based on the text: '${e}'`),{type:void 0,args:null}}},`detectDirective`),ft=o(function(e){return e.replace(t,``)},`removeDirectives`),pt=o(function(e,t){for(let[n,r]of t.entries())if(r.match(e))return n;return-1},`isSubstringInArray`);function U(e,t){return e?ct[`curve${e.charAt(0).toUpperCase()+e.slice(1)}`]??t:t}o(U,`interpolateToCurve`);function mt(e,t){let n=e.trim();if(n)return t.securityLevel===`loose`?n:(0,st.sanitizeUrl)(n)}o(mt,`formatUrl`);var ht=o((e,...t)=>{let n=e.split(`.`),r=n.length-1,i=n[r],o=window;for(let t=0;t<r;t++)if(o=o[n[t]],!o){a.error(`Function name: ${e} not found in window`);return}o[i](...t)},`runFunc`);function W(e,t){return!e||!t?0:Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}o(W,`distance`);function gt(e){let t,n=0;return e.forEach(e=>{n+=W(e,t),t=e}),G(e,n/2)}o(gt,`traverseEdge`);function _t(e){return e.length===1?e[0]:gt(e)}o(_t,`calcLabelPosition`);var vt=o((e,t=2)=>{let n=10**t;return Math.round(e*n)/n},`roundNumber`),G=o((e,t)=>{let n,r=t;for(let t of e){if(n){let e=W(t,n);if(e===0)return n;if(e<r)r-=e;else{let i=r/e;if(i<=0)return n;if(i>=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:vt((1-i)*n.x+i*t.x,5),y:vt((1-i)*n.y+i*t.y,5)}}}n=t}throw Error(`Could not find a suitable point for the given distance`)},`calculatePoint`),yt=o((e,t,n)=>{a.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());let r=G(t,25),i=e?10:5,o=Math.atan2(t[0].y-r.y,t[0].x-r.x),s={x:0,y:0};return s.x=Math.sin(o)*i+(t[0].x+r.x)/2,s.y=-Math.cos(o)*i+(t[0].y+r.y)/2,s},`calcCardinalityPosition`);function bt(e,t,n){let r=structuredClone(n);a.info(`our points`,r),t!==`start_left`&&t!==`start_right`&&r.reverse();let i=G(r,25+e),o=10+e*.5,s=Math.atan2(r[0].y-i.y,r[0].x-i.x),c={x:0,y:0};return t===`start_left`?(c.x=Math.sin(s+Math.PI)*o+(r[0].x+i.x)/2,c.y=-Math.cos(s+Math.PI)*o+(r[0].y+i.y)/2):t===`end_right`?(c.x=Math.sin(s-Math.PI)*o+(r[0].x+i.x)/2-5,c.y=-Math.cos(s-Math.PI)*o+(r[0].y+i.y)/2-5):t===`end_left`?(c.x=Math.sin(s)*o+(r[0].x+i.x)/2-5,c.y=-Math.cos(s)*o+(r[0].y+i.y)/2-5):(c.x=Math.sin(s)*o+(r[0].x+i.x)/2,c.y=-Math.cos(s)*o+(r[0].y+i.y)/2),c}o(bt,`calcTerminalLabelPosition`);function K(e){let t=``,n=``;for(let r of e)r!==void 0&&(r.startsWith(`color:`)||r.startsWith(`text-align:`)?n=n+r+`;`:t=t+r+`;`);return{style:t,labelStyle:n}}o(K,`getStylesFromArray`);var xt=0,St=o(()=>(xt++,`id-`+Math.random().toString(36).substr(2,12)+`-`+xt),`generateId`);function Ct(e){let t=``;for(let n=0;n<e;n++)t+=`0123456789abcdef`.charAt(Math.floor(Math.random()*16));return t}o(Ct,`makeRandomHex`);var wt=o(e=>Ct(e.length),`random`),Tt=o(function(){return{x:0,y:0,fill:void 0,anchor:`start`,style:`#666`,width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:``}},`getTextObj`),Et=o(function(e,t){let n=t.text.replace(i.lineBreakRegex,` `),[,r]=Z(t.fontSize),a=e.append(`text`);a.attr(`x`,t.x),a.attr(`y`,t.y),a.style(`text-anchor`,t.anchor),a.style(`font-family`,t.fontFamily),a.style(`font-size`,r),a.style(`font-weight`,t.fontWeight),a.attr(`fill`,t.fill),t.class!==void 0&&a.attr(`class`,t.class);let o=a.append(`tspan`);return o.attr(`x`,t.x+t.textMargin*2),o.attr(`fill`,t.fill),o.text(n),a},`drawSimpleText`),Dt=B((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,joinWith:`<br/>`},n),i.lineBreakRegex.test(e)))return e;let r=e.split(` `).filter(Boolean),a=[],o=``;return r.forEach((e,i)=>{let s=J(`${e} `,n),c=J(o,n);if(s>t){let{hyphenatedStrings:r,remainingWord:i}=Ot(e,t,`-`,n);a.push(o,...r),o=i}else c+s>=t?(a.push(o),o=e):o=[o,e].filter(Boolean).join(` `);i+1===r.length&&a.push(o)}),a.filter(e=>e!==``).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),Ot=B((e,t,n=`-`,r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,margin:0},r);let i=[...e],a=[],o=``;return i.forEach((e,s)=>{let c=`${o}${e}`;if(J(c,r)>=t){let e=s+1,t=i.length===e,r=`${c}${n}`;a.push(t?c:r),o=``}else o=c}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n=`-`,r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function q(e,t){return Y(e,t).height}o(q,`calculateTextHeight`);function J(e,t){return Y(e,t).width}o(J,`calculateTextWidth`);var Y=B((e,t)=>{let{fontSize:n=12,fontFamily:r=`Arial`,fontWeight:a=400}=t;if(!e)return{width:0,height:0};let[,o]=Z(n),c=[`sans-serif`,r],l=e.split(i.lineBreakRegex),u=[],d=s(`body`);if(!d.remove)return{width:0,height:0,lineHeight:0};let f=d.append(`svg`);for(let e of c){let t=0,n={width:0,height:0,lineHeight:0};for(let r of l){let i=Tt();i.text=r||``;let s=Et(f,i).style(`font-size`,o).style(`font-weight`,a).style(`font-family`,e),c=(s._groups||s)[0][0].getBBox();if(c.width===0&&c.height===0)throw Error(`svg element not in render tree`);n.width=Math.round(Math.max(n.width,c.width)),t=Math.round(c.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}u.push(n)}return f.remove(),u[isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),kt=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{o(this,`InitIDGenerator`)}},X,At=o(function(e){return X||=document.createElement(`div`),e=escape(e).replace(/%26/g,`&`).replace(/%23/g,`#`).replace(/%3B/g,`;`),X.innerHTML=e,unescape(X.textContent)},`entityDecode`);function jt(e){return`str`in e}o(jt,`isDetailedError`);var Mt=o((e,t,n,r)=>{if(!r)return;let i=e.node()?.getBBox();i&&e.append(`text`).text(r).attr(`text-anchor`,`middle`).attr(`x`,i.x+i.width/2).attr(`y`,-n).attr(`class`,t)},`insertTitle`),Z=o(e=>{if(typeof e==`number`)return[e,e+`px`];let t=parseInt(e??``,10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+`px`]:[t,e]},`parseFontSize`);function Q(e,t){return ot({},e,t)}o(Q,`cleanAndMerge`);var Nt={assignWithDepth:r,wrapLabel:Dt,calculateTextHeight:q,calculateTextWidth:J,calculateTextDimensions:Y,cleanAndMerge:Q,detectInit:ut,detectDirective:dt,isSubstringInArray:pt,interpolateToCurve:U,calcLabelPosition:_t,calcCardinalityPosition:yt,calcTerminalLabelPosition:bt,formatUrl:mt,getStylesFromArray:K,generateId:St,random:wt,runFunc:ht,entityDecode:At,insertTitle:Mt,isLabelCoordinateInPath:$,parseFontSize:Z,InitIDGenerator:kt},Pt=o(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){let t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?`fl°°`+t+`¶ß`:`fl°`+t+`¶ß`}),t},`encodeEntities`),Ft=o(function(e){return e.replace(/fl°°/g,`&#`).replace(/fl°/g,`&`).replace(/¶ß/g,`;`)},`decodeEntities`),It=o((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:``}${e}_${t}_${n}${i?`_${i}`:``}`,`getEdgeId`);function Lt(e){return e??null}o(Lt,`handleUndefinedAttr`);function $(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,e=>Math.round(parseFloat(e)).toString());return i.includes(n.toString())||i.includes(r.toString())}o($,`isLabelCoordinateInPath`);export{ce as $,Je as A,Ne as B,j as C,M as D,A as E,k as F,D as G,Ue as H,ze as I,w as J,ke as K,Me as L,Ke as M,We as N,Pe as O,Fe as P,fe as Q,Ie as R,N as S,Le as T,Be as U,He as V,Ve as W,we as X,Oe as Y,Te as Z,Dt as _,Ft as a,P as b,It as c,U as d,te as et,jt as f,Nt as g,ft as h,Q as i,Ge as j,qe as k,K as l,wt as m,q as n,ee as nt,Pt as o,Z as p,T as q,J as r,u as rt,St as s,Y as t,f as tt,Lt as u,V as v,Re as w,Ze as x,R as y,O as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});export{l as i,s as n,u as r,o as t};
|