All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.mermaid.esm.min.mjs Maven / Gradle / Ivy

Go to download

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

The newest version!
import{a as ht}from"./chunks/mermaid.esm.min/chunk-67GG4VKH.mjs";import{a as Bt}from"./chunks/mermaid.esm.min/chunk-BPW5ZDWE.mjs";import{a as Nt,b as Ut}from"./chunks/mermaid.esm.min/chunk-7LIB5WBN.mjs";import{a as qt}from"./chunks/mermaid.esm.min/chunk-LD4SFGBK.mjs";import"./chunks/mermaid.esm.min/chunk-4DJOK3GT.mjs";import"./chunks/mermaid.esm.min/chunk-A7EQIZZO.mjs";import"./chunks/mermaid.esm.min/chunk-S67DUUA5.mjs";import"./chunks/mermaid.esm.min/chunk-LM6QDVU5.mjs";import{b as St}from"./chunks/mermaid.esm.min/chunk-HMDXFKD7.mjs";import{a as Mt}from"./chunks/mermaid.esm.min/chunk-EXDBZKZY.mjs";import{b as Gt,j as yt,l as Vt,m as G,n as $t,o as Ht}from"./chunks/mermaid.esm.min/chunk-2XY5F2HY.mjs";import"./chunks/mermaid.esm.min/chunk-TI4EEUUG.mjs";import{A as _,B as Ft,C as Y,D as Pe,G as It,M as _t,O as zt,aa as z,b as l,ba as X,c as lt,d as At,f as Tt,g as gt,ga as k,h as Z,i as J,j as Ct,k as Rt,r as tt,u as ut,v as kt,w as Ot,x as Pt,y as Dt,z as jt}from"./chunks/mermaid.esm.min/chunk-ITX3UAHE.mjs";import{d as xt}from"./chunks/mermaid.esm.min/chunk-YPUTD6PB.mjs";import"./chunks/mermaid.esm.min/chunk-6BY5RJGC.mjs";import{a as e,e as Oe}from"./chunks/mermaid.esm.min/chunk-GTKDMUJJ.mjs";var Yt="c4",je=e(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),Fe=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/c4Diagram-AKI3UION.mjs");return{id:Yt,diagram:t}},"loader"),Ie={id:Yt,detector:je,loader:Fe},Xt=Ie;var Wt="flowchart",_e=e((t,r)=>r?.flowchart?.defaultRenderer==="dagre-wrapper"||r?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(t),"detector"),ze=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/flowDiagram-INP2BB3V.mjs");return{id:Wt,diagram:t}},"loader"),Ge={id:Wt,detector:_e,loader:ze},Kt=Ge;var Qt="flowchart-v2",Ve=e((t,r)=>r?.flowchart?.defaultRenderer==="dagre-d3"?!1:(r?.flowchart?.defaultRenderer==="elk"&&(r.layout="elk"),/^\s*graph/.test(t)&&r?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(t)),"detector"),$e=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/flowDiagram-INP2BB3V.mjs");return{id:Qt,diagram:t}},"loader"),He={id:Qt,detector:Ve,loader:$e},Zt=He;var Jt="er",Ne=e(t=>/^\s*erDiagram/.test(t),"detector"),Ue=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/erDiagram-SZV2UBQT.mjs");return{id:Jt,diagram:t}},"loader"),qe={id:Jt,detector:Ne,loader:Ue},tr=qe;var rr="gitGraph",Be=e(t=>/^\s*gitGraph/.test(t),"detector"),Ye=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/gitGraphDiagram-6HF727YA.mjs");return{id:rr,diagram:t}},"loader"),Xe={id:rr,detector:Be,loader:Ye},er=Xe;var ar="gantt",We=e(t=>/^\s*gantt/.test(t),"detector"),Ke=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/ganttDiagram-547IIDY5.mjs");return{id:ar,diagram:t}},"loader"),Qe={id:ar,detector:We,loader:Ke},ir=Qe;var or="info",Ze=e(t=>/^\s*info/.test(t),"detector"),Je=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/infoDiagram-A4XEPD65.mjs");return{id:or,diagram:t}},"loader"),nr={id:or,detector:Ze,loader:Je};var sr="pie",ta=e(t=>/^\s*pie/.test(t),"detector"),ra=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/pieDiagram-XPKEEGBI.mjs");return{id:sr,diagram:t}},"loader"),cr={id:sr,detector:ta,loader:ra};var mr="quadrantChart",ea=e(t=>/^\s*quadrantChart/.test(t),"detector"),aa=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/quadrantDiagram-QS23HHJP.mjs");return{id:mr,diagram:t}},"loader"),ia={id:mr,detector:ea,loader:aa},pr=ia;var dr="xychart",oa=e(t=>/^\s*xychart-beta/.test(t),"detector"),na=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/xychartDiagram-MWHWHLMU.mjs");return{id:dr,diagram:t}},"loader"),sa={id:dr,detector:oa,loader:na},fr=sa;var lr="requirement",ca=e(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),ma=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/requirementDiagram-5WTT3577.mjs");return{id:lr,diagram:t}},"loader"),pa={id:lr,detector:ca,loader:ma},gr=pa;var ur="sequence",da=e(t=>/^\s*sequenceDiagram/.test(t),"detector"),fa=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/sequenceDiagram-7SUASMRF.mjs");return{id:ur,diagram:t}},"loader"),la={id:ur,detector:da,loader:fa},Dr=la;var yr="class",ga=e((t,r)=>r?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t),"detector"),ua=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/classDiagram-LGTRVITY.mjs");return{id:yr,diagram:t}},"loader"),Da={id:yr,detector:ga,loader:ua},xr=Da;var hr="classDiagram",ya=e((t,r)=>/^\s*classDiagram/.test(t)&&r?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t),"detector"),xa=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/classDiagram-v2-UI22WKGF.mjs");return{id:hr,diagram:t}},"loader"),ha={id:hr,detector:ya,loader:xa},Er=ha;var wr="state",Ea=e((t,r)=>r?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t),"detector"),wa=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/stateDiagram-SUF43ZVU.mjs");return{id:wr,diagram:t}},"loader"),ba={id:wr,detector:Ea,loader:wa},br=ba;var Lr="stateDiagram",La=e((t,r)=>!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&r?.state?.defaultRenderer==="dagre-wrapper"),"detector"),va=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/stateDiagram-v2-DVB4EDRD.mjs");return{id:Lr,diagram:t}},"loader"),Sa={id:Lr,detector:La,loader:va},vr=Sa;var Sr="journey",Ma=e(t=>/^\s*journey/.test(t),"detector"),Aa=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/journeyDiagram-5ML6LF3B.mjs");return{id:Sr,diagram:t}},"loader"),Ta={id:Sr,detector:Ma,loader:Aa},Mr=Ta;var Ca=e((t,r,a)=>{l.debug(`rendering svg for syntax error
`);let i=Bt(r),o=i.append("g");i.attr("viewBox","0 0 2412 512"),_t(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${a}`)},"draw"),Et={draw:Ca},Ar=Et;var Ra={db:{},renderer:Et,parser:{parse:e(()=>{},"parse")}},Tr=Ra;var Cr="flowchart-elk",ka=e((t,r={})=>/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&r?.flowchart?.defaultRenderer==="elk"?(r.layout="elk",!0):!1,"detector"),Oa=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/flowDiagram-INP2BB3V.mjs");return{id:Cr,diagram:t}},"loader"),Pa={id:Cr,detector:ka,loader:Oa},Rr=Pa;var kr="timeline",ja=e(t=>/^\s*timeline/.test(t),"detector"),Fa=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/timeline-definition-QPOBMAB2.mjs");return{id:kr,diagram:t}},"loader"),Ia={id:kr,detector:ja,loader:Fa},Or=Ia;var Pr="mindmap",_a=e(t=>/^\s*mindmap/.test(t),"detector"),za=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/mindmap-definition-PE66ZM2U.mjs");return{id:Pr,diagram:t}},"loader"),Ga={id:Pr,detector:_a,loader:za},jr=Ga;var Fr="kanban",Va=e(t=>/^\s*kanban/.test(t),"detector"),$a=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/kanban-definition-EGOKAUOG.mjs");return{id:Fr,diagram:t}},"loader"),Ha={id:Fr,detector:Va,loader:$a},Ir=Ha;var _r="sankey",Na=e(t=>/^\s*sankey-beta/.test(t),"detector"),Ua=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/sankeyDiagram-HGVHE3RK.mjs");return{id:_r,diagram:t}},"loader"),qa={id:_r,detector:Na,loader:Ua},zr=qa;var Gr="packet",Ba=e(t=>/^\s*packet-beta/.test(t),"detector"),Ya=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/diagram-D2J2JSCM.mjs");return{id:Gr,diagram:t}},"loader"),Vr={id:Gr,detector:Ba,loader:Ya};var $r="block",Xa=e(t=>/^\s*block-beta/.test(t),"detector"),Wa=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/blockDiagram-MYUW6R5Q.mjs");return{id:$r,diagram:t}},"loader"),Ka={id:$r,detector:Xa,loader:Wa},Hr=Ka;var Nr="architecture",Qa=e(t=>/^\s*architecture/.test(t),"detector"),Za=e(async()=>{let{diagram:t}=await import("./chunks/mermaid.esm.min/architectureDiagram-QTIGHTN5.mjs");return{id:Nr,diagram:t}},"loader"),Ja={id:Nr,detector:Qa,loader:Za},Ur=Ja;var qr=!1,$=e(()=>{qr||(qr=!0,z("error",Tr,t=>t.toLowerCase().trim()==="error"),z("---",{db:{clear:e(()=>{},"clear")},styles:{},renderer:{draw:e(()=>{},"draw")},parser:{parse:e(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:e(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),J(Xt,Ir,Er,xr,tr,ir,nr,cr,gr,Dr,Rr,Zt,Kt,jr,Or,er,vr,br,Mr,pr,zr,Vr,fr,Hr,Ur))},"addDiagrams");var Br=e(async()=>{l.debug("Loading registered diagrams");let r=(await Promise.allSettled(Object.entries(gt).map(async([a,{detector:i,loader:o}])=>{if(o)try{X(a)}catch{try{let{diagram:n,id:m}=await o();z(m,n,i)}catch(n){throw l.error(`Failed to load external diagram with key ${a}. Removing from detectors.`),delete gt[a],n}}}))).filter(a=>a.status==="rejected");if(r.length>0){l.error(`Failed to load ${r.length} external diagrams`);for(let a of r)l.error(a);throw new Error(`Failed to load ${r.length} external diagrams`)}},"loadRegisteredDiagrams");var rt="comm",et="rule",at="decl";var Yr="@import";var Xr="@keyframes";var Wr="@layer";var wt=Math.abs,W=String.fromCharCode;function it(t){return t.trim()}e(it,"trim");function K(t,r,a){return t.replace(r,a)}e(K,"replace");function Kr(t,r,a){return t.indexOf(r,a)}e(Kr,"indexof");function V(t,r){return t.charCodeAt(r)|0}e(V,"charat");function j(t,r,a){return t.slice(r,a)}e(j,"substr");function h(t){return t.length}e(h,"strlen");function Qr(t){return t.length}e(Qr,"sizeof");function H(t,r){return r.push(t),t}e(H,"append");var ot=1,N=1,Zr=0,w=0,D=0,q="";function nt(t,r,a,i,o,n,m,s){return{value:t,root:r,parent:a,type:i,props:o,children:n,line:ot,column:N,length:m,return:"",siblings:s}}e(nt,"node");function Jr(){return D}e(Jr,"char");function te(){return D=w>0?V(q,--w):0,N--,D===10&&(N=1,ot--),D}e(te,"prev");function b(){return D=w2||U(D)>3?"":" "}e(ae,"whitespace");function ie(t,r){for(;--r&&b()&&!(D<48||D>102||D>57&&D<65||D>70&&D<97););return st(t,Q()+(r<6&&O()==32&&b()==32))}e(ie,"escaping");function bt(t){for(;b();)switch(D){case t:return w;case 34:case 39:t!==34&&t!==39&&bt(D);break;case 40:t===41&&bt(t);break;case 92:b();break}return w}e(bt,"delimiter");function oe(t,r){for(;b()&&t+D!==57;)if(t+D===84&&O()===47)break;return"/*"+st(r,w-1)+"*"+W(t===47?t:b())}e(oe,"commenter");function ne(t){for(;!U(O());)b();return st(t,w)}e(ne,"identifier");function me(t){return ee(mt("",null,null,null,[""],t=re(t),0,[0],t))}e(me,"compile");function mt(t,r,a,i,o,n,m,s,c){for(var g=0,y=0,p=m,x=0,A=0,L=0,f=1,C=1,v=1,u=0,S="",R=o,T=n,E=i,d=S;C;)switch(L=u,u=b()){case 40:if(L!=108&&V(d,p-1)==58){Kr(d+=K(ct(u),"&","&\f"),"&\f",wt(g?s[g-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:d+=ct(u);break;case 9:case 10:case 13:case 32:d+=ae(L);break;case 92:d+=ie(Q()-1,7);continue;case 47:switch(O()){case 42:case 47:H(ti(oe(b(),Q()),r,a,c),c),(U(L||1)==5||U(O()||1)==5)&&h(d)&&j(d,-1,void 0)!==" "&&(d+=" ");break;default:d+="/"}break;case 123*f:s[g++]=h(d)*v;case 125*f:case 59:case 0:switch(u){case 0:case 125:C=0;case 59+y:v==-1&&(d=K(d,/\f/g,"")),A>0&&(h(d)-p||f===0&&L===47)&&H(A>32?ce(d+";",i,a,p-1,c):ce(K(d," ","")+";",i,a,p-2,c),c);break;case 59:d+=";";default:if(H(E=se(d,r,a,g,y,o,s,S,R=[],T=[],p,n),n),u===123)if(y===0)mt(d,r,E,E,R,n,p,s,T);else switch(x===99&&V(d,3)===110?100:x){case 100:case 108:case 109:case 115:mt(t,E,E,i&&H(se(t,E,E,0,0,o,s,S,o,R=[],p,T),T),o,T,p,s,i?R:T);break;default:mt(d,E,E,E,[""],T,0,s,T)}}g=y=A=0,f=v=1,S=d="",p=m;break;case 58:p=1+h(d),A=L;default:if(f<1){if(u==123)--f;else if(u==125&&f++==0&&te()==125)continue}switch(d+=W(u),u*f){case 38:v=y>0?1:(d+="\f",-1);break;case 44:s[g++]=(h(d)-1)*v,v=1;break;case 64:O()===45&&(d+=ct(b())),x=O(),y=p=h(S=d+=ne(Q())),u++;break;case 45:L===45&&h(d)==2&&(f=0)}}return n}e(mt,"parse");function se(t,r,a,i,o,n,m,s,c,g,y,p){for(var x=o-1,A=o===0?n:[""],L=Qr(A),f=0,C=0,v=0;f0?A[u]+" "+S:K(S,/&\f/g,A[u])))&&(c[v++]=R);return nt(t,r,a,o===0?et:s,c,g,y,p)}e(se,"ruleset");function ti(t,r,a,i){return nt(t,r,a,rt,W(Jr()),j(t,2,-2),0,i)}e(ti,"comment");function ce(t,r,a,i,o){return nt(t,r,a,at,j(t,0,i),j(t,i+1,-1),i,o)}e(ce,"declaration");function pt(t,r){for(var a="",i=0;i{le.forEach(t=>{t()}),le=[]},"attachFunctions");var ue=e(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function De(t){let r=t.match(At);if(!r)return{text:t,metadata:{}};let a=Ut(r[1],{schema:Nt})??{};a=typeof a=="object"&&!Array.isArray(a)?a:{};let i={};return a.displayMode&&(i.displayMode=a.displayMode.toString()),a.title&&(i.title=a.title.toString()),a.config&&(i.config=a.config),{text:t.slice(r[0].length),metadata:i}}e(De,"extractFrontMatter");var ai=e(t=>t.replace(/\r\n?/g,`
`).replace(/<(\w+)([^>]*)>/g,(r,a,i)=>"<"+a+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),ii=e(t=>{let{text:r,metadata:a}=De(t),{displayMode:i,title:o,config:n={}}=a;return i&&(n.gantt||(n.gantt={}),n.gantt.displayMode=i),{title:o,config:n,text:r}},"processFrontmatter"),oi=e(t=>{let r=G.detectInit(t)??{},a=G.detectDirective(t,"wrap");return Array.isArray(a)?r.wrap=a.some(({type:i})=>i==="wrap"):a?.type==="wrap"&&(r.wrap=!0),{text:Gt(t),directive:r}},"processDirectives");function Lt(t){let r=ai(t),a=ii(r),i=oi(a.text),o=Vt(a.config,i.directive);return t=ue(i.text),{code:t,title:a.title,config:o}}e(Lt,"preprocessDiagram");function ye(t){let r=new TextEncoder().encode(t),a=Array.from(r,i=>String.fromCodePoint(i)).join("");return btoa(a)}e(ye,"toBase64");var ni=5e4,si="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",ci="sandbox",mi="loose",pi="http://www.w3.org/2000/svg",di="http://www.w3.org/1999/xlink",fi="http://www.w3.org/1999/xhtml",li="100%",gi="100%",ui="border:0;margin:0;",Di="margin:0",yi="allow-top-navigation-by-user-activation allow-popups",xi='The "iframe" tag is not supported by your browser.',hi=["foreignobject"],Ei=["dominant-baseline"];function be(t){let r=Lt(t);return Y(),Ft(r.config??{}),r}e(be,"processAndSetConfigs");async function wi(t,r){$();try{let{code:a,config:i}=be(t);return{diagramType:(await Le(a)).type,config:i}}catch(a){if(r?.suppressErrors)return!1;throw a}}e(wi,"parse");var xe=e((t,r,a=[])=>`
.${t} ${r} { ${a.join(" !important; ")} !important; }`,"cssImportantStyles"),bi=e((t,r=new Map)=>{let a="";if(t.themeCSS!==void 0&&(a+=`
${t.themeCSS}`),t.fontFamily!==void 0&&(a+=`
:root { --mermaid-font-family: ${t.fontFamily}}`),t.altFontFamily!==void 0&&(a+=`
:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),r instanceof Map){let m=t.htmlLabels??t.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];r.forEach(s=>{xt(s.styles)||m.forEach(c=>{a+=xe(s.id,c,s.styles)}),xt(s.textStyles)||(a+=xe(s.id,"tspan",(s?.textStyles||[]).map(c=>c.replace("color","fill"))))})}return a},"createCssStyles"),Li=e((t,r,a,i)=>{let o=bi(t,a),n=zt(r,o,t.themeVariables);return pt(me(`${i}{${n}}`),pe)},"createUserStyles"),vi=e((t="",r,a)=>{let i=t;return!a&&!r&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Ht(i),i=i.replace(/
/g,"
"),i},"cleanUpSvgCode"),Si=e((t="",r)=>{let a=r?.viewBox?.baseVal?.height?r.viewBox.baseVal.height+"px":gi,i=ye(`${t}`);return``},"putIntoIFrame"),he=e((t,r,a,i,o)=>{let n=t.append("div");n.attr("id",a),i&&n.attr("style",i);let m=n.append("svg").attr("id",r).attr("width","100%").attr("xmlns",pi);return o&&m.attr("xmlns:xlink",o),m.append("g"),t},"appendDivSvgG");function Ee(t,r){return t.append("iframe").attr("id",r).attr("style","width: 100%; height: 100%;").attr("sandbox","")}e(Ee,"sandboxedIframe");var Mi=e((t,r,a,i)=>{t.getElementById(r)?.remove(),t.getElementById(a)?.remove(),t.getElementById(i)?.remove()},"removeExistingElements"),Ai=e(async function(t,r,a){$();let i=be(r);r=i.code;let o=_();l.debug(o),r.length>(o?.maxTextSize??ni)&&(r=si);let n="#"+t,m="i"+t,s="#"+m,c="d"+t,g="#"+c,y=e(()=>{let ft=k(x?s:g).node();ft&&"remove"in ft&&ft.remove()},"removeTempElements"),p=k("body"),x=o.securityLevel===ci,A=o.securityLevel===mi,L=o.fontFamily;if(a!==void 0){if(a&&(a.innerHTML=""),x){let M=Ee(k(a),m);p=k(M.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=k(a);he(p,t,c,`font-family: ${L}`,di)}else{if(Mi(document,t,c,m),x){let M=Ee(k("body"),m);p=k(M.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=k("body");he(p,t,c)}let f,C;try{f=await B.fromText(r,{title:i.title})}catch(M){if(o.suppressErrorRendering)throw y(),M;f=await B.fromText("error"),C=M}let v=p.select(g).node(),u=f.type,S=v.firstChild,R=S.firstChild,T=f.renderer.getClasses?.(r,f),E=Li(o,u,T,n),d=document.createElement("style");d.innerHTML=E,S.insertBefore(d,R);try{await f.renderer.draw(r,t,ht,f)}catch(M){throw o.suppressErrorRendering?y():Ar.draw(r,t,ht),M}let Ce=p.select(`${g} svg`),Re=f.db.getAccTitle?.(),ke=f.db.getAccDescription?.();Ci(u,Ce,Re,ke),p.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",fi);let I=p.select(g).node().innerHTML;if(l.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),I=vi(I,x,It(o.arrowMarkerAbsolute)),x){let M=p.select(g+" svg").node();I=Si(I,M)}else A||(I=we.default.sanitize(I,{ADD_TAGS:hi,ADD_ATTR:Ei}));if(ge(),C)throw C;return y(),{diagramType:u,svg:I,bindFunctions:f.db.bindFunctions}},"render");function Ti(t={}){let r=Rt({},t);r?.fontFamily&&!r.themeVariables?.fontFamily&&(r.themeVariables||(r.themeVariables={}),r.themeVariables.fontFamily=r.fontFamily),Ot(r),r?.theme&&r.theme in tt?r.themeVariables=tt[r.theme].getThemeVariables(r.themeVariables):r&&(r.themeVariables=tt.default.getThemeVariables(r.themeVariables));let a=typeof r=="object"?kt(r):Dt();lt(a.logLevel),$()}e(Ti,"initialize");var Le=e((t,r={})=>{let{code:a}=Lt(t);return B.fromText(a,r)},"getDiagramFromText");function Ci(t,r,a,i){de(r,t),fe(r,a,i,r.attr("id"))}e(Ci,"addA11yInfo");var F=Object.freeze({render:Ai,parse:wi,getDiagramFromText:Le,initialize:Ti,getConfig:_,setConfig:jt,getSiteConfig:Dt,updateSiteConfig:Pt,reset:e(()=>{Y()},"reset"),globalReset:e(()=>{Y(ut)},"globalReset"),defaultConfig:ut});lt(_().logLevel);Y(_());var Ri=e((t,r,a)=>{l.warn(t),yt(t)?(a&&a(t.str,t.hash),r.push({...t,message:t.str,error:t})):(a&&a(t),t instanceof Error&&r.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),ve=e(async function(t={querySelector:".mermaid"}){try{await ki(t)}catch(r){if(yt(r)&&l.error(r.str),P.parseError&&P.parseError(r),!t.suppressErrors)throw l.error("Use the suppressErrors option to suppress these errors"),r}},"run"),ki=e(async function({postRenderCallback:t,querySelector:r,nodes:a}={querySelector:".mermaid"}){let i=F.getConfig();l.debug(`${t?"":"No "}Callback function found`);let o;if(a)o=a;else if(r)o=document.querySelectorAll(r);else throw new Error("Nodes and querySelector are both undefined");l.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(l.debug("Start On Load: "+i?.startOnLoad),F.updateSiteConfig({startOnLoad:i?.startOnLoad}));let n=new G.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed),m,s=[];for(let c of Array.from(o)){l.info("Rendering diagram: "+c.id);if(c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");let g=`mermaid-${n.next()}`;m=c.innerHTML,m=Mt(G.entityDecode(m)).trim().replace(//gi,"
");let y=G.detectInit(m);y&&l.debug("Detected early reinit: ",y);try{let{svg:p,bindFunctions:x}=await Te(g,m,c);c.innerHTML=p,t&&await t(g),x&&x(c)}catch(p){Ri(p,s,P.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),Se=e(function(t){F.initialize(t)},"initialize"),Oi=e(async function(t,r,a){l.warn("mermaid.init is deprecated. Please use run instead."),t&&Se(t);let i={postRenderCallback:a,querySelector:".mermaid"};typeof r=="string"?i.querySelector=r:r&&(r instanceof HTMLElement?i.nodes=[r]:i.nodes=r),await ve(i)},"init"),Pi=e(async(t,{lazyLoad:r=!0}={})=>{$(),J(...t),r===!1&&await Br()},"registerExternalDiagrams"),Me=e(function(){if(P.startOnLoad){let{startOnLoad:t}=F.getConfig();t&&P.run().catch(r=>l.error("Mermaid failed to initialize",r))}},"contentLoaded");if(typeof document<"u"){window.addEventListener("load",Me,!1)}var ji=e(function(t){P.parseError=t},"setParseErrorHandler"),dt=[],vt=!1,Ae=e(async()=>{if(!vt){for(vt=!0;dt.length>0;){let t=dt.shift();if(t)try{await t()}catch(r){l.error("Error executing queue",r)}}vt=!1}},"executeQueue"),Fi=e(async(t,r)=>new Promise((a,i)=>{let o=e(()=>new Promise((n,m)=>{F.parse(t,r).then(s=>{n(s),a(s)},s=>{l.error("Error parsing",s),P.parseError?.(s),m(s),i(s)})}),"performCall");dt.push(o),Ae().catch(i)}),"parse"),Te=e((t,r,a)=>new Promise((i,o)=>{let n=e(()=>new Promise((m,s)=>{F.render(t,r,a).then(c=>{m(c),i(c)},c=>{l.error("Error parsing",c),P.parseError?.(c),s(c),o(c)})}),"performCall");dt.push(n),Ae().catch(o)}),"render"),P={startOnLoad:!0,mermaidAPI:F,parse:Fi,render:Te,init:Oi,run:ve,registerExternalDiagrams:Pi,registerLayoutLoaders:qt,initialize:Se,parseError:void 0,contentLoaded:Me,setParseErrorHandler:ji,detectType:Z,registerIconPacks:St},Is=P;export{Is as default}; /*! Check if previously processed */ /*! * Wait for document loaded before starting the execution */




© 2015 - 2024 Weber Informatics LLC | Privacy Policy