import{p as $,d as L,s as B}from"./styles-9a916d00-D-VGWpuv.chunk.mjs";import{l as c,c as d,h as x,z as R,u as j,p as N,t as D,o as A,j as C}from"./mermaid.core-HDjDB8ON.chunk.mjs";import{G as z}from"./graph-DRoBaZeh.chunk.mjs";import{r as G}from"./index-3862675e-CAqQMIGk.chunk.mjs";import"./layout-DgECFbky.chunk.mjs";import"./modulepreload-polyfill-DE-oIJqv.chunk.mjs";import"./emoji-picker-KVqjnXYv.chunk.mjs";import"./vue.runtime.esm-DO2cz8pp.chunk.mjs";import"./clone-DIYugN5p.chunk.mjs";import"./edges-e0da2a9e-DXVAoBsU.chunk.mjs";import"./createText-2e5e7dd3-C0Upl20o.chunk.mjs";import"./line-ewC37cH_.chunk.mjs";import"./array-COaDM5L-.chunk.mjs";import"./path-CUa11n33.chunk.mjs";const k=a=>C.sanitizeText(a,d());let v={dividerMargin:10,padding:5,textHeight:10,curve:void 0};const P=function(a,t,f,n){const e=Object.keys(a);c.info("keys:",e),c.info(a),e.forEach(function(s){var l,r;const o=a[s],i={shape:"rect",id:o.id,domId:o.domId,labelText:k(o.id),labelStyle:"",style:"fill: none; stroke: black",padding:((l=d().flowchart)==null?void 0:l.padding)??((r=d().class)==null?void 0:r.padding)};t.setNode(o.id,i),I(o.classes,t,f,n,o.id),c.info("setNode",i)})},I=function(a,t,f,n,e){const s=Object.keys(a);c.info("keys:",s),c.info(a),s.filter(l=>a[l].parent==e).forEach(function(l){var r,o;const i=a[l],g=i.cssClasses.join(" "),b=N(i.styles),u=i.label??i.id,p=0,y={labelStyle:b.labelStyle,shape:"class_box",labelText:k(u),classData:i,rx:p,ry:p,class:g,style:b.style,id:i.id,domId:i.domId,tooltip:n.db.getTooltip(i.id,e)||"",haveCallback:i.haveCallback,link:i.link,width:i.type==="group"?500:void 0,type:i.type,padding:((r=d().flowchart)==null?void 0:r.padding)??((o=d().class)==null?void 0:o.padding)};t.setNode(i.id,y),e&&t.setParent(i.id,e),c.info("setNode",y)})},q=function(a,t,f,n){c.info(a),a.forEach(function(e,s){var l,r;const o=e,i="",g={labelStyle:"",style:""},b=o.text,u=0,p={labelStyle:g.labelStyle,shape:"note",labelText:k(b),noteData:o,rx:u,ry:u,class:i,style:g.style,id:o.id,domId:o.id,tooltip:"",type:"note",padding:((l=d().flowchart)==null?void 0:l.padding)??((r=d().class)==null?void 0:r.padding)};if(t.setNode(o.id,p),c.info("setNode",p),!o.class||!(o.class in n))return;const y=f+s,h={id:`edgeNote${y}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:D(v.curve,A)};t.setEdge(o.id,o.class,h,y)})},H=function(a,t){const f=d().flowchart;let n=0;a.forEach(function(e){var s;n++;const l={classes:"relation",pattern:e.relation.lineType==1?"dashed":"solid",id:`id_${e.id1}_${e.id2}_${n}`,arrowhead:e.type==="arrow_open"?"none":"normal",startLabelRight:e.relationTitle1==="none"?"":e.relationTitle1,endLabelLeft:e.relationTitle2==="none"?"":e.relationTitle2,arrowTypeStart:E(e.relation.type1),arrowTypeEnd:E(e.relation.type2),style:"fill:none",labelStyle:"",curve:D(f?.curve,A)};if(c.info(l,e),e.style!==void 0){const r=N(e.style);l.style=r.style,l.labelStyle=r.labelStyle}e.text=e.title,e.text===void 0?e.style!==void 0&&(l.arrowheadStyle="fill: #333"):(l.arrowheadStyle="fill: #333",l.labelpos="c",((s=d().flowchart)==null?void 0:s.htmlLabels)??d().htmlLabels?(l.labelType="html",l.label='<span class="edgeLabel">'+e.text+"</span>"):(l.labelType="text",l.label=e.text.replace(C.lineBreakRegex,`
`),e.style===void 0&&(l.style=l.style||"stroke: #333; stroke-width: 1.5px;fill:none"),l.labelStyle=l.labelStyle.replace("color:","fill:"))),t.setEdge(e.id1,e.id2,l,n)})},O=function(a){v={...v,...a}},W=async function(a,t,f,n){c.info("Drawing class - ",t);const e=d().flowchart??d().class,s=d().securityLevel;c.info("config:",e);const l=e?.nodeSpacing??50,r=e?.rankSpacing??50,o=new z({multigraph:!0,compound:!0}).setGraph({rankdir:n.db.getDirection(),nodesep:l,ranksep:r,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),i=n.db.getNamespaces(),g=n.db.getClasses(),b=n.db.getRelations(),u=n.db.getNotes();c.info(b),P(i,o,t,n),I(g,o,t,n),H(b,o),q(u,o,b.length+1,g);let p;s==="sandbox"&&(p=x("#i"+t));const y=s==="sandbox"?x(p.nodes()[0].contentDocument.body):x("body"),h=y.select(`[id="${t}"]`),M=y.select("#"+t+" g");if(await G(M,o,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",t),R.insertTitle(h,"classTitleText",e?.titleTopMargin??5,n.db.getDiagramTitle()),j(o,h,e?.diagramPadding,e?.useMaxWidth),!e?.htmlLabels){const T=s==="sandbox"?p.nodes()[0].contentDocument:document,_=T.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const w of _){const S=w.getBBox(),m=T.createElementNS("http://www.w3.org/2000/svg","rect");m.setAttribute("rx",0),m.setAttribute("ry",0),m.setAttribute("width",S.width),m.setAttribute("height",S.height),w.insertBefore(m,w.firstChild)}}};function E(a){let t;switch(a){case 0:t="aggregation";break;case 1:t="extension";break;case 2:t="composition";break;case 3:t="dependency";break;case 4:t="lollipop";break;default:t="none"}return t}const F={setConf:O,draw:W},ne={parser:$,db:L,renderer:F,styles:B,init:a=>{a.class||(a.class={}),a.class.arrowMarkerAbsolute=a.arrowMarkerAbsolute,L.clear()}};export{ne as diagram};
//# sourceMappingURL=classDiagram-v2-f2320105-CE6JEf99.chunk.mjs.map
