const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./D3y9anC-.js","./BPIjghTi.js","./DK-WlHtW.js","./aOqHWlj_.js","./BmvR-NrQ.js","./CqO_RI43.js","./epa0ZiVV.js","./DcJ8iuRm.js","./PtNrOtCH.js","./_QcEZML-.js","./DRgdeDNL.js","./CrxnWFSq.js","./B0TzqMYt.js","./DSxp2KL8.js","./BvBpFmhw.js","./pyzbNqqX.js","./D4Wz2S-4.js","./g5WIbKL_.js","./CwQYcPXW.js","./BQaXIfA_.js","./D6-XlEtG.js","./CpIVI4vC.js","./612YmpMR.js","./Dqt0tmm0.js","./CoHvh17m.js","./DAnkZUzu.js","./B0aRNutt.js","./BhUhi1co.js","./Ab8Xy81f.js","./By9IZPwN.js","./BDG18TR1.js","./DIA1DMOn.js","./B5uDns6T.js","./BTR633k1.js","./Dp1pzeXC.js","./F8doVSIJ.js","./DnSL_6N-.js","./C1Z1OdSJ.js","./ze1ubmKK.js","./Gi6I4Gst.js","./DX6XiGOO.js","./CdMvPzYr.js","./qJA_R-Pe.js","./DbDuQf8I.js","./CmKTTxBW.js","./SYUzGyh8.js","./Cl9g7VsS.js","./BNl0h4eM.js","./CGIUakMK.js","./BwATMaV-.js","./Dsv1Ia1I.js","./B_22ZBxV.js","./apjT66B3.js","./BNXiKgeY.js","./gdiYiKWA.js","./DofzlwI6.js","./D_SpOcGe.js","./mDtrOgU0.js","./1hSgGEa5.js","./CD7AgA-4.js","./kQcK2Dy-.js","./Dbe2mv4M.js","./DByjOOMR.js","./CsbKBAC5.js","./CvRRIfj-.js","./dQZt1brs.js"])))=>i.map(i=>d[i]); var _p=Object.defineProperty;var wp=(e,t,r)=>t in e?_p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var yt=(e,t,r)=>wp(e,typeof t!="symbol"?t+"":t,r);import{_ as dt}from"./Dp1pzeXC.js";import{g as Sp}from"./D6-XlEtG.js";import{s as ot}from"./CpIVI4vC.js";import{e as kl,m as Js}from"./aOqHWlj_.js";import{g as ho,U as uo,e as vp,f as Tp,S as Lp,b as Bp,a as Ap}from"./DK-WlHtW.js";import{r as Mp,a as _l,b as Ep,i as fo}from"./CqO_RI43.js";import{a as ba,i as $p}from"./BmvR-NrQ.js";import{o as Fp,d as wl,i as Sl,a as Dp,b as Op,c as po}from"./epa0ZiVV.js";import{i as go}from"./B0TzqMYt.js";var Ri={exports:{}},Rp=Ri.exports,mo;function Ip(){return mo||(mo=1,(function(e,t){(function(r,i){e.exports=i()})(Rp,(function(){var r=1e3,i=6e4,a=36e5,s="millisecond",o="second",n="minute",l="hour",c="day",h="week",u="month",f="quarter",d="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var M=["th","st","nd","rd"],L=A%100;return"["+A+(M[(L-20)%10]||M[L]||M[0])+"]"}},k=function(A,M,L){var E=String(A);return!E||E.length>=M?A:""+Array(M+1-E.length).join(L)+A},v={s:k,z:function(A){var M=-A.utcOffset(),L=Math.abs(M),E=Math.floor(L/60),B=L%60;return(M1)return A(Y[0])}else{var H=M.name;C[H]=M,B=H}return!E&&B&&(S=B),B||!E&&S},R=function(A,M){if(F(A))return A.clone();var L=typeof M=="object"?M:{};return L.date=A,L.args=arguments,new z(L)},$=v;$.l=P,$.i=F,$.w=function(A,M){return R(A,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var z=(function(){function A(L){this.$L=P(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[T]=!0}var M=A.prototype;return M.parse=function(L){this.$d=(function(E){var B=E.date,W=E.utc;if(B===null)return new Date(NaN);if($.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var Y=B.match(y);if(Y){var H=Y[2]-1||0,ut=(Y[7]||"0").substring(0,3);return W?new Date(Date.UTC(Y[1],H,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ut)):new Date(Y[1],H,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ut)}}return new Date(B)})(L),this.init()},M.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},M.$utils=function(){return $},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(L,E){var B=R(L);return this.startOf(E)vl(e,"name",{value:t,configurable:!0}),zp=(e,t)=>{for(var r in t)vl(e,r,{get:t[r],enumerable:!0})},Se={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},D={trace:p((...e)=>{},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},tn=p(function(e="fatal"){let t=Se.fatal;typeof e=="string"?e.toLowerCase()in Se&&(t=Se[e]):typeof e=="number"&&(t=e),D.trace=()=>{},D.debug=()=>{},D.info=()=>{},D.warn=()=>{},D.error=()=>{},D.fatal=()=>{},t`%c${Np().format("ss.SSS")} : ${e} : `,"format");const Ii={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:ee>=255?255:ee>=255?255:ee%360,s:e=>e>=100?100:ee>=100?100:ee>=1?1:e{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r1&&(r-=1),r{if(!t)return r*2.55;e/=360,t/=100,r/=100;const a=r<.5 ii.hue2rgb>{e/=255,t/=255,r/=255;const a=Math.max(e,t,r),s=Math.min(e,t,r),o=(a+s)/2;if(i==="l")return o*100;if(a===s)return 0;const n=a-s,l=o>.5?n/(2-a-s):n/(a+s);if(i==="s")return l*100;switch(a){case e:return((t-r)/n+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},qp={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},it={channel:Ii,lang:Wp,unit:qp},Fe={};for(let e=0;e{if(e.charCodeAt(0)!==35)return;const t=e.match(pr.re);if(!t)return;const r=t[1],i=parseInt(r,16),a=r.length,s=a%4===0,o=a>4,n=o?1:17,l=o?8:4,c=s?0:-1,h=o?255:15;return Ca.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a}=e;return a{const t=e.match(Ve.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return it.channel.clamp.h(parseFloat(r)*.9);case"rad":return it.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return it.channel.clamp.h(parseFloat(r)*360)}}return it.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Ve.re);if(!r)return;const[,i,a,s,o,n]=r;return Ca.set({h:Ve._hue2deg(i),s:it.channel.clamp.s(parseFloat(a)),l:it.channel.clamp.l(parseFloat(s)),a:o?it.channel.clamp.a(n?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a}=e;return a{e=e.toLowerCase();const t=Qr.colors[e];if(t)return pr.parse(t)},stringify:e=>{const t=pr.stringify(e);for(const r in Qr.colors)if(Qr.colors[r]===t)return r}},Gr={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Gr.re);if(!r)return;const[,i,a,s,o,n,l,c,h]=r;return Ca.set({r:it.channel.clamp.r(a?parseFloat(i)*2.55:parseFloat(i)),g:it.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:it.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?it.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a}=e;return a{if(typeof e!="string")return e;const t=pr.parse(e)||Gr.parse(e)||Ve.parse(e)||Qr.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Ot.HSL)||e.data.r===void 0?Ve.stringify(e):e.a{const r=be.parse(e);for(const i in t)r[i]=it.channel.clamp[i](t[i]);return be.stringify(r)},Jr=(e,t,r=0,i=1)=>{if(typeof e!="number")return Tl(e,{a:t});const a=Ca.set({r:it.channel.clamp.r(e),g:it.channel.clamp.g(t),b:it.channel.clamp.b(r),a:it.channel.clamp.a(i)});return be.stringify(a)},Yp=e=>{const{r:t,g:r,b:i}=be.parse(e),a=.2126*it.channel.toLinear(t)+.7152*it.channel.toLinear(r)+.0722*it.channel.toLinear(i);return it.lang.round(a)},Up=e=>Yp(e)>=.5,di=e=>!Up(e),Ll=(e,t,r)=>{const i=be.parse(e),a=i[t],s=it.channel.clamp[t](a+r);return a!==s&&(i[t]=s),be.stringify(i)},j=(e,t)=>Ll(e,"l",t),J=(e,t)=>Ll(e,"l",-t),w=(e,t)=>{const r=be.parse(e),i={};for(const a in t)t[a]&&(i[a]=r[a]+t[a]);return Tl(e,i)},Gp=(e,t,r=50)=>{const{r:i,g:a,b:s,a:o}=be.parse(e),{r:n,g:l,b:c,a:h}=be.parse(t),u=r/100,f=u*2-1,d=o-h,m=((f*d===-1?f:(f+d)/(1+f*d))+1)/2,y=1-m,x=i*m+n*y,b=a*m+l*y,k=s*m+c*y,v=o*u+h*(1-u);return Jr(x,b,k,v)},N=(e,t=100)=>{const r=be.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Gp(r,e,t)};/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:Bl,setPrototypeOf:yo,isFrozen:Vp,getPrototypeOf:Xp,getOwnPropertyDescriptor:Zp}=Object;let{freeze:Ut,seal:ae,create:Pi}=Object,{apply:us,construct:ds}=typeof Reflect2?i-2:0),s=2;s1?r-1:0),a=1;a1?r-1:0),a=1;a2&&arguments[2]!==void 0?arguments[2]:Ni;yo&&yo(e,null);let i=t.length;for(;i--;){let a=t[i];if(typeof a=="string"){const s=r(a);s!==a&&(Vp(t)||(t[i]=s),a=s)}e[a]=!0}return e}function rg(e){for(let t=0;t/gm),og=ae(/\$\{[\w\W]*/gm),lg=ae(/^data-[\-\w.\u00B7-\uFFFF]+$/),cg=ae(/^aria-[\-\w]+$/),Al=ae(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hg=ae(/^(?:\w+script|data):/i),ug=ae(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ml=ae(/^html$/i),dg=ae(/^[a-z][.\w]*(-[.\w]+)+$/i);var wo=Object.freeze({__proto__:null,ARIA_ATTR:cg,ATTR_WHITESPACE:ug,CUSTOM_ELEMENT:dg,DATA_ATTR:lg,DOCTYPE_NAME:Ml,ERB_EXPR:ng,IS_ALLOWED_URI:Al,IS_SCRIPT_OR_DATA:hg,MUSTACHE_EXPR:sg,TMPLIT_EXPR:og});const zr={element:1,text:3,progressingInstruction:7,comment:8,document:9},fg=function(){return typeof window>"u"?null:window},pg=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(i=r.getAttribute(a));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},So=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function El(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fg();const t=Q=>El(Q);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==zr.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const i=r,a=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:n,Element:l,NodeFilter:c,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:d}=e,g=l.prototype,m=Nr(g,"cloneNode"),y=Nr(g,"remove"),x=Nr(g,"nextSibling"),b=Nr(g,"childNodes"),k=Nr(g,"parentNode");if(typeof o=="function"){const Q=r.createElement("template");Q.content&&Q.content.ownerDocument&&(r=Q.content.ownerDocument)}let v,S="";const{implementation:C,createNodeIterator:T,createDocumentFragment:F,getElementsByTagName:P}=r,{importNode:R}=i;let $=So();t.isSupported=typeof Bl=="function"&&typeof k=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:O,TMPLIT_EXPR:A,DATA_ATTR:M,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:E,ATTR_WHITESPACE:B,CUSTOM_ELEMENT:W}=wo;let{IS_ALLOWED_URI:Y}=wo,H=null;const ut=lt({},[...bo,...Za,...Ka,...Qa,...Co]);let at=null;const xt=lt({},[...ko,...Ja,..._o,...Li]);let st=Object.seal(Pi(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),nt=null,ct=null;const mt=Object.seal(Pi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ct=!0,bt=!0,St=!1,ne=!0,ee=!1,$e=!0,He=!1,Pa=!1,Na=!1,ar=!1,Ci=!1,ki=!1,Gn=!0,Vn=!1;const pp="user-content-";let za=!0,Dr=!1,sr={},fe=null;const Wa=lt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Xn=null;const Zn=lt({},["audio","video","img","source","image","track"]);let qa=null;const Kn=lt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_i="http://www.w3.org/1998/Math/MathML",wi="http://www.w3.org/2000/svg",ke="http://www.w3.org/1999/xhtml";let nr=ke,Ha=!1,ja=null;const gp=lt({},[_i,wi,ke],Va);let Si=lt({},["mi","mo","mn","ms","mtext"]),vi=lt({},["annotation-xml"]);const mp=lt({},["title","style","font","a","script"]);let Or=null;const yp=["application/xhtml+xml","text/html"],xp="text/html";let Lt=null,or=null;const bp=r.createElement("form"),Qn=function(_){return _ instanceof RegExp||_ instanceof Function},Ya=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(or&&or===_)){if((!_||typeof _!="object")&&(_={}),_=ge(_),Or=yp.indexOf(_.PARSER_MEDIA_TYPE)===-1?xp:_.PARSER_MEDIA_TYPE,Lt=Or==="application/xhtml+xml"?Va:Ni,H=Jt(_,"ALLOWED_TAGS")?lt({},_.ALLOWED_TAGS,Lt):ut,at=Jt(_,"ALLOWED_ATTR")?lt({},_.ALLOWED_ATTR,Lt):xt,ja=Jt(_,"ALLOWED_NAMESPACES")?lt({},_.ALLOWED_NAMESPACES,Va):gp,qa=Jt(_,"ADD_URI_SAFE_ATTR")?lt(ge(Kn),_.ADD_URI_SAFE_ATTR,Lt):Kn,Xn=Jt(_,"ADD_DATA_URI_TAGS")?lt(ge(Zn),_.ADD_DATA_URI_TAGS,Lt):Zn,fe=Jt(_,"FORBID_CONTENTS")?lt({},_.FORBID_CONTENTS,Lt):Wa,nt=Jt(_,"FORBID_TAGS")?lt({},_.FORBID_TAGS,Lt):ge({}),ct=Jt(_,"FORBID_ATTR")?lt({},_.FORBID_ATTR,Lt):ge({}),sr=Jt(_,"USE_PROFILES")?_.USE_PROFILES:!1,Ct=_.ALLOW_ARIA_ATTR!==!1,bt=_.ALLOW_DATA_ATTR!==!1,St=_.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=_.SAFE_FOR_TEMPLATES||!1,$e=_.SAFE_FOR_XML!==!1,He=_.WHOLE_DOCUMENT||!1,ar=_.RETURN_DOM||!1,Ci=_.RETURN_DOM_FRAGMENT||!1,ki=_.RETURN_TRUSTED_TYPE||!1,Na=_.FORCE_BODY||!1,Gn=_.SANITIZE_DOM!==!1,Vn=_.SANITIZE_NAMED_PROPS||!1,za=_.KEEP_CONTENT!==!1,Dr=_.IN_PLACE||!1,Y=_.ALLOWED_URI_REGEXP||Al,nr=_.NAMESPACE||ke,Si=_.MATHML_TEXT_INTEGRATION_POINTS||Si,vi=_.HTML_INTEGRATION_POINTS||vi,st=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&Qn(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(st.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&Qn(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(st.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(st.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ee&&(bt=!1),Ci&&(ar=!0),sr&&(H=lt({},Co),at=Pi(null),sr.html===!0&&(lt(H,bo),lt(at,ko)),sr.svg===!0&&(lt(H,Za),lt(at,Ja),lt(at,Li)),sr.svgFilters===!0&&(lt(H,Ka),lt(at,Ja),lt(at,Li)),sr.mathMl===!0&&(lt(H,Qa),lt(at,_o),lt(at,Li))),Jt(_,"ADD_TAGS")||(mt.tagCheck=null),Jt(_,"ADD_ATTR")||(mt.attributeCheck=null),_.ADD_TAGS&&(typeof _.ADD_TAGS=="function"?mt.tagCheck=_.ADD_TAGS:(H===ut&&(H=ge(H)),lt(H,_.ADD_TAGS,Lt))),_.ADD_ATTR&&(typeof _.ADD_ATTR=="function"?mt.attributeCheck=_.ADD_ATTR:(at===xt&&(at=ge(at)),lt(at,_.ADD_ATTR,Lt))),_.ADD_URI_SAFE_ATTR&&lt(qa,_.ADD_URI_SAFE_ATTR,Lt),_.FORBID_CONTENTS&&(fe===Wa&&(fe=ge(fe)),lt(fe,_.FORBID_CONTENTS,Lt)),_.ADD_FORBID_CONTENTS&&(fe===Wa&&(fe=ge(fe)),lt(fe,_.ADD_FORBID_CONTENTS,Lt)),za&&(H["#text"]=!0),He&&lt(H,["html","head","body"]),H.table&&(lt(H,["tbody"]),delete nt.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=_.TRUSTED_TYPES_POLICY,S=v.createHTML("")}else v===void 0&&(v=pg(d,a)),v!==null&&typeof S=="string"&&(S=v.createHTML(""));Ut&&Ut(_),or=_}},Jn=lt({},[...Za,...Ka,...ig]),to=lt({},[...Qa,...ag]),Cp=function(_){let I=k(_);(!I||!I.tagName)&&(I={namespaceURI:nr,tagName:"template"});const X=Ni(_.tagName),kt=Ni(I.tagName);return ja[_.namespaceURI]?_.namespaceURI===wi?I.namespaceURI===ke?X==="svg":I.namespaceURI===_i?X==="svg"&&(kt==="annotation-xml"||Si[kt]):!!Jn[X]:_.namespaceURI===_i?I.namespaceURI===ke?X==="math":I.namespaceURI===wi?X==="math"&&vi[kt]:!!to[X]:_.namespaceURI===ke?I.namespaceURI===wi&&!vi[kt]||I.namespaceURI===_i&&!Si[kt]?!1:!to[X]&&(mp[X]||!Jn[X]):!!(Or==="application/xhtml+xml"&&ja[_.namespaceURI]):!1},pe=function(_){Rr(t.removed,{element:_});try{k(_).removeChild(_)}catch{y(_)}},je=function(_,I){try{Rr(t.removed,{attribute:I.getAttributeNode(_),from:I})}catch{Rr(t.removed,{attribute:null,from:I})}if(I.removeAttribute(_),_==="is")if(ar||Ci)try{pe(I)}catch{}else try{I.setAttribute(_,"")}catch{}},eo=function(_){let I=null,X=null;if(Na)_=""+_;else{const vt=Xa(_,/^[\r\n\t ]+/);X=vt&&vt[0]}Or==="application/xhtml+xml"&&nr===ke&&(_=''+_+"");const kt=v?v.createHTML(_):_;if(nr===ke)try{I=new f().parseFromString(kt,Or)}catch{}if(!I||!I.documentElement){I=C.createDocument(nr,"template",null);try{I.documentElement.innerHTML=Ha?S:kt}catch{}}const Dt=I.body||I.documentElement;return _&&X&&Dt.insertBefore(r.createTextNode(X),Dt.childNodes[0]||null),nr===ke?P.call(I,He?"html":"body")[0]:He?I.documentElement:Dt},ro=function(_){return T.call(_.ownerDocument||_,_,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ua=function(_){return _ instanceof u&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof h)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},io=function(_){return typeof n=="function"&&_ instanceof n};function _e(Q,_,I){Ti(Q,X=>{X.call(t,_,I,or)})}const ao=function(_){let I=null;if(_e($.beforeSanitizeElements,_,null),Ua(_))return pe(_),!0;const X=Lt(_.nodeName);if(_e($.uponSanitizeElement,_,{tagName:X,allowedTags:H}),$e&&_.hasChildNodes()&&!io(_.firstElementChild)&&qt(/=0;--Vt){const we=m(Dt[Vt],!0);we.__removalCount=(_.__removalCount||0)+1,kt.insertBefore(we,x(_))}}}return pe(_),!0}return _ instanceof l&&!Cp(_)||(X==="noscript"||X==="noembed"||X==="noframes")&&qt(/{I=Ir(I,kt," ")}),_.textContent!==I&&(Rr(t.removed,{element:_.cloneNode()}),_.textContent=I)),_e($.afterSanitizeElements,_,null),!1)},so=function(_,I,X){if(ct[I]||Gn&&(I==="id"||I==="name")&&(X in r||X in bp))return!1;if(!(bt&&!ct[I]&&qt(M,I))){if(!(Ct&&qt(L,I))){if(!(mt.attributeCheck instanceof Function&&mt.attributeCheck(I,_))){if(!at[I]||ct[I]){if(!(no(_)&&(st.tagNameCheck instanceof RegExp&&qt(st.tagNameCheck,_)||st.tagNameCheck instanceof Function&&st.tagNameCheck(_))&&(st.attributeNameCheck instanceof RegExp&&qt(st.attributeNameCheck,I)||st.attributeNameCheck instanceof Function&&st.attributeNameCheck(I,_))||I==="is"&&st.allowCustomizedBuiltInElements&&(st.tagNameCheck instanceof RegExp&&qt(st.tagNameCheck,X)||st.tagNameCheck instanceof Function&&st.tagNameCheck(X))))return!1}else if(!qa[I]){if(!qt(Y,Ir(X,B,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&_!=="script"&&Jp(X,"data:")===0&&Xn[_])){if(!(St&&!qt(E,Ir(X,B,"")))){if(X)return!1}}}}}}}return!0},no=function(_){return _!=="annotation-xml"&&Xa(_,W)},oo=function(_){_e($.beforeSanitizeAttributes,_,null);const{attributes:I}=_;if(!I||Ua(_))return;const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:at,forceKeepAttr:void 0};let kt=I.length;for(;kt--;){const Dt=I[kt],{name:vt,namespaceURI:Vt,value:we}=Dt,lr=Lt(vt),Ga=we;let Et=vt==="value"?Ga:tg(Ga);if(X.attrName=lr,X.attrValue=Et,X.keepAttr=!0,X.forceKeepAttr=void 0,_e($.uponSanitizeAttribute,_,X),Et=X.attrValue,Vn&&(lr==="id"||lr==="name")&&(je(vt,_),Et=pp+Et),$e&&qt(/((--!?|])>)|/i,Et)){je(vt,_);continue}ee&&Ti([z,O,A],co=>{Et=Ir(Et,co," ")});const lo=Lt(_.nodeName);if(!so(lo,lr,Et)){je(vt,_);continue}if(v&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Vt)switch(d.getAttributeType(lo,lr)){case"TrustedHTML":{Et=v.createHTML(Et);break}case"TrustedScriptURL":{Et=v.createScriptURL(Et);break}}if(Et!==Ga)try{Vt?_.setAttributeNS(Vt,vt,Et):_.setAttribute(vt,Et),Ua(_)?pe(_):xo(t.removed)}catch{je(vt,_)}}_e($.afterSanitizeAttributes,_,null)},kp=function Q(_){let I=null;const X=ro(_);for(_e($.beforeSanitizeShadowDOM,_,null);I=X.nextNode();)_e($.uponSanitizeShadowNode,I,null),ao(I),oo(I),I.content instanceof s&&Q(I.content);_e($.afterSanitizeShadowDOM,_,null)};return t.sanitize=function(Q){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,X=null,kt=null,Dt=null;if(Ha=!Q,Ha&&(Q=""),typeof Q!="string"&&!io(Q))if(typeof Q.toString=="function"){if(Q=Q.toString(),typeof Q!="string")throw Pr("dirty is not a string, aborting")}else throw Pr("toString is not a function");if(!t.isSupported)return Q;if(Pa||Ya(_),t.removed=[],typeof Q=="string"&&(Dr=!1),Dr){if(Q.nodeName){const we=Lt(Q.nodeName);if(!H[we]||nt[we])throw Pr("root node is forbidden and cannot be sanitized in-place")}}else if(Q instanceof n)I=eo(""),X=I.ownerDocument.importNode(Q,!0),X.nodeType===zr.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?I=X:I.appendChild(X);else{if(!ar&&!ee&&!He&&Q.indexOf(" `+Vt),ee&&Ti([z,O,A],we=>{Vt=Ir(Vt,we," ")}),v&&ki?v.createHTML(Vt):Vt},t.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ya(Q),Pa=!0},t.clearConfig=function(){or=null,Pa=!1},t.isValidAttribute=function(Q,_,I){or||Ya({});const X=Lt(Q),kt=Lt(_);return so(X,kt,I)},t.addHook=function(Q,_){typeof _=="function"&&Rr($[Q],_)},t.removeHook=function(Q,_){if(_!==void 0){const I=Kp($[Q],_);return I===-1?void 0:Qp($[Q],I,1)[0]}return xo($[Q])},t.removeHooks=function(Q){$[Q]=[]},t.removeAllHooks=function(){$=So()},t}var Sr=El(),$l=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,ti=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,gg=/\s*%%.*\n/gm,mr,Fl=(mr=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(mr,"UnknownDiagramError"),mr),Qe={},en=p(function(e,t){e=e.replace($l,"").replace(ti,"").replace(gg,` `);for(const[r,{detector:i}]of Object.entries(Qe))if(i(e,t))return r;throw new Fl(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),fs=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)Dl(t,r,i)},"registerLazyLoadedDiagrams"),Dl=p((e,t,r)=>{Qe[e]&&D.warn(`Detector with key ${e} already exists. Overwriting.`),Qe[e]={detector:t,loader:r},D.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),mg=p(e=>Qe[e].loader,"getDiagramLoader"),ps=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const a={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>ps(e,s,a)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=ps(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),At=ps,ka="#ffffff",_a="#f2f2f2",Ht=p((e,t)=>t?w(e,{s:-40,l:10}):w(e,{s:-40,l:-10}),"mkBorder"),yr,yg=(yr=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var r,i,a,s,o,n,l,c,h,u,f,d,g,m,y,x,b,k,v,S,C;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||w(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||w(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ht(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ht(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ht(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ht(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||N(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||N(this.tertiaryColor),this.lineColor=this.lineColor||N(this.background),this.arrowheadColor=this.arrowheadColor||N(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?J(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||J(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||N(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||J(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||J(this.mainBkg,10)):(this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||j(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||w(this.primaryColor,{h:30}),this.cScale4=this.cScale4||w(this.primaryColor,{h:60}),this.cScale5=this.cScale5||w(this.primaryColor,{h:90}),this.cScale6=this.cScale6||w(this.primaryColor,{h:120}),this.cScale7=this.cScale7||w(this.primaryColor,{h:150}),this.cScale8=this.cScale8||w(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||w(this.primaryColor,{h:270}),this.cScale10=this.cScale10||w(this.primaryColor,{h:300}),this.cScale11=this.cScale11||w(this.primaryColor,{h:330}),this.darkMode)for(let T=0;T{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(yr,"Theme"),yr),xg=p(e=>{const t=new yg;return t.calculate(e),t},"getThemeVariables"),xr,bg=(xr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=w(this.primaryColor,{h:-160}),this.primaryBorderColor=N(this.background),this.secondaryBorderColor=Ht(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ht(this.tertiaryColor,this.darkMode),this.primaryTextColor=N(this.primaryColor),this.secondaryTextColor=N(this.secondaryColor),this.tertiaryTextColor=N(this.tertiaryColor),this.lineColor=N(this.background),this.textColor=N(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(N("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Jr(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=J("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=J(this.sectionBkgColor,10),this.taskBorderColor=Jr(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Jr(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||j(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||J(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,r,i,a,s,o,n,l,c,h,u,f,d,g,m,y,x,b,k,v,S;this.secondBkg=j(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=j(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=j(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=N(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=w(this.primaryColor,{h:64}),this.fillType3=w(this.secondaryColor,{h:64}),this.fillType4=w(this.primaryColor,{h:-64}),this.fillType5=w(this.secondaryColor,{h:-64}),this.fillType6=w(this.primaryColor,{h:128}),this.fillType7=w(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||w(this.primaryColor,{h:30}),this.cScale4=this.cScale4||w(this.primaryColor,{h:60}),this.cScale5=this.cScale5||w(this.primaryColor,{h:90}),this.cScale6=this.cScale6||w(this.primaryColor,{h:120}),this.cScale7=this.cScale7||w(this.primaryColor,{h:150}),this.cScale8=this.cScale8||w(this.primaryColor,{h:210}),this.cScale9=this.cScale9||w(this.primaryColor,{h:270}),this.cScale10=this.cScale10||w(this.primaryColor,{h:300}),this.cScale11=this.cScale11||w(this.primaryColor,{h:330});for(let C=0;C{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(xr,"Theme"),xr),Cg=p(e=>{const t=new bg;return t.calculate(e),t},"getThemeVariables"),br,kg=(br=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=w(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=w(this.primaryColor,{h:-160}),this.primaryBorderColor=Ht(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ht(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ht(this.tertiaryColor,this.darkMode),this.primaryTextColor=N(this.primaryColor),this.secondaryTextColor=N(this.secondaryColor),this.tertiaryTextColor=N(this.tertiaryColor),this.lineColor=N(this.background),this.textColor=N(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Jr(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){var t,r,i,a,s,o,n,l,c,h,u,f,d,g,m,y,x,b,k,v,S;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||w(this.primaryColor,{h:30}),this.cScale4=this.cScale4||w(this.primaryColor,{h:60}),this.cScale5=this.cScale5||w(this.primaryColor,{h:90}),this.cScale6=this.cScale6||w(this.primaryColor,{h:120}),this.cScale7=this.cScale7||w(this.primaryColor,{h:150}),this.cScale8=this.cScale8||w(this.primaryColor,{h:210}),this.cScale9=this.cScale9||w(this.primaryColor,{h:270}),this.cScale10=this.cScale10||w(this.primaryColor,{h:300}),this.cScale11=this.cScale11||w(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||J(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||J(this.tertiaryColor,40);for(let C=0;C{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(br,"Theme"),br),_g=p(e=>{const t=new kg;return t.calculate(e),t},"getThemeVariables"),Cr,wg=(Cr=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=j("#cde498",10),this.primaryBorderColor=Ht(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ht(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ht(this.tertiaryColor,this.darkMode),this.primaryTextColor=N(this.primaryColor),this.secondaryTextColor=N(this.secondaryColor),this.tertiaryTextColor=N(this.primaryColor),this.lineColor=N(this.background),this.textColor=N(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,i,a,s,o,n,l,c,h,u,f,d,g,m,y,x,b,k,v,S;this.actorBorder=J(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||w(this.primaryColor,{h:30}),this.cScale4=this.cScale4||w(this.primaryColor,{h:60}),this.cScale5=this.cScale5||w(this.primaryColor,{h:90}),this.cScale6=this.cScale6||w(this.primaryColor,{h:120}),this.cScale7=this.cScale7||w(this.primaryColor,{h:150}),this.cScale8=this.cScale8||w(this.primaryColor,{h:210}),this.cScale9=this.cScale9||w(this.primaryColor,{h:270}),this.cScale10=this.cScale10||w(this.primaryColor,{h:300}),this.cScale11=this.cScale11||w(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||J(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||J(this.tertiaryColor,40);for(let C=0;C{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Cr,"Theme"),Cr),Sg=p(e=>{const t=new wg;return t.calculate(e),t},"getThemeVariables"),kr,vg=(kr=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=j(this.contrast,55),this.background="#ffffff",this.tertiaryColor=w(this.primaryColor,{h:-160}),this.primaryBorderColor=Ht(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ht(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ht(this.tertiaryColor,this.darkMode),this.primaryTextColor=N(this.primaryColor),this.secondaryTextColor=N(this.secondaryColor),this.tertiaryTextColor=N(this.tertiaryColor),this.lineColor=N(this.background),this.textColor=N(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,i,a,s,o,n,l,c,h,u,f,d,g,m,y,x,b,k,v,S;this.secondBkg=j(this.contrast,55),this.border2=this.contrast,this.actorBorder=j(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let C=0;C{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(kr,"Theme"),kr),Tg=p(e=>{const t=new vg;return t.calculate(e),t},"getThemeVariables"),Le={base:{getThemeVariables:xg},dark:{getThemeVariables:Cg},default:{getThemeVariables:_g},forest:{getThemeVariables:Sg},neutral:{getThemeVariables:Tg}},ie={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Ol={...ie,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Le.default.getThemeVariables(),sequence:{...ie.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...ie.gantt,tickInterval:void 0,useWidth:void 0},c4:{...ie.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...ie.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...ie.pie,useWidth:984},xyChart:{...ie.xyChart,useWidth:void 0},requirement:{...ie.requirement,useWidth:void 0},packet:{...ie.packet},radar:{...ie.radar},ishikawa:{...ie.ishikawa},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...ie.venn}},Rl=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Rl(e[i],"")]:[...r,t+i],[]),"keyify"),Lg=new Set(Rl(Ol,"")),Il=Ol,Vi=p(e=>{if(D.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Vi(t));return}for(const t of Object.keys(e)){if(D.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Lg.has(t)||e[t]==null){D.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){D.debug("sanitizing object",t),Vi(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(D.debug("sanitizing css option",t),e[t]=Bg(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}D.debug("After sanitization",e)}},"sanitizeDirective"),Bg=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Zt=At({},vr),Xi,Je=[],ei=At({},vr),wa=p((e,t)=>{let r=At({},e),i={};for(const a of t)zl(a),i=At(i,a);if(r=At(r,i),i.theme&&i.theme in Le){const a=At({},Xi),s=At(a.themeVariables||{},i.themeVariables);r.theme&&r.theme in Le&&(r.themeVariables=Le[r.theme].getThemeVariables(s))}return ei=r,ql(ei),ei},"updateCurrentConfig"),Ag=p(e=>(Zt=At({},vr),Zt=At(Zt,e),e.theme&&Le[e.theme]&&(Zt.themeVariables=Le[e.theme].getThemeVariables(e.themeVariables)),wa(Zt,Je),Zt),"setSiteConfig"),Mg=p(e=>{Xi=At({},e)},"saveConfigFromInitialize"),Eg=p(e=>(Zt=At(Zt,e),wa(Zt,Je),Zt),"updateSiteConfig"),Pl=p(()=>At({},Zt),"getSiteConfig"),Nl=p(e=>(ql(e),At(ei,e),It()),"setConfig"),It=p(()=>At({},ei),"getConfig"),zl=p(e=>{e&&(["secure",...Zt.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(D.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&zl(e[t])}))},"sanitize"),$g=p(e=>{var t;Vi(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Je.push(e),wa(Zt,Je)},"addDirective"),Zi=p((e=Zt)=>{Je=[],wa(e,Je)},"reset"),Fg={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},vo={},Wl=p(e=>{vo[e]||(D.warn(Fg[e]),vo[e]=!0)},"issueWarning"),ql=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Wl("LAZY_LOAD_DEPRECATED")},"checkConfig"),mk=p(()=>{let e={};Xi&&(e=At(e,Xi));for(const t of Je)e=At(e,t);return e},"getUserDefinedConfig"),zt=p(e=>{var t,r;return((t=e.flowchart)==null?void 0:t.htmlLabels)!=null&&Wl("FLOWCHART_HTML_LABELS_DEPRECATED"),We(e.htmlLabels??((r=e.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),fi=/
/gi,Dg=p(e=>e?Yl(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Og=(()=>{let e=!1;return()=>{e||(Hl(),e=!0)}})();function Hl(){const e="data-temp-href-target";Sr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Sr.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(Hl,"setupDompurifyHooks");var jl=p(e=>(Og(),Sr.sanitize(e)),"removeScript"),To=p((e,t)=>{if(zt(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=jl(e):r!=="loose"&&(e=Yl(e),e=e.replace(/,"<").replace(/>/g,">"),e=e.replace(/=/g,"&equals;"),e=Ng(e))}return e},"sanitizeMore"),de=p((e,t)=>e&&(t.dompurifyConfig?e=Sr.sanitize(To(e,t),t.dompurifyConfig).toString():e=Sr.sanitize(To(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),Rg=p((e,t)=>typeof e=="string"?de(e,t):e.flat().map(r=>de(r,t)),"sanitizeTextOrArray"),Ig=p(e=>fi.test(e),"hasBreaks"),Pg=p(e=>e.split(fi),"splitBreaks"),Ng=p(e=>e.replace(/#br#/g,"
"),"placeholderToBreak"),Yl=p(e=>e.replace(fi,"#br#"),"breakToPlaceholder"),zg=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Wg=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),qg=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Lo=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),Hg=p((e,t)=>{const r=gs(e,"~"),i=gs(t,"~");return r===1&&i===1},"shouldCombineSets"),jg=p(e=>{const t=gs(e,"~");let r=!1;if(t",a=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Bo=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),ms=/\$\$(.*)\$\$/g,ai=p(e=>{var t;return(((t=e.match(ms))==null?void 0:t.length)??0)>0},"hasKatex"),yk=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Ul(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const i=document.querySelector("body");i==null||i.insertAdjacentElement("beforeend",r);const a={width:r.clientWidth,height:r.clientHeight};return r.remove(),a},"calculateMathMLDimensions"),Yg=p(async(e,t)=>{if(!ai(e))return e;if(!(Bo()||t.legacyMathML||t.forceLegacyMathML))return e.replace(ms,"MathML is unsupported in this environment.");{const{default:r}=await dt(async()=>{const{default:a}=await import("./f0vruDP5.js");return{default:a}},[],import.meta.url),i=t.forceLegacyMathML||!Bo()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(fi).map(a=>ai(a)?`

${a}
`:`
${a}
`).join("").replace(ms,(a,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),Ul=p(async(e,t)=>de(await Yg(e,t),t),"renderKatexSanitized"),pi={getRows:Dg,sanitizeText:de,sanitizeTextOrArray:Rg,hasBreaks:Ig,splitBreaks:Pg,lineBreakRegex:fi,removeScript:jl,getUrl:zg,evaluate:We,getMax:Wg,getMin:qg},Ug=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Gg=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Gl=p(function(e,t,r,i){const a=Gg(t,r,i);Ug(e,a)},"configureSvgSize"),Vg=p(function(e,t,r,i){const a=t.node().getBBox(),s=a.width,o=a.height;D.info(`SVG bounds: ${s}x${o}`,a);let n=0,l=0;D.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=o+r*2,D.info(`Calculated bounds: ${n}x${l}`),Gl(t,l,n,i);const c=`${a.x-r} ${a.y-r} ${a.width+2*r} ${a.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),zi={},Xg=p((e,t,r)=>{let i="";return e in zi&&zi[e]?i=zi[e](r):D.warn(`No theme found for ${e}`),` & { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} } @keyframes edge-animation-frame { from { stroke-dashoffset: 0; } } @keyframes dash { to { stroke-dashoffset: 0; } } & .edge-animation-slow { stroke-dasharray: 9,5 !important; stroke-dashoffset: 900; animation: dash 50s linear infinite; stroke-linecap: round; } & .edge-animation-fast { stroke-dasharray: 9,5 !important; stroke-dashoffset: 900; animation: dash 20s linear infinite; stroke-linecap: round; } /* Classes common for multiple diagrams */ & .error-icon { fill: ${r.errorBkgColor}; } & .error-text { fill: ${r.errorTextColor}; stroke: ${r.errorTextColor}; } & .edge-thickness-normal { stroke-width: 1px; } & .edge-thickness-thick { stroke-width: 3.5px } & .edge-pattern-solid { stroke-dasharray: 0; } & .edge-thickness-invisible { stroke-width: 0; fill: none; } & .edge-pattern-dashed{ stroke-dasharray: 3; } .edge-pattern-dotted { stroke-dasharray: 2; } & .marker { fill: ${r.lineColor}; stroke: ${r.lineColor}; } & .marker.cross { stroke: ${r.lineColor}; } & svg { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; } & p { margin: 0 } ${i} ${t} `},"getStyles"),Zg=p((e,t)=>{t!==void 0&&(zi[e]=t)},"addStylesForDiagram"),Kg=Xg,Vl={};zp(Vl,{clear:()=>Qg,getAccDescription:()=>rm,getAccTitle:()=>tm,getDiagramTitle:()=>am,setAccDescription:()=>em,setAccTitle:()=>Jg,setDiagramTitle:()=>im});var rn="",an="",sn="",nn=p(e=>de(e,It()),"sanitizeText"),Qg=p(()=>{rn="",sn="",an=""},"clear"),Jg=p(e=>{rn=nn(e).replace(/^\s+/g,"")},"setAccTitle"),tm=p(()=>rn,"getAccTitle"),em=p(e=>{sn=nn(e).replace(/\n\s+/g,` `)},"setAccDescription"),rm=p(()=>sn,"getAccDescription"),im=p(e=>{an=nn(e)},"setDiagramTitle"),am=p(()=>an,"getDiagramTitle"),Ao=D,sm=tn,pt=It,xk=Nl,bk=vr,on=p(e=>de(e,pt()),"sanitizeText"),nm=Vg,om=p(()=>Vl,"getCommonDb"),Ki={},Qi=p((e,t,r)=>{var i;Ki[e]&&Ao.warn(`Diagram with id ${e} already registered. Overwriting.`),Ki[e]=t,r&&Dl(e,r),Zg(e,t.styles),(i=t.injectUtils)==null||i.call(t,Ao,sm,pt,on,nm,om(),()=>{})},"registerDiagram"),ys=p(e=>{if(e in Ki)return Ki[e];throw new lm(e)},"getDiagram"),_r,lm=(_r=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(_r,"DiagramNotFoundError"),_r);const xs=Math.PI,bs=2*xs,Ue=1e-6,cm=bs-Ue;function Xl(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Xl;const r=10**t;return function(i){this._+=i[0];for(let a=1,s=i.length;aUe)if(!(Math.abs(u*l-c*h)>Ue)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let d=i-o,g=a-n,m=l*l+c*c,y=d*d+g*g,x=Math.sqrt(m),b=Math.sqrt(f),k=s*Math.tan((xs-Math.acos((m+f-y)/(2*x*b)))/2),v=k/b,S=k/x;Math.abs(v-1)>Ue&&this._append`L${t+v*h},${r+v*u}`,this._append`A${s},${s},0,0,${+(u*d>h*g)},${this._x1=t+S*l},${this._y1=r+S*c}`}}arc(t,r,i,a,s,o){if(t=+t,r=+r,i=+i,o=!!o,iUe||Math.abs(this._y1-h)>Ue)&&this._append`L${c},${h}`,i&&(fcm?this._append`A${i},${i},0,1,${u},${t-n},${r-l}A${i},${i},0,1,${u},${this._x1=c},${this._y1=h}`:f>Ue&&this._append`A${i},${i},0,${+(f>=xs)},${u},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+a}h${-i}Z`}toString(){return this._}}function cr(e){return function(){return e}}const Ck=Math.abs,kk=Math.atan2,_k=Math.cos,wk=Math.max,Sk=Math.min,vk=Math.sin,Tk=Math.sqrt,Mo=1e-12,ln=Math.PI,Eo=ln/2,Lk=2*ln;function Bk(e){return e>1?0:e=1?Eo:e=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new um(t)}function fm(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Zl(e){this._context=e}Zl.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 ri(e){return new Zl(e)}function pm(e){return e[0]}function gm(e){return e[1]}function mm(e,t){var r=cr(!0),i=null,a=ri,s=null,o=dm(n);e=typeof e=="function"?e:e===void 0?pm:cr(e),t=typeof t=="function"?t:t===void 0?gm:cr(t);function n(l){var c,h=(l=fm(l)).length,u,f=!1,d;for(i==null&&(s=a(d=o())),c=0;c0)for(var i=e[0],a=t[0],s=e[r]-i,o=t[r]-a,n=-1,l;++nMo){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,a=(a*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Mo){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,o=(o*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,a,s,o,e._x2,e._y2)}function ac(e,t){this._context=e,this._alpha=t}ac.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 r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,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:dn(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}};const sc=(function e(t){function r(i){return t?new ac(i,t):new cn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function nc(e,t){this._context=e,this._alpha=t}nc.prototype={areaStart:Ie,areaEnd:Ie,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 r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,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:dn(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}};const _m=(function e(t){function r(i){return t?new nc(i,t):new hn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function oc(e,t){this._context=e,this._alpha=t}oc.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 r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,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:dn(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}};const wm=(function e(t){function r(i){return t?new oc(i,t):new un(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function lc(e){this._context=e}lc.prototype={areaStart:Ie,areaEnd:Ie,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 Sm(e){return new lc(e)}function $o(e){return e=0;--t)a[t]=(o[t]-a[t+1])/s[t];for(s[r-1]=(e[r]+a[r-1])/2,t=0;t=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{var a;const{securityLevel:t}=pt();let r=ot("body");if(t==="sandbox"){const o=((a=ot(`#i${e}`).node())==null?void 0:a.contentDocument)??document;r=ot(o.body)}return r.select(`#${e}`)},"selectSvgElement");function fn(e){return typeof e>"u"||e===null}p(fn,"isNothing");function xc(e){return typeof e=="object"&&e!==null}p(xc,"isObject");function bc(e){return Array.isArray(e)?e:fn(e)?[]:[e]}p(bc,"toArray");function Cc(e,t){var r,i,a,s;if(t)for(s=Object.keys(t),r=0,i=s.length;rn&&(s=" ... ",t=i-n+s.length),r-i>n&&(o=" ...",r=i+n-o.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+o,pos:i-t+s.length}}p(Wi,"getLine");function qi(e,t){return Mt.repeat(" ",t-e.length)+e}p(qi,"padStart");function wc(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],a=[],s,o=-1;s=r.exec(e.buffer);)a.push(s.index),i.push(s.index+s[0].length),e.position=a.length);l++)c=Wi(e.buffer,i[o+l],a[o+l],e.position-(i[o]-i[o+l]),u),n+=Mt.repeat(" ",t.indent)+qi((e.line+l+1).toString(),h)+" | "+c.str+` `;return n.replace(/\n$/,"")}p(wc,"makeSnippet");var $m=wc,Fm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Dm=["scalar","sequence","mapping"];function Sc(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(Sc,"compileStyleAliases");function vc(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Fm.indexOf(r)===-1)throw new Kt('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Sc(t.styleAliases||null),Dm.indexOf(this.kind)===-1)throw new Kt('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(vc,"Type$1");var Pt=vc;function ks(e,t){var r=[];return e[t].forEach(function(i){var a=r.length;r.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(a=o)}),r[a]=i}),r}p(ks,"compileList");function Tc(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(a){a.multi?(e.multi[a.kind].push(a),e.multi.fallback.push(a)):e[a.kind][a.tag]=e.fallback[a.tag]=a}for(p(i,"collectType"),t=0,r=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Hm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Nc(e){return!(e===null||!Hm.test(e)||e[e.length-1]==="_")}p(Nc,"resolveYamlFloat");function zc(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}p(zc,"constructYamlFloat");var jm=/^[-+]?[0-9]+e/;function Wc(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Mt.isNegativeZero(e))return"-0.0";return r=e.toString(10),jm.test(r)?r.replace("e",".e"):r}p(Wc,"representYamlFloat");function qc(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Mt.isNegativeZero(e))}p(qc,"isFloat");var Ym=new Pt("tag:yaml.org,2002:float",{kind:"scalar",resolve:Nc,construct:zc,predicate:qc,represent:Wc,defaultStyle:"lowercase"}),Hc=Nm.extend({implicit:[zm,Wm,qm,Ym]}),Um=Hc,jc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Yc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Uc(e){return e===null?!1:jc.exec(e)!==null||Yc.exec(e)!==null}p(Uc,"resolveYamlTimestamp");function Gc(e){var t,r,i,a,s,o,n,l=0,c=null,h,u,f;if(t=jc.exec(e),t===null&&(t=Yc.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(r,i,a));if(s=+t[4],o=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length64)){if(t>16&255),n.push(o>>8&255),n.push(o&255)),o=o>16&255),n.push(o>>8&255),n.push(o&255)):r===18?(n.push(o>>10&255),n.push(o>>2&255)):r===12&&n.push(o>>4&255),new Uint8Array(n)}p(Kc,"constructYamlBinary");function Qc(e){var t="",r=0,i,a,s=e.length,o=gn;for(i=0;i>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]),r=(r>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]):a===2?(t+=o[r>>10&63],t+=o[r>>4&63],t+=o[r>2&63],t+=o[r>10)+55296,(e-65536&1023)+56320)}p(ph,"charFromCodepoint");function mn(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(mn,"setProperty");var gh=new Array(256),mh=new Array(256);for(Ye=0;Ye1&&(e.result+=Mt.repeat(` `,t-1))}p(La,"writeFoldedLines");function xh(e,t,r){var i,a,s,o,n,l,c,h,u=e.kind,f=e.result,d;if(d=e.input.charCodeAt(e.position),jt(d)||Xe(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(a=e.input.charCodeAt(e.position+1),jt(a)||r&&Xe(a)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,n=!1;d!==0;){if(d===58){if(a=e.input.charCodeAt(e.position+1),jt(a)||r&&Xe(a))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),jt(i))break}else{if(e.position===e.lineStart&&gi(e)||r&&Xe(d))break;if(he(d))if(l=e.line,c=e.lineStart,h=e.lineIndent,wt(e,!1,-1),e.lineIndent>=t){n=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(Be(e,s,o,!1),La(e,e.line-l),s=o=e.position,n=!1),Re(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return Be(e,s,o,!1),e.result?!0:(e.kind=u,e.result=f,!1)}p(xh,"readPlainScalar");function bh(e,t){var r,i,a;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=a=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Be(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,a=e.position;else return!0;else he(r)?(Be(e,i,a,!0),La(e,wt(e,!1,t)),i=a=e.position):e.position===e.lineStart&&gi(e)?K(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);K(e,"unexpected end of the stream within a single quoted scalar")}p(bh,"readSingleQuotedScalar");function Ch(e,t){var r,i,a,s,o,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return Be(e,r,e.position,!0),e.position++,!0;if(n===92){if(Be(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),he(n))wt(e,!1,t);else if(n0){for(a=o,s=0;a>0;a--)n=e.input.charCodeAt(++e.position),(o=uh(n))>=0?s=(s=0)h===0?K(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?K(e,"repeat of an indentation width identifier"):(n=t+h-1,o=!0);else break;if(Re(u)){do u=e.input.charCodeAt(++e.position);while(Re(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!he(u)&&u!==0)}for(;u!==0;){for(Ta(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndentn&&(n=e.lineIndent),he(u)){l++;continue}if(e.lineIndentt)&&l!==0)K(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(y&&(o=e.line,n=e.lineStart,l=e.position),tr(e,t,aa,!0,a)&&(y?g=e.result:m=e.result),y||(Ze(e,u,f,d,g,m,o,n,l),d=g=m=null),wt(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&b!==0)K(e,"bad indentation of a mapping entry");else if(e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u"),e.result!==null&&g.kind!==e.kind&&K(e,"unacceptable node kind for ! tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):K(e,"cannot resolve a node with ! explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}p(tr,"composeNode");function Lh(e){var t=e.position,r,i,a,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(wt(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),r=e.position;o!==0&&!jt(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),a=[],i.length"u"&&(r=t,t=null);var i=xn(e,r);if(typeof t!="function")return i;for(var a=0,s=i.length;a=55296&&r=56320&&i=65536?l+=2:l++){if(c=fr(e,l),!Lr(c))return ur;m=m&&As(c,h,n),h=c}else{for(l=0;l=65536?l+=2:l++){if(c=fr(e,l),c===ni)u=!0,d&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!Lr(c))return ur;m=m&&As(c,h,n),h=c}f=f||d&&l-g-1>i&&e[g+1]!==" "}return!u&&!f?m&&!o&&!a(e)?qh:s===oi?ur:Ms:r>9&&Cn(e)?ur:o?s===oi?ur:Ms:f?jh:Hh}p(Yh,"chooseScalarStyle");function Uh(e,t,r,i,a){e.dump=(function(){if(t.length===0)return e.quotingType===oi?'""':"''";if(!e.noCompatMode&&(T0.indexOf(t)!==-1||L0.test(t)))return e.quotingType===oi?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return Nh(e,c)}switch(p(l,"testAmbiguity"),Yh(t,n,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,a)){case qh:return t;case Ms:return"'"+t.replace(/'/g,"''")+"'";case Hh:return"|"+Es(t,e.indent)+$s(Ls(t,s));case jh:return">"+Es(t,e.indent)+$s(Ls(Gh(t,o),s));case ur:return'"'+Vh(t)+'"';default:throw new Kt("impossible error: invalid scalar style")}})()}p(Uh,"writeScalar");function Es(e,t){var r=Cn(e)?String(t):"",i=e[e.length-1]===` `,a=i&&(e[e.length-2]===` `||e===` `),s=a?"+":i?"":"-";return r+s+` `}p(Es,"blockHeader");function $s(e){return e[e.length-1]===` `?e.slice(0,-1):e}p($s,"dropEndingNewline");function Gh(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(` `);return c=c!==-1?c:e.length,r.lastIndex=c,Fs(e.slice(0,c),t)})(),a=e[0]===` `||e[0]===" ",s,o;o=r.exec(e);){var n=o[1],l=o[2];s=l[0]===" ",i+=n+(!a&&!s&&l!==""?` `:"")+Fs(l,t),a=s}return i}p(Gh,"foldString");function Fs(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,a=0,s,o=0,n=0,l="";i=r.exec(e);)n=i.index,n-a>t&&(s=o>a?o:n,l+=` `+e.slice(a,s),a=s+1),o=n;return l+=` `,e.length-a>t&&o>a?l+=e.slice(a,o)+` `+e.slice(o+1):l+=e.slice(a),l.slice(1)}p(Fs,"foldLine");function Vh(e){for(var t="",r=0,i,a=0;a=65536?a+=2:a++)r=fr(e,a),i=Wt[r],!i&&Lr(r)?(t+=e[a],r>=65536&&(t+=e[a+1])):t+=i||Ih(r);return t}p(Vh,"escapeString");function Xh(e,t,r){var i="",a=e.tag,s,o,n;for(s=0,o=r.length;s"u"&&Ce(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}p(Xh,"writeFlowSequence");function Ds(e,t,r,i){var a="",s=e.tag,o,n,l;for(o=0,n=r.length;o"u"&&Ce(e,t+1,null,!0,!0,!1,!0))&&((!i||a!=="")&&(a+=na(e,t)),e.dump&&ni===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=s,e.dump=a||"[]"}p(Ds,"writeBlockSequence");function Zh(e,t,r){var i="",a=e.tag,s=Object.keys(r),o,n,l,c,h;for(o=0,n=s.length;o1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ce(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=a,e.dump="{"+i+"}"}p(Zh,"writeFlowMapping");function Kh(e,t,r,i){var a="",s=e.tag,o=Object.keys(r),n,l,c,h,u,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Kt("sortKeys must be a boolean or a function");for(n=0,l=o.length;n1024,u&&(e.dump&&ni===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=na(e,t)),Ce(e,t+1,h,!0,u)&&(e.dump&&ni===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,a+=f));e.tag=s,e.dump=a||"{}"}p(Kh,"writeBlockMapping");function Os(e,t,r){var i,a,s,o,n,l;for(a=r?e.explicitTypes:e.implicitTypes,s=0,o=a.length;s tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(Os,"detectType");function Ce(e,t,r,i,a,s,o){e.tag=null,e.dump=r,Os(e,r,!1)||Os(e,r,!0);var n=Ah.call(e.dump),l=i,c;i&&(i=e.flowLevelt);var h=n==="[object Object]"||n==="[object Array]",u,f;if(h&&(u=e.duplicates.indexOf(r),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(a=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(Kh(e,t,e.dump,a),f&&(e.dump="&ref_"+u+e.dump)):(Zh(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Ds(e,t-1,e.dump,a):Ds(e,t,e.dump,a),f&&(e.dump="&ref_"+u+e.dump)):(Xh(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&Uh(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Kt("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!",e.dump=c+" "+e.dump)}return!0}p(Ce,"writeNode");function Qh(e,t){var r=[],i=[],a,s;for(oa(e,r,i),a=0,s=i.length;a{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Rt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},Po={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function Vr(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=_t(e),t=_t(t);const[r,i]=[e.x,e.y],[a,s]=[t.x,t.y],o=a-r,n=s-i;return{angle:Math.atan(n/o),deltaX:o,deltaY:n}}p(Vr,"calculateDeltaAndAngle");var _t=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),F0=p(e=>({x:p(function(t,r,i){let a=0;const s=_t(i[0]).x<_t>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Rt,e.arrowTypeEnd)){const{angle:d,deltaX:g}=Vr(i[i.length-1],i[i.length-2]);a=Rt[e.arrowTypeEnd]*Math.cos(d)*(g>=0?1:-1)}const o=Math.abs(_t(t).x-_t(i[i.length-1]).x),n=Math.abs(_t(t).y-_t(i[i.length-1]).y),l=Math.abs(_t(t).x-_t(i[0]).x),c=Math.abs(_t(t).y-_t(i[0]).y),h=Rt[e.arrowTypeStart],u=Rt[e.arrowTypeEnd],f=1;if(o0&&n0&&c=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Rt,e.arrowTypeEnd)){const{angle:d,deltaY:g}=Vr(i[i.length-1],i[i.length-2]);a=Rt[e.arrowTypeEnd]*Math.abs(Math.sin(d))*(g>=0?1:-1)}const o=Math.abs(_t(t).y-_t(i[i.length-1]).y),n=Math.abs(_t(t).x-_t(i[i.length-1]).x),l=Math.abs(_t(t).y-_t(i[0]).y),c=Math.abs(_t(t).x-_t(i[0]).x),h=Rt[e.arrowTypeStart],u=Rt[e.arrowTypeEnd],f=1;if(o0&&n0&&c-1}function r(o){var n=o.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(o){return URL.canParse(o)}function a(o){try{return decodeURIComponent(o)}catch{return o}}function s(o){if(!o)return e.BLANK_URL;var n,l=a(o.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=a(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),u=h.match(e.urlSchemeRegex);if(!u)return c;var f=u[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var d=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return d;if(f==="http:"||f==="https:"){if(!i(d))return e.BLANK_URL;var g=new URL(d);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return d}return Bi}var R0=O0();function kn(e,t,r){t=="__proto__"&&ho?ho(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Rs(e,t,r){(r!==void 0&&!kl(e[t],r)||r===void 0&&!(t in e))&&kn(e,t,r)}var Jh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wo=Jh&&typeof module=="object"&&module&&!module.nodeType&&module,I0=Wo&&Wo.exports===Jh,qo=I0?Mp.Buffer:void 0,Ho=qo?qo.allocUnsafe:void 0;function P0(e,t){if(t)return e.slice();var r=e.length,i=Ho?Ho(r):new e.constructor(r);return e.copy(i),i}function N0(e){var t=new e.constructor(e.byteLength);return new uo(t).set(new uo(e)),t}function z0(e,t){var r=t?N0(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function W0(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(a--,s):void 0,o&&Ap(r[0],r[1],o)&&(s=an.args);Vi(o),i=At(i,[...o])}else i=r.args;if(!i)return;let a=en(e,t);const s="config";return i[s]!==void 0&&(a==="flowchart-v2"&&(a="flowchart"),i[a]=i[s],delete i[s]),i},"detectInit"),au=p(function(e,t=null){var r,i;try{const a=new RegExp(`[%]{2}(?![{]${uy.source})(?=[}][%]{2}).* `,"ig");e=e.trim().replace(a,"").replace(/'/gm,'"'),D.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let s;const o=[];for(;(s=ti.exec(e))!==null;)if(s.index===ti.lastIndex&&ti.lastIndex++,s&&!t||t&&((r=s[1])!=null&&r.match(t))||t&&((i=s[2])!=null&&i.match(t))){const n=s[1]?s[1]:s[2],l=s[3]?s[3].trim():s[4]?JSON.parse(s[4].trim()):null;o.push({type:n,args:l})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(a){return D.error(`ERROR: ${a.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),fy=p(function(e){return e.replace(ti,"")},"removeDirectives"),py=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function _n(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return hy[r]??t}p(_n,"interpolateToCurve");function su(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?R0.sanitizeUrl(r):r}p(su,"formatUrl");var gy=p((e,...t)=>{const r=e.split("."),i=r.length-1,a=r[i];let s=window;for(let o=0;o{r+=wn(a,t),t=a});const i=r/2;return Sn(e,i)}p(nu,"traverseEdge");function ou(e){return e.length===1?e[0]:nu(e)}p(ou,"calcLabelPosition");var Yo=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Sn=p((e,t)=>{let r,i=t;for(const a of e){if(r){const s=wn(a,r);if(s===0)return r;if(s=1)return{x:a.x,y:a.y};if(o>0&&o{D.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const a=Sn(t,25),s=e?10:5,o=Math.atan2(t[0].y-a.y,t[0].x-a.x),n={x:0,y:0};return n.x=Math.sin(o)*s+(t[0].x+a.x)/2,n.y=-Math.cos(o)*s+(t[0].y+a.y)/2,n},"calcCardinalityPosition");function lu(e,t,r){const i=structuredClone(r);D.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const a=25+e,s=Sn(i,a),o=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*o+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*o+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*o+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*o+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*o+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*o+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*o+(i[0].x+s.x)/2,l.y=-Math.cos(n)*o+(i[0].y+s.y)/2),l}p(lu,"calcTerminalLabelPosition");function cu(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(cu,"getStylesFromArray");var Uo=0,yy=p(()=>(Uo++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Uo),"generateId");function hu(e){let t="";const r="0123456789abcdef",i=r.length;for(let a=0;ahu(e.length),"random"),by=p(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"),Cy=p(function(e,t){const r=t.text.replace(pi.lineBreakRegex," "),[,i]=Ba(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",i),a.style("font-weight",t.fontWeight),a.attr("fill",t.fill),t.class!==void 0&&a.attr("class",t.class);const s=a.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),a},"drawSimpleText"),ky=Js((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),pi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),a=[];let s="";return i.forEach((o,n)=>{const l=Ae(`${o} `,r),c=Ae(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:d}=_y(o,t,"-",r);a.push(s,...f),s=d}else c+l>=t?(a.push(s),s=o):s=[s,o].filter(Boolean).join(" ");n+1===i.length&&a.push(s)}),a.filter(o=>o!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),_y=Js((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const a=[...e],s=[];let o="";return a.forEach((n,l)=>{const c=`${o}${n}`;if(Ae(c,i)>=t){const u=l+1,f=a.length===u,d=`${c}${r}`;s.push(f?c:d),o=""}else o=c}),{hyphenatedStrings:s,remainingWord:o}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function uu(e,t){return vn(e,t).height}p(uu,"calculateTextHeight");function Ae(e,t){return vn(e,t).width}p(Ae,"calculateTextWidth");var vn=Js((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:a=400}=t;if(!e)return{width:0,height:0};const[,s]=Ba(r),o=["sans-serif",i],n=e.split(pi.lineBreakRegex),l=[],c=ot("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of o){let d=0;const g={width:0,height:0,lineHeight:0};for(const m of n){const y=by();y.text=m||cy;const x=Cy(h,y).style("font-size",s).style("font-weight",a).style("font-family",f),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),d=Math.round(b.height),g.height+=d,g.lineHeight=Math.round(Math.max(g.lineHeight,d))}l.push(g)}h.remove();const u=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[u]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),wr,wy=(wr=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},p(wr,"InitIDGenerator"),wr),Ai,Sy=p(function(e){return Ai=Ai||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ai.innerHTML=e,unescape(Ai.textContent)},"entityDecode");function Tn(e){return"str"in e}p(Tn,"isDetailedError");var vy=p((e,t,r,i)=>{var s;if(!i)return;const a=(s=e.node())==null?void 0:s.getBBox();a&&e.append("text").text(i).attr("text-anchor","middle").attr("x",a.x+a.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Ba=p(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Ln(e,t){return ly({},e,t)}p(Ln,"cleanAndMerge");var ce={assignWithDepth:At,wrapLabel:ky,calculateTextHeight:uu,calculateTextWidth:Ae,calculateTextDimensions:vn,cleanAndMerge:Ln,detectInit:dy,detectDirective:au,isSubstringInArray:py,interpolateToCurve:_n,calcLabelPosition:ou,calcCardinalityPosition:my,calcTerminalLabelPosition:lu,formatUrl:su,getStylesFromArray:cu,generateId:yy,random:xy,runFunc:gy,entityDecode:Sy,insertTitle:vy,isLabelCoordinateInPath:du,parseFontSize:Ba,InitIDGenerator:wy},Ty=p(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),Mr=p(function(e){return e.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Mk=p((e,t,{counter:r=0,prefix:i,suffix:a},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${a?`_${a}`:""}`,"getEdgeId");function Nt(e){return e??null}p(Nt,"handleUndefinedAttr");function du(e,t){const r=Math.round(e.x),i=Math.round(e.y),a=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return a.includes(r.toString())||a.includes(i.toString())}p(du,"isLabelCoordinateInPath");var Bn=p(({flowchart:e})=>{var a,s;const t=((a=e==null?void 0:e.subGraphTitleMargin)==null?void 0:a.top)??0,r=((s=e==null?void 0:e.subGraphTitleMargin)==null?void 0:s.bottom)??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function fu(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(a=>new Promise(s=>{function o(){if(a.style.display="flex",a.style.flexDirection="column",i){const n=pt().fontSize?pt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Il.fontSize]=Ba(n),h=c*l+"px";a.style.minWidth=h,a.style.maxWidth=h}else a.style.width="100%";s(a)}p(o,"setupImage"),setTimeout(()=>{a.complete&&o()}),a.addEventListener("error",o),a.addEventListener("load",o)})))}p(fu,"configureLabelImages");var Ly=p(e=>{const{handDrawnSeed:t}=pt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Er=p(e=>{const t=By([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),By=p(e=>{const t=new Map;return e.forEach(r=>{const[i,a]=r.split(":");t.set(i.trim(),a==null?void 0:a.trim())}),t},"styles2Map"),pu=p(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),V=p(e=>{const{stylesArray:t}=Er(e),r=[],i=[],a=[],s=[];return t.forEach(o=>{const n=o[0];pu(n)?r.push(o.join(":")+" !important"):(i.push(o.join(":")+" !important"),n.includes("stroke")&&a.push(o.join(":")+" !important"),n==="fill"&&s.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:a,backgroundStyles:s}},"styles2String"),G=p((e,t)=>{var l;const{themeVariables:r,handDrawnSeed:i}=pt(),{nodeBorder:a,mainBkg:s}=r,{stylesMap:o}=Er(e);return Object.assign({roughness:.7,fill:o.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||a,seed:i,strokeWidth:((l=o.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:Ay(o.get("stroke-dasharray"))},t)},"userNodeOverrides"),Ay=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const a=isNaN(t[0])?0:t[0];return[a,a]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray");const My=Object.freeze({left:0,top:0,width:16,height:16}),la=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),gu=Object.freeze({...My,...la}),Ey=Object.freeze({...gu,body:"",hidden:!1}),$y=Object.freeze({width:null,height:null}),Fy=Object.freeze({...$y,...la}),Dy=(e,t,r,i="")=>{const a=e.split(":");if(e.slice(0,1)==="@"){if(a.length3)return null;i=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){const n=a.pop(),l=a.pop(),c={provider:a.length>0?a[0]:i,prefix:l,name:n};return rs(c)?c:null}const s=a[0],o=s.split("-");if(o.length>1){const n={provider:i,prefix:o.shift(),name:o.join("-")};return rs(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return rs(n,r)?n:null}return null},rs=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function Oy(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function Go(e,t){const r=Oy(e,t);for(const i in Ey)i in la?i in e&&!(i in r)&&(r[i]=la[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function Ry(e,t){const r=e.icons,i=e.aliases||Object.create(null),a=Object.create(null);function s(o){if(r[o])return a[o]=[];if(!(o in a)){a[o]=null;const n=i[o]&&i[o].parent,l=n&&s(n);l&&(a[o]=[n].concat(l))}return a[o]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),a}function Vo(e,t,r){const i=e.icons,a=e.aliases||Object.create(null);let s={};function o(n){s=Go(i[n]||a[n],s)}return o(t),r.forEach(o),Go(e,s)}function Iy(e,t){if(e.icons[t])return Vo(e,t,[]);const r=Ry(e,[t])[t];return r?Vo(e,t,r):null}const Py=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ny=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Xo(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(Py);if(i===null||!i.length)return e;const a=[];let s=i.shift(),o=Ny.test(s);for(;;){if(o){const n=parseFloat(s);isNaN(n)?a.push(s):a.push(Math.ceil(n*t*r)/r)}else a.push(s);if(s=i.shift(),s===void 0)return a.join("");o=!o}}function zy(e,t="defs"){let r="";const i=e.indexOf("=0;){const a=e.indexOf(">",i),s=e.indexOf(""+t);if(a===-1||s===-1)break;const o=e.indexOf(">",s);if(o===-1)break;r+=e.slice(a+1,s).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:r,content:e}}function Wy(e,t){return e?""+e+""+t:t}function qy(e,t,r){const i=zy(e);return Wy(i.defs,t+i.content+r)}const Hy=e=>e==="unset"||e==="undefined"||e==="none";function jy(e,t){const r={...gu,...e},i={...Fy,...t},a={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,b=m.vFlip;let k=m.rotate;x?b?k+=2:(y.push("translate("+(a.width+a.left).toString()+" "+(0-a.top).toString()+")"),y.push("scale(-1 1)"),a.top=a.left=0):b&&(y.push("translate("+(0-a.left).toString()+" "+(a.height+a.top).toString()+")"),y.push("scale(1 -1)"),a.top=a.left=0);let v;switch(k',""))});const o=i.width,n=i.height,l=a.width,c=a.height;let h,u;o===null?(u=n===null?"1em":n==="auto"?c:n,h=Xo(u,l/c)):(h=o==="auto"?l:o,u=n===null?Xo(h,c/l):n==="auto"?c:n);const f={},d=(m,y)=>{Hy(y)||(f[m]=y.toString())};d("width",h),d("height",u);const g=[a.left,a.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const Yy=/\sid="(\S+)"/g,Zo=new Map;function Uy(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Zo.get(e)||0;return Zo.set(e,t+1),t?`${e}${t}`:e}function Gy(e){const t=[];let r;for(;r=Yy.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(a=>{const s=Uy(a),o=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function Vy(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'"+e+""}function An(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ir=An();function mu(e){ir=e}var ii={exec:()=>null};function ft(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(a,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(Yt.caret,"$1"),r=r.replace(a,o),i},getRegex:()=>new RegExp(r,t)};return i}var Xy=(()=>{try{return!!new RegExp("(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^)/i,endPreScriptTag:/^)/i,startAngleBracket:/^,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&"']/,escapeReplace:/[&"']/g,escapeTestNoEncode:/["']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/["']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}|!--)`,"i")},Zy=/^(?:[ \t]*(?:\n|$))+/,Ky=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qy=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Mn=/(?:[*+-]|\d{1,9}[.)])/,yu=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xu=ft(yu).replace(/bull/g,Mn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}]+>\n/).replace(/\|table/g,"").getRegex(),tx=ft(yu).replace(/bull/g,Mn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),En=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ex=/^[^\n]+/,$n=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,rx=ft(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$n).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ix=ft(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Mn).getRegex(),Aa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Fn=/|$))/,ax=ft("^ {0,3}(?:][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|\\n*|$)|\\n*|$)|\\n*|$)|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Fn).replace("tag",Aa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=`]+)?/).getRegex(),bu=ft(En).replace("hr",mi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)| ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bu).getRegex(),Dn={blockquote:sx,code:Ky,def:rx,fences:Qy,heading:Jy,hr:mi,html:ax,lheading:xu,list:ix,newline:Zy,paragraph:bu,table:ii,text:ex},Ko=ft("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)| *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ii,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ft(En).replace("hr",mi).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",xu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lx=/^\\([!"#$%&'()*+,\-./:;?@\[\]\\^_`{|}~])/,cx=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Cu=/^( {2,}|\\)\n(?!\s*$)/,hx=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xy?"(?`+)[^`]+\k(?!`)/).replace("html",/]*?>/).getRegex(),wu=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,gx=ft(wu,"u").replace(/punct/g,Ma).getRegex(),mx=ft(wu,"u").replace(/punct/g,_u).getRegex(),Su="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yx=ft(Su,"gu").replace(/notPunctSpace/g,ku).replace(/punctSpace/g,On).replace(/punct/g,Ma).getRegex(),xx=ft(Su,"gu").replace(/notPunctSpace/g,fx).replace(/punctSpace/g,dx).replace(/punct/g,_u).getRegex(),bx=ft("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ku).replace(/punctSpace/g,On).replace(/punct/g,Ma).getRegex(),Cx=ft(/\\(punct)/,"gu").replace(/punct/g,Ma).getRegex(),kx=ft(/^]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_x=ft(Fn).replace("(?:-->|$)","-->").getRegex(),wx=ft("^comment|^[a-zA-Z][\\w:-]*\\s*>|^|^|^|^").replace("comment",_x).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=`]+)?/).getRegex(),ca=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Sx=ft(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ca).replace("href",/\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vu=ft(/^!?\[(label)\]\[(ref)\]/).replace("label",ca).replace("ref",$n).getRegex(),Tu=ft(/^!?\[(ref)\](?:\[\])?/).replace("ref",$n).getRegex(),vx=ft("reflink|nolink(?!\\()","g").replace("reflink",vu).replace("nolink",Tu).getRegex(),Qo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Rn={_backpedal:ii,anyPunctuation:Cx,autolink:kx,blockSkip:px,br:Cu,code:cx,del:ii,emStrongLDelim:gx,emStrongRDelimAst:yx,emStrongRDelimUnd:bx,escape:lx,link:Sx,nolink:Tu,punctuation:ux,reflink:vu,reflinkSearch:vx,tag:wx,text:hx,url:ii},Tx={...Rn,link:ft(/^!?\[(label)\]\((.*?)\)/).replace("label",ca).getRegex(),reflink:ft(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ca).getRegex()},Ps={...Rn,emStrongRDelimAst:xx,emStrongLDelim:mx,url:ft(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s":">",'"':""","'":"'"},Jo=e=>Bx[e];function me(e,t){if(t){if(Yt.escapeTest.test(e))return e.replace(Yt.escapeReplace,Jo)}else if(Yt.escapeTestNoEncode.test(e))return e.replace(Yt.escapeReplaceNoEncode,Jo);return e}function tl(e){try{e=encodeURI(e).replace(Yt.percentDecode,"%")}catch{return null}return e}function el(e,t){var s;let r=e.replace(Yt.findPipe,(o,n,l)=>{let c=!1,h=n;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),i=r.split(Yt.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function rl(e,t,r,i,a){let s=t.href,o=t.title||null,n=e[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:o,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function Mx(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let a=i[1];return t.split(` `).map(s=>{let o=s.match(r.other.beginningSpace);if(o===null)return s;let[n]=o;return n.length>=a.length?s.slice(a.length):s}).join(` `)}var ha=class{constructor(t){yt(this,"options");yt(this,"rules");yt(this,"lexer");this.options=t||ir}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Hr(i,` `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],a=Mx(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:a}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let a=Hr(i,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(i=a.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Hr(r[0],` `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Hr(r[0],` `).split(` `),a="",s="",o=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c1,s={type:"list",raw:"",ordered:a,start:a?+i.slice(0,-1):"",loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:"[*+-]");let o=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",u="";if(!(r=o.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),d=t.split(` `,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,u=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(d)&&(h+=d+` `,t=t.substring(d.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),v=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),C=this.rules.other.htmlBeginRegex(m);for(;t;){let T=t.split(` `,1)[0],F;if(d=T,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),F=d):F=d.replace(this.rules.other.tabCharGlobal," "),v.test(d)||S.test(d)||C.test(d)||b.test(d)||k.test(d))break;if(F.search(this.rules.other.nonSpaceChar)>=m||!d.trim())u+=` `+F.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||S.test(f)||k.test(f))break;u+=` `+d}!g&&!d.trim()&&(g=!0),h+=T+` `,t=t.substring(T.length+1),f=F.slice(m)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(u),y&&(x=y[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:u,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;cf.type==="space"),u=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=u}if(s.loose)for(let c=0;c({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[h]})));return o}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===` `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=Hr(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=Ax(r[2],"()");if(o===-2)return;if(o>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let a=r[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(a);o&&(a=o[1],s=o[3])}else s=r[3]?r[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?a=a.slice(1):a=a.slice(1,-1)),rl(r,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let a=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[a.toLowerCase()];if(!s){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return rl(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||a[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...a[0]].length-1,o,n,l=s,c=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(a=h.exec(r))!=null;){if(o=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!o)continue;if(n=[...o].length,a[3]||a[4]){l+=n;continue}else if((a[5]||a[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let u=[...a[0]][0].length,f=t.slice(0,s+a.index+u+n);if(Math.min(s,n)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let d=f.slice(2,-2);return{type:"strong",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return a&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,a;return r[2]==="@"?(i=r[1],a="mailto:"+i):(i=r[1],a=i),{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}url(t){var i;let r;if(r=this.rules.inline.url.exec(t)){let a,s;if(r[2]==="@")a=r[0],s="mailto:"+a;else{let o;do o=r[0],r[0]=((i=this.rules.inline._backpedal.exec(r[0]))==null?void 0:i[0])??"";while(o!==r[0]);a=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:a,href:s,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},oe=class Ns{constructor(t){yt(this,"tokens");yt(this,"options");yt(this,"state");yt(this,"tokenizer");yt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ir,this.options.tokenizer=this.options.tokenizer||new ha,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Yt,block:Mi.normal,inline:qr.normal};this.options.pedantic?(r.block=Mi.pedantic,r.inline=qr.pedantic):this.options.gfm&&(r.block=Mi.gfm,this.options.breaks?r.inline=qr.breaks:r.inline=qr.gfm),this.tokenizer.rules=r}static get rules(){return{block:Mi,inline:qr}}static lex(t,r){return new Ns(r).lex(t)}static lexInline(t,r){return new Ns(r).inlineTokens(t)}lex(t){t=t.replace(Yt.carriageReturn,` `),this.blockTokens(t,this.tokens);for(let r=0;r(n=c.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))continue;if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);let c=r.at(-1);n.raw.length===1&&c!==void 0?c.raw+=` `:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(` `)?"":` `)+n.raw,c.text+=` `+n.text,this.inlineQueue.at(-1).src=c.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(` `)?"":` `)+n.raw,c.text+=` `+n.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},r.push(n));continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}let l=t;if((o=this.options.extensions)!=null&&o.startBlock){let c=1/0,h=t.slice(1),u;this.options.extensions.startBlock.forEach(f=>{u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c=0&&(l=t.substring(0,c+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){let c=r.at(-1);i&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(` `)?"":` `)+n.raw,c.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(n),i=l.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(` `)?"":` `)+n.raw,c.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(n);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var l,c,h,u,f;let i=t,a=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=a[2]?a[2].length:0,i=i.slice(0,a.index+s)+"["+"a".repeat(a[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((c=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:c.call({lexer:this},i))??i;let o=!1,n="";for(;t;){o||(n=""),o=!1;let d;if((u=(h=this.options.extensions)==null?void 0:h.inline)!=null&&u.some(m=>(d=m.call({lexer:this},t,r))?(t=t.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let m=r.at(-1);d.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=d.raw,m.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(t,i,n)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),r.push(d);continue}let g=t;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=t.slice(1),x;this.options.extensions.startInline.forEach(b=>{x=b.call({lexer:this},y),typeof x=="number"&&x>=0&&(m=Math.min(m,x))}),m=0&&(g=t.substring(0,m+1))}if(d=this.tokenizer.inlineText(g)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(n=d.raw.slice(-1)),o=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=d.raw,m.text+=d.text):r.push(d);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},ua=class{constructor(t){yt(this,"options");yt(this,"parser");this.options=t||ir}space(t){return""}code({text:t,lang:r,escaped:i}){var o;let a=(o=(r||"").match(Yt.notSpaceStart))==null?void 0:o[0],s=t.replace(Yt.endingNewline,"")+` `;return a?'
'+(i?s:me(s,!0))+`
`:"
"+(i?s:me(s,!0))+`
`}blockquote({tokens:t}){return`
${this.parser.parse(t)}
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`${this.parser.parseInline(t)}${r}> `}hr(t){return`
`}list(t){let r=t.ordered,i=t.start,a="";for(let n=0;n `+a+""+s+`> `}listitem(t){var i;let r="";if(t.task){let a=this.checkbox({checked:!!t.checked});t.loose?((i=t.tokens[0])==null?void 0:i.type)==="paragraph"?(t.tokens[0].text=a+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=a+" "+me(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:a+" ",text:a+" ",escaped:!0}):r+=a+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`
  • ${r}
  • `}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    `}table(t){let r="",i="";for(let s=0;s${a}`),` `+r+` `+a+`
    `}tablerow({text:t}){return` ${t} `}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?``:``)+r+`${i}> `}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${me(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:r,tokens:i}){let a=this.parser.parseInline(i),s=tl(t);if(s===null)return a;t=s;let o='
    "+a+"",o}image({href:t,title:r,text:i,tokens:a}){a&&(i=this.parser.parseInline(a,this.parser.textRenderer));let s=tl(t);if(s===null)return me(i);t=s;let o=`${i}",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:me(t.text)}},In=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},le=class zs{constructor(t){yt(this,"options");yt(this,"renderer");yt(this,"textRenderer");this.options=t||ir,this.options.renderer=this.options.renderer||new ua,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new In}static parse(t,r){return new zs(r).parse(t)}static parseInline(t,r){return new zs(r).parseInline(t)}parse(t,r=!0){var a,s;let i="";for(let o=0;o{let c=n[l].flat(1/0);i=i.concat(this.walkTokens(c,r))}):n.tokens&&(i=i.concat(this.walkTokens(n.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let a={...i};if(a.async=this.defaults.async||a.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=r.renderers[s.name];o?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=o.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=r[s.level];o?o.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),a.extensions=r),i.renderer){let s=this.defaults.renderer||new ua(this.defaults);for(let o in i.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let n=o,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u||""}}a.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new ha(this.defaults);for(let o in i.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let n=o,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u}}a.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Xr;for(let o in i.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let n=o,l=i.hooks[n],c=s[n];Xr.passThroughHooks.has(o)?s[n]=h=>{if(this.defaults.async&&Xr.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await l.call(s,h);return c.call(s,f)})();let u=l.call(s,h);return c.call(s,u)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await c.apply(s,h)),f})();let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u}}a.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,o=i.walkTokens;a.walkTokens=function(n){let l=[];return l.push(o.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return oe.lex(t,r??this.defaults)}parser(t,r){return le.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let a={...i},s={...this.defaults,...a},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&a.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?oe.lex:oe.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?le.parse:le.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(o);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?oe.lex:oe.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?le.parse:le.parseInline)(n,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(n){return o(n)}}}onError(t,r){return i=>{if(i.message+=` Please report this to https://github.com/markedjs/marked.`,t){let a="

    An error occurred:

    "+me(i.message+"",!0)+"
    ";return r?Promise.resolve(a):a}if(r)return Promise.reject(i);throw i}}},er=new Ex;function gt(e,t){return er.parse(e,t)}gt.options=gt.setOptions=function(e){return er.setOptions(e),gt.defaults=er.defaults,mu(gt.defaults),gt};gt.getDefaults=An;gt.defaults=ir;gt.use=function(...e){return er.use(...e),gt.defaults=er.defaults,mu(gt.defaults),gt};gt.walkTokens=function(e,t){return er.walkTokens(e,t)};gt.parseInline=er.parseInline;gt.Parser=le;gt.parser=le.parse;gt.Renderer=ua;gt.TextRenderer=In;gt.Lexer=oe;gt.lexer=oe.lex;gt.Tokenizer=ha;gt.Hooks=Xr;gt.parse=gt;gt.options;gt.setOptions;gt.use;gt.walkTokens;gt.parseInline;le.parse;oe.lex;function Lu(e){for(var t=[],r=1;r?',height:80,width:80},Ws=new Map,Bu=new Map,Fx=p(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(D.debug("Registering icon pack:",t.name),"loader"in t)Bu.set(t.name,t.loader);else if("icons"in t)Ws.set(t.name,t.icons);else throw D.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Au=p(async(e,t)=>{const r=Dy(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let a=Ws.get(i);if(!a){const o=Bu.get(i);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{a={...await o(),prefix:i},Ws.set(i,a)}catch(n){throw D.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=Iy(a,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),Dx=p(async e=>{try{return await Au(e),!0}catch{return!1}},"isIconAvailable"),yi=p(async(e,t,r)=>{let i;try{i=await Au(e,t==null?void 0:t.fallbackPrefix)}catch(o){D.error(o),i=$x}const a=jy(i,t),s=Vy(Gy(a.body),{...a.attributes,...r});return de(s,It())},"getIconSVG");function Mu(e,{markdownAutoWrap:t}){const i=e.replace(/
    /g,` `).replace(/\n{2,}/g,` `);return Lu(i)}p(Mu,"preprocessMarkdown");function Eu(e){return e.split(/\\n|\n|
    /gi).map(t=>{var r;return((r=t.trim().match(/]+>|[^\s]+/g))==null?void 0:r.map(i=>({content:i,type:"normal"})))??[]})}p(Eu,"nonMarkdownToLines");function $u(e,t={}){const r=Mu(e,t),i=gt.lexer(r),a=[[]];let s=0;function o(n,l="normal"){n.type==="text"?n.text.split(` `).forEach((h,u)=>{u!==0&&(s++,a.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&a[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{o(c,n.type)}):n.type==="html"&&a[s].push({content:n.text,type:"normal"})}return p(o,"processNode"),i.forEach(n=>{var l;n.type==="paragraph"?(l=n.tokens)==null||l.forEach(c=>{o(c)}):n.type==="html"?a[s].push({content:n.text,type:"normal"}):a[s].push({content:n.raw,type:"normal"})}),a}p($u,"markdownToLines");function Fu(e){return e?`

    ${e.replace(/\\n|\n/g,"
    ")}

    `:""}p(Fu,"nonMarkdownToHTML");function Du(e,{markdownAutoWrap:t}={}){const r=gt.lexer(e);function i(a){var s,o,n;return a.type==="text"?t===!1?a.text.replace(/\n */g,"
    ").replace(/ /g," "):a.text.replace(/\n */g,"
    "):a.type==="strong"?`${(s=a.tokens)==null?void 0:s.map(i).join("")}`:a.type==="em"?`${(o=a.tokens)==null?void 0:o.map(i).join("")}`:a.type==="paragraph"?`

    ${(n=a.tokens)==null?void 0:n.map(i).join("")}

    `:a.type==="space"?"":a.type==="html"?`${a.text}`:a.type==="escape"?a.text:(D.warn(`Unsupported markdown: ${a.type}`),a.raw)}return p(i,"output"),r.map(i).join("")}p(Du,"markdownToHTML");function Ou(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(Ou,"splitTextToChars");function Ru(e,t){const r=Ou(t.content);return Pn(e,[],r,t.type)}p(Ru,"splitWordToFitWidth");function Pn(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[a,...s]=r,o=[...t,a];return e([{content:o.join(""),type:i}])?Pn(e,o,s,i):(t.length===0&&a&&(t.push(a),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(Pn,"splitWordToFitWidthRecursion");function Iu(e,t){if(e.some(({content:r})=>r.includes(` `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return da(e,t)}p(Iu,"splitLineToFitWidth");function da(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let a="";e[0].content===" "&&(a=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},o=[...i];if(a!==""&&o.push({content:a,type:"normal"}),o.push(s),t(o))return da(e,t,r,o);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=Ru(t,s);r.push([n]),l.content&&e.unshift(l)}return da(e,t,r)}p(da,"splitLineToFitWidthRecursion");function qs(e,t){t&&e.attr("style",t)}p(qs,"applyStyle");var il=16384;async function Pu(e,t,r,i,a=!1,s=It()){const o=e.append("foreignObject");o.attr("width",`${Math.min(10*r,il)}px`),o.attr("height",`${Math.min(10*r,il)}px`);const n=o.append("xhtml:div"),l=ai(t.label)?await Ul(t.label.replace(pi.lineBreakRegex,` `),s):de(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),qs(h,t.labelStyle),h.attr("class",`${c} ${i}`),qs(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),a&&n.attr("class","labelBkg");let u=n.node().getBoundingClientRect();return u.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),u=n.node().getBoundingClientRect()),o.node()}p(Pu,"addHtmlSpan");function Ea(e,t,r,i=!1){const a=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&a.attr("text-anchor","middle"),a}p(Ea,"createTspan");function Nu(e,t,r){const i=e.append("text"),a=Ea(i,1,t);$a(a,r);const s=a.node().getComputedTextLength();return i.remove(),s}p(Nu,"computeWidthOfText");function Ox(e,t,r){var o;const i=e.append("text"),a=Ea(i,1,t);$a(a,[{content:r,type:"normal"}]);const s=(o=a.node())==null?void 0:o.getBoundingClientRect();return s&&i.remove(),s}p(Ox,"computeDimensionOfText");function zu(e,t,r,i=!1,a=!1){const o=t.append("g"),n=o.insert("rect").attr("class","background").attr("style","stroke: none"),l=o.append("text").attr("y","-10.1");a&&l.attr("text-anchor","middle");let c=0;for(const h of r){const u=p(d=>Nu(o,1.1,d){const a=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?a.text(r.content):a.text(" "+r.content)})}p($a,"updateTextContentAndStyles");async function Wu(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(a,s,o)=>(r.push((async()=>{const n=`${s}:${o}`;return await Dx(n)?await yi(n,void 0,{class:"label-icon"}):``})()),a));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(Wu,"replaceIconSubstring");var Me=p(async(e,t="",{style:r="",isTitle:i=!1,classes:a="",useHtmlLabels:s=!0,markdown:o=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(D.debug("XYZ createText",t,r,i,a,s,n,"addSvgBackground: ",c),s){const u=o?Du(t,h):Fu(t),f=await Wu(Mr(u),h),d=t.replace(/\\\\/g,"\\"),g={isNode:n,label:ai(t)?d:f,labelStyle:r.replace("fill:","color:")};return await Pu(e,g,l,a,c,h)}else{const u=t.replace(/
    /g,"
    "),f=o?$u(u.replace("
    ","
    "),h):Eu(u),d=zu(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ot(d).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ot(d).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ot(d).select("text").attr("style",m)}return i?ot(d).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ot(d).selectAll("tspan.text-outer-tspan").classed("row",!0),d}},"createText");function is(e,t,r){if(e&&e.length){const[i,a]=t,s=Math.PI/180*r,o=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*o-(h-a)*n+i,l[1]=(c-i)*n+(h-a)*o+a}}}function Rx(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ix(e,t,r,i=1){const a=r,s=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(a)for(const c of o)is(c,n,a);const l=(function(c,h,u){const f=[];for(const b of c){const k=[...b];Rx(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const d=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let k=0;kb.ymink.ymin?1:b.xk.x?1:b.ymax===k.ymax?0:(b.ymax-k.ymax)/Math.abs(b.ymax-k.ymax))),!g.length)return d;let m=[],y=g[0].ymin,x=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let k=0;ky);k++)b=k;g.splice(0,b+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((b=>!(b.edge.ymaxb.edge.x===k.edge.x?0:(b.edge.x-k.edge.x)/Math.abs(b.edge.x-k.edge.x))),(u!==1||x%h==0)&&m.length>1)for(let b=0;b=m.length)break;const v=m[b].edge,S=m[k].edge;d.push([[Math.round(v.x),y],[Math.round(S.x),y]])}y+=u,m.forEach((b=>{b.edge.x=b.edge.x+u*b.edge.islope})),x++}return d})(o,s,i);if(a){for(const c of o)is(c,n,-a);(function(c,h,u){const f=[];c.forEach((d=>f.push(...d))),is(f,h,u)})(l,n,-a)}return l}function xi(e,t){var r;const i=t.hachureAngle+90;let a=t.hachureGap;a=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=a),Ix(e,a,i,s||1)}class Nn{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=xi(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const a of t)i.push(...this.helper.doubleLineOps(a[0][0],a[0][1],a[1][0],a[1][1],r));return i}}function Fa(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class Px extends Nn{fillPolygons(t,r){let i=r.hachureGap;i{const n=Fa(o),l=Math.floor(n/(i+a)),c=(n+a-l*(i+a))/2;let h=o[0],u=o[1];h[0]>u[0]&&(h=o[1],u=o[0]);const f=Math.atan((u[1]-h[1])/(u[0]-h[0]));for(let d=0;d{const o=Fa(s),n=Math.round(o/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let u=0;uh%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=a}return s}function Hu(e){const t=[];let r="",i=0,a=0,s=0,o=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,a]=h,[s,o]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],a=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,a]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,a]});break;case"V":a=h[0],t.push({key:"L",data:[i,a]});break;case"S":{let u=0,f=0;r==="C"||r==="S"?(u=i+(i-n),f=a+(a-l)):(u=i,f=a),t.push({key:"C",data:[u,f,...h]}),n=h[0],l=h[1],i=h[2],a=h[3];break}case"T":{const[u,f]=h;let d=0,g=0;r==="Q"||r==="T"?(d=i+(i-n),g=a+(a-l)):(d=i,g=a);const m=i+2*(d-i)/3,y=a+2*(g-a)/3,x=u+2*(d-u)/3,b=f+2*(g-f)/3;t.push({key:"C",data:[m,y,x,b,u,f]}),n=d,l=g,i=u,a=f;break}case"Q":{const[u,f,d,g]=h,m=i+2*(u-i)/3,y=a+2*(f-a)/3,x=d+2*(u-d)/3,b=g+2*(f-g)/3;t.push({key:"C",data:[m,y,x,b,d,g]}),n=u,l=f,i=d,a=g;break}case"A":{const u=Math.abs(h[0]),f=Math.abs(h[1]),d=h[2],g=h[3],m=h[4],y=h[5],x=h[6];u===0||f===0?(t.push({key:"C",data:[i,a,y,x,y,x]}),i=y,a=x):(i!==y||a!==x)&&(ju(i,a,y,x,u,f,d,g,m).forEach((function(b){t.push({key:"C",data:b})})),i=y,a=x);break}case"Z":t.push({key:"Z",data:[]}),i=s,a=o}r=c}return t}function jr(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function ju(e,t,r,i,a,s,o,n,l,c){const h=(u=o,Math.PI*u/180);var u;let f=[],d=0,g=0,m=0,y=0;if(c)[d,g,m,y]=c;else{[e,t]=jr(e,t,-h),[r,i]=jr(r,i,-h);const O=(e-r)/2,A=(t-i)/2;let M=O*O/(a*a)+A*A/(s*s);M>1&&(M=Math.sqrt(M),a*=M,s*=M);const L=a*a,E=s*s,B=L*E-L*A*A-E*O*O,W=L*A*A+E*O*O,Y=(n===l?-1:1)*Math.sqrt(Math.abs(B/W));m=Y*a*A/s+(e+r)/2,y=Y*-s*O/a+(t+i)/2,d=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),eg&&(d-=2*Math.PI),!l&&g>d&&(g-=2*Math.PI)}let x=g-d;if(Math.abs(x)>120*Math.PI/180){const O=g,A=r,M=i;g=l&&g>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,f=ju(r=m+a*Math.cos(g),i=y+s*Math.sin(g),A,M,a,s,o,0,l,[g,O,m,y])}x=g-d;const b=Math.cos(d),k=Math.sin(d),v=Math.cos(g),S=Math.sin(g),C=Math.tan(x/4),T=4/3*a*C,F=4/3*s*C,P=[e,t],R=[e+T*k,t-F*b],$=[r+T*S,i-F*v],z=[r,i];if(R[0]=2*P[0]-R[0],R[1]=2*P[1]-R[1],c)return[R,$,z].concat(f);{f=[R,$,z].concat(f);const O=[];for(let A=0;A2){const a=[];for(let s=0;s2*Math.PI&&(d=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-d)/2),x=hl(y,c,h,u,f,d,g,1,l);if(!l.disableMultiStroke){const b=hl(y,c,h,u,f,d,g,1.5,l);x.push(...b)}return o&&(n?x.push(...Ne(c,h,c+u*Math.cos(d),h+f*Math.sin(d),l),...Ne(c,h,c+u*Math.cos(g),h+f*Math.sin(g),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+u*Math.cos(d),h+f*Math.sin(d)]})),{type:"path",ops:x}}function ol(e,t){const r=Hu(qu(zn(e))),i=[];let a=[0,0],s=[0,0];for(const{key:o,data:n}of r)switch(o){case"M":s=[n[0],n[1]],a=[n[0],n[1]];break;case"L":i.push(...Ne(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,u,f,d]=n;i.push(...Gx(l,c,h,u,f,d,s,t)),s=[f,d];break}case"Z":i.push(...Ne(s[0],s[1],a[0],a[1],t)),s=[a[0],a[1]]}return{type:"path",ops:i}}function ns(e,t){const r=[];for(const i of e)if(i.length){const a=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+rt(a,t),i[0][1]+rt(a,t)]});for(let o=1;o500?.4:-.0016668*l+1.233334;let h=a.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const u=h/2,f=.2+.2*Gu(a);let d=a.bowing*a.maxRandomnessOffset*(i-t)/200,g=a.bowing*a.maxRandomnessOffset*(e-r)/200;d=rt(d,a,c),g=rt(g,a,c);const m=[],y=()=>rt(u,a,c),x=()=>rt(h,a,c),b=a.preserveVertices;return o?m.push({op:"move",data:[e+(b?0:y()),t+(b?0:y())]}):m.push({op:"move",data:[e+(b?0:rt(h,a,c)),t+(b?0:rt(h,a,c))]}),o?m.push({op:"bcurveTo",data:[d+e+(r-e)*f+y(),g+t+(i-t)*f+y(),d+e+2*(r-e)*f+y(),g+t+2*(i-t)*f+y(),r+(b?0:y()),i+(b?0:y())]}):m.push({op:"bcurveTo",data:[d+e+(r-e)*f+x(),g+t+(i-t)*f+x(),d+e+2*(r-e)*f+x(),g+t+2*(i-t)*f+x(),r+(b?0:x()),i+(b?0:x())]}),m}function $i(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+rt(t,r),e[0][1]+rt(t,r)]),i.push([e[0][0]+rt(t,r),e[0][1]+rt(t,r)]);for(let a=1;a3){const s=[],o=1-r.curveTightness;a.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+21&&a.push(n)):a.push(n),a.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],u=e[t+3],f=Ge(l,c,.5),d=Ge(c,h,.5),g=Ge(h,u,.5),m=Ge(f,d,.5),y=Ge(d,g,.5),x=Ge(m,y,.5);Ys([l,f,m,x],0,r,a),Ys([x,y,g,u],0,r,a)}var s,o;return a}function Xx(e,t){return ga(e,0,e.length,t)}function ga(e,t,r,i,a){const s=a||[],o=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;hl&&(l=u,c=h)}return Math.sqrt(l)>i?(ga(e,t,c+1,i,s),ga(e,c,r,i,s)):(s.length||s.push(o),s.push(n)),s}function os(e,t=.15,r){const i=[],a=(e.length-1)/3;for(let s=0;s0?ga(i,0,i.length,r):i}const Qt="none";class ma{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,a,s){const o=this._o(s);return this._d("line",[Yu(t,r,i,a,o)],o)}rectangle(t,r,i,a,s){const o=this._o(s),n=[],l=Ux(t,r,i,a,o);if(o.fill){const c=[[t,r],[t+i,r],[t+i,r+a],[t,r+a]];o.fillStyle==="solid"?n.push(ns([c],o)):n.push(hr([c],o))}return o.stroke!==Qt&&n.push(l),this._d("rectangle",n,o)}ellipse(t,r,i,a,s){const o=this._o(s),n=[],l=Uu(i,a,o),c=Hs(t,r,o,l);if(o.fill)if(o.fillStyle==="solid"){const h=Hs(t,r,o,l).opset;h.type="fillPath",n.push(h)}else n.push(hr([c.estimatedPoints],o));return o.stroke!==Qt&&n.push(c.opset),this._d("ellipse",n,o)}circle(t,r,i,a){const s=this.ellipse(t,r,i,i,a);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Hi(t,!1,i)],i)}arc(t,r,i,a,s,o,n=!1,l){const c=this._o(l),h=[],u=nl(t,r,i,a,s,o,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const d=nl(t,r,i,a,s,o,!0,!1,f);d.type="fillPath",h.push(d)}else h.push((function(f,d,g,m,y,x,b){const k=f,v=d;let S=Math.abs(g/2),C=Math.abs(m/2);S+=rt(.01*S,b),C+=rt(.01*C,b);let T=y,F=x;for(;T2*Math.PI&&(T=0,F=2*Math.PI);const P=(F-T)/b.curveStepCount,R=[];for(let $=T;${x.length>=4&&m.push(...os(x,u)),x=[]},k=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:S,data:C}of d)switch(S){case"M":k(),y=[C[0],C[1]],m.push(y);break;case"L":b(),m.push([C[0],C[1]]);break;case"C":if(!x.length){const T=m.length?m[m.length-1]:y;x.push([T[0],T[1]])}x.push([C[0],C[1]]),x.push([C[2],C[3]]),x.push([C[4],C[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(k(),!f)return g;const v=[];for(const S of g){const C=Xx(S,f);C.length&&v.push(C)}return v})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=ol(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=ol(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else a.push(ns(l,i));else a.push(hr(l,i));return o&&(n?l.forEach((h=>{a.push(Hi(h,!1,i))})):a.push(c)),this._d("path",a,i)}opsToPath(t,r){let i="";for(const a of t.ops){const s=typeof r=="number"&&r>=0?a.data.map((o=>+o.toFixed(r))):a.data;switch(a.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,a=[];for(const s of r){let o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:Qt};break;case"fillPath":o={d:this.opsToPath(s),stroke:Qt,strokeWidth:0,fill:i.fill||Qt};break;case"fillSketch":o=this.fillSketch(s,i)}o&&a.push(o)}return a}fillSketch(t,r){let i=r.fillWeight;return ii===0||r.op!=="move"))}}class Zx{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ma(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),a=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const o of r)switch(o.type){case"path":a.save(),a.strokeStyle=i.stroke==="none"?"transparent":i.stroke,a.lineWidth=i.strokeWidth,i.strokeLineDash&&a.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(a.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(a,o,s),a.restore();break;case"fillPath":{a.save(),a.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(a,o,s,n),a.restore();break}case"fillSketch":this.fillSketch(a,o,i)}}fillSketch(t,r,i){let a=i.fillWeight;a=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}r.type==="fillPath"?t.fill(a):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,a,s){const o=this.gen.line(t,r,i,a,s);return this.draw(o),o}rectangle(t,r,i,a,s){const o=this.gen.rectangle(t,r,i,a,s);return this.draw(o),o}ellipse(t,r,i,a,s){const o=this.gen.ellipse(t,r,i,a,s);return this.draw(o),o}circle(t,r,i,a){const s=this.gen.circle(t,r,i,a);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,a,s,o,n=!1,l){const c=this.gen.arc(t,r,i,a,s,o,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Fi="http://www.w3.org/2000/svg";class Kx{constructor(t,r){this.svg=t,this.gen=new ma(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),a=this.svg.ownerDocument||window.document,s=a.createElementNS(Fi,"g"),o=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=a.createElementNS(Fi,"path"),l.setAttribute("d",this.opsToPath(n,o)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=a.createElementNS(Fi,"path"),l.setAttribute("d",this.opsToPath(n,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(a,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let a=i.fillWeight;anew Zx(e,t),svg:(e,t)=>new Kx(e,t),generator:e=>new ma(e),newSeed:()=>ma.newSeed()},et=p(async(e,t,r)=>{var d,g;let i;const a=t.useHtmlLabels||We((d=pt())==null?void 0:d.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=s.insert("g").attr("class","label").attr("style",Nt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await Me(o,de(Mr(n),pt()),{useHtmlLabels:a,width:t.width||((g=pt().flowchart)==null?void 0:g.wrappingWidth),cssClasses:c?"markdown-node-label":void 0,style:t.labelStyle,addSvgBackground:l,markdown:c},pt());let u=h.getBBox();const f=((t==null?void 0:t.padding)??0)/2;if(a){const m=h.children[0],y=ot(h);await fu(m,n),u=m.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height)}return a?o.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):o.attr("transform","translate(0, "+-u.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:s,bbox:u,halfPadding:f,label:o}},"labelHelper"),ls=p(async(e,t,r)=>{var l,c;const i=r.useHtmlLabels??zt(pt()),a=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Me(a,de(Mr(t),pt()),{useHtmlLabels:i,width:r.width||((c=(l=pt())==null?void 0:l.flowchart)==null?void 0:c.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let o=s.getBBox();const n=r.padding/2;if(zt(pt())){const h=s.children[0],u=ot(s);o=h.getBoundingClientRect(),u.attr("width",o.width),u.attr("height",o.height)}return i?a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):a.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:e,bbox:o,halfPadding:n,label:a}},"insertLabel"),Z=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),tt=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function ht(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(ht,"createPathFromPoints");function ze(e,t,r,i,a,s){const o=[],l=r-e,c=i-t,h=l/s,u=2*Math.PI/h,f=t+c/2;for(let d=0;d{var r=e.x,i=e.y,a=t.x-r,s=t.y-i,o=e.width/2,n=e.height/2,l,c;return Math.abs(s)*o>Math.abs(a)*n?(s{let s=t||"";typeof s=="object"&&(s=s[0]);const o=pt(),n=zt(o);return await Me(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:a,width:Number.POSITIVE_INFINITY},o)},"createLabel"),De=Jx,qe=p((e,t,r,i,a)=>["M",e+a,t,"H",e+r-a,"A",a,a,0,0,1,e+r,t+a,"V",t+i-a,"A",a,a,0,0,1,e+r-a,t+i,"H",e+a,"A",a,a,0,0,1,e,t+i-a,"V",t+a,"A",a,a,0,0,1,e+a,t,"Z"].join(" "),"createRoundedRectPathD"),Vu=p(async(e,t)=>{D.info("Creating subgraph rect for ",t.id,t);const r=pt(),{themeVariables:i,handDrawnSeed:a}=r,{clusterBkg:s,clusterBorder:o}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=V(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),f=zt(r),d=u.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await Me(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await De(d,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(zt(r)){const T=g.children[0],F=ot(g);m=T.getBoundingClientRect(),F.attr("width",m.width),F.attr("height",m.height)}const y=t.width(D.debug("Rough node insert CXC",P),P),":first-child"),v.select("path:nth-child(2)").attr("style",c.join(";")),v.select("path").attr("style",h.join(";").replace("fill","stroke"))}else v=u.insert("rect",":first-child"),v.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:S}=Bn(r);if(d.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const T=d.select("span");T&&T.attr("style",n)}const C=v.node().getBBox();return t.offsetX=0,t.width=C.width,t.height=C.height,t.offsetY=m.height-t.padding/2,t.intersect=function(T){return $r(t,T)},{cluster:u,labelBBox:m}},"rect"),tb=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.id),i=r.insert("rect",":first-child"),a=0*t.padding,s=a/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+a).attr("height",t.height+a).attr("fill","none");const o=i.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(n){return $r(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),eb=p(async(e,t)=>{const r=pt(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:s,compositeBackground:o,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),u=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const d=await De(u,t.label,t.labelStyle,void 0,!0);let g=d.getBBox();if(zt(r)){const P=d.children[0],R=ot(d);g=P.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}const m=0*t.padding,y=m/2,x=(t.width$,":first-child");const z=R.rectangle(v,C,x,k,{fill:P?s:o,fillStyle:P?"hachure":"solid",stroke:l,seed:a});T=c.insert(()=>$,":first-child"),f=c.insert(()=>z)}else T=h.insert("rect",":first-child"),T.attr("class","outer").attr("x",v).attr("y",S).attr("width",x).attr("height",b).attr("data-look",t.look),f.attr("class","inner").attr("x",v).attr("y",C).attr("width",x).attr("height",k);u.attr("transform",`translate(${t.x-g.width/2}, ${S+1-(zt(r)?0:3)})`);const F=T.node().getBBox();return t.height=F.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(P){return $r(t,P)},{cluster:c,labelBBox:g}},"roundedWithTitle"),rb=p(async(e,t)=>{D.info("Creating subgraph rect for ",t.id,t);const r=pt(),{themeVariables:i,handDrawnSeed:a}=r,{clusterBkg:s,clusterBorder:o}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=V(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),f=zt(r),d=u.insert("g").attr("class","cluster-label "),g=await Me(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(zt(r)){const T=g.children[0],F=ot(g);m=T.getBoundingClientRect(),F.attr("width",m.width),F.attr("height",m.height)}const y=t.width(D.debug("Rough node insert CXC",P),P),":first-child"),v.select("path:nth-child(2)").attr("style",c.join(";")),v.select("path").attr("style",h.join(";").replace("fill","stroke"))}else v=u.insert("rect",":first-child"),v.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:S}=Bn(r);if(d.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const T=d.select("span");T&&T.attr("style",n)}const C=v.node().getBBox();return t.offsetX=0,t.width=C.width,t.height=C.height,t.offsetY=m.height-t.padding/2,t.intersect=function(T){return $r(t,T)},{cluster:u,labelBBox:m}},"kanbanSection"),ib=p((e,t)=>{const r=pt(),{themeVariables:i,handDrawnSeed:a}=r,{nodeBorder:s}=i,o=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),n=o.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,u=t.x-c/2,f=t.y-h/2;t.width=c;let d;if(t.look==="handDrawn"){const y=U.svg(o).rectangle(u,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:a});d=o.insert(()=>y,":first-child")}else d=n.insert("rect",":first-child"),d.attr("class","divider").attr("x",u).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look);const g=d.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return $r(t,m)},{cluster:o,labelBBox:{}}},"divider"),ab=Vu,sb={rect:Vu,squareRect:ab,roundedWithTitle:eb,noteGroup:tb,divider:ib,kanbanSection:rb},Xu=new Map,nb=p(async(e,t)=>{const r=t.shape||"rect",i=await sb[r](e,t);return Xu.set(t.id,i),i},"insertCluster"),Rk=p(()=>{Xu=new Map},"clear");function Zu(e,t){return e.intersect(t)}p(Zu,"intersectNode");var ob=Zu;function Ku(e,t,r,i){var a=e.x,s=e.y,o=a-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*o*o),c=Math.abs(t*r*o/l);i.x0}p(Us,"sameSign");var cb=td;function ed(e,t,r){let i=e.x,a=e.y,s=[],o=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){o=Math.min(o,h.x),n=Math.min(n,h.y)}):(o=Math.min(o,t.x),n=Math.min(n,t.y));let l=i-e.width/2-o,c=a-e.height/2-n;for(let h=0;h1&&s.sort(function(h,u){let f=h.x-r.x,d=h.y-r.y,g=Math.sqrt(f*f+d*d),m=u.x-r.x,y=u.y-r.y,x=Math.sqrt(m*m+y*y);return gh,":first-child");return u.attr("class","anchor").attr("style",Nt(n)),Z(t,u),t.intersect=function(f){return D.info("Circle intersect",t,o,f),q.circle(t,o,f)},s}p(rd,"anchor");function Gs(e,t,r,i,a,s,o){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),u=(r-e)/2,f=(i-t)/2,d=u/a,g=f/s,m=Math.sqrt(d**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*s*Math.sin(h)*(o?-1:1),b=c-y*a*Math.cos(h)*(o?-1:1),k=Math.atan2((t-b)/s,(e-x)/a);let S=Math.atan2((i-b)/s,(r-x)/a)-k;o&&S0&&(S-=2*Math.PI);const C=[];for(let T=0;Tm,":first-child");return y.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),y.attr("transform",`translate(${c/2}, 0)`),Z(t,y),t.intersect=function(x){return q.polygon(t,u,x)},a}p(id,"bowTieRect");function Ee(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(Ee,"insertPolygonShape");async function ad(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=s.height+t.padding,n=12,l=s.width+t.padding+n,c=0,h=l,u=-o,f=0,d=[{x:c+n,y:u},{x:h,y:u},{x:h,y:f},{x:c,y:f},{x:c,y:u+n},{x:c+n,y:u}];let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=U.svg(a),x=G(t,{}),b=ht(d),k=y.path(b,x);g=a.insert(()=>k,":first-child").attr("transform",`translate(${-l/2}, ${o/2})`),m&&g.attr("style",m)}else g=Ee(a,l,o,d);return i&&g.attr("style",i),Z(t,g),t.intersect=function(y){return q.polygon(t,d,y)},a}p(ad,"card");function sd(e,t){const{nodeStyles:r}=V(t);t.label="";const i=e.insert("g").attr("class",tt(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,s=Math.max(28,t.width??0),o=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=U.svg(i),l=G(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=ht(o),h=n.path(c,l),u=i.insert(()=>h,":first-child");return a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),r&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return q.polygon(t,o,f)},i}p(sd,"choice");async function Wn(e,t,r){const{labelStyles:i,nodeStyles:a}=V(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,halfPadding:n}=await et(e,t,tt(t)),l=(r==null?void 0:r.padding)??n,c=o.width/2+l;let h;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=U.svg(s),d=G(t,{}),g=f.circle(0,0,c*2,d);h=s.insert(()=>g,":first-child"),h.attr("class","basic label-container").attr("style",Nt(u))}else h=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",a).attr("r",c).attr("cx",0).attr("cy",0);return Z(t,h),t.calcIntersect=function(f,d){const g=f.width/2;return q.circle(f,g,d)},t.intersect=function(f){return D.info("Circle intersect",t,c,f),q.circle(t,c,f)},s}p(Wn,"circle");function nd(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,a={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},o={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y} M ${a.x},${a.y} L ${o.x},${o.y}`}p(nd,"createLine");function od(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r,t.label="";const a=e.insert("g").attr("class",tt(t)).attr("id",t.domId??t.id),s=Math.max(30,(t==null?void 0:t.width)??0),{cssStyles:o}=t,n=U.svg(a),l=G(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=nd(s),u=n.path(h,l),f=a.insert(()=>c,":first-child");return f.insert(()=>u),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Z(t,f),t.intersect=function(d){return D.info("crossedCircle intersect",t,{radius:s,point:d}),q.circle(t,s,d)},a}p(od,"crossedCircle");function ve(e,t,r,i=100,a=0,s=180){const o=[],n=a*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;uk,":first-child").attr("stroke-opacity",0),v.insert(()=>x,":first-child"),v.attr("class","text"),h&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${c}, 0)`),o.attr("transform",`translate(${-n/2+c-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Z(t,v),t.intersect=function(S){return q.polygon(t,f,S)},a}p(ld,"curlyBraceLeft");function Te(e,t,r,i=100,a=0,s=180){const o=[],n=a*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;uk,":first-child").attr("stroke-opacity",0),v.insert(()=>x,":first-child"),v.attr("class","text"),h&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${-c}, 0)`),o.attr("transform",`translate(${-n/2+(t.padding??0)/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Z(t,v),t.intersect=function(S){return q.polygon(t,f,S)},a}p(cd,"curlyBraceRight");function $t(e,t,r,i=100,a=0,s=180){const o=[],n=a*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;uT,":first-child").attr("stroke-opacity",0),F.insert(()=>b,":first-child"),F.insert(()=>S,":first-child"),F.attr("class","text"),h&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),F.attr("transform",`translate(${c-c/4}, 0)`),o.attr("transform",`translate(${-n/2+(t.padding??0)/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Z(t,F),t.intersect=function(P){return q.polygon(t,d,P)},a}p(hd,"curlyBraces");async function ud(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=80,n=20,l=Math.max(o,(s.width+(t.padding??0)*2)*1.25,(t==null?void 0:t.width)??0),c=Math.max(n,s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=c/2,{cssStyles:u}=t,f=U.svg(a),d=G(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=l,m=c,y=g-h,x=m/4,b=[{x:y,y:0},{x,y:0},{x:0,y:m/2},{x,y:m},{x:y,y:m},...ci(-y,-m/2,h,50,270,90)],k=ht(b),v=f.path(k,d),S=a.insert(()=>v,":first-child");return S.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",i),S.attr("transform",`translate(${-l/2}, ${-c/2})`),Z(t,S),t.intersect=function(C){return q.polygon(t,b,C)},a}p(ud,"curvedTrapezoid");var ub=p((e,t,r,i,a,s)=>[`M${e},${t+s}`,`a${a},${s} 0,0,0 ${r},0`,`a${a},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),db=p((e,t,r,i,a,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${a},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),fb=p((e,t,r,i,a,s)=>[`M${e-r/2},${-i/2}`,`a${a},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function dd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+t.padding,t.width??0),l=n/2,c=l/(2.5+n/50),h=Math.max(s.height+c+t.padding,t.height??0);let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=U.svg(a),g=db(0,0,n,h,l,c),m=fb(0,c,n,h,l,c),y=d.path(g,G(t,{})),x=d.path(m,G(t,{fill:"none"}));u=a.insert(()=>x,":first-child"),u=a.insert(()=>y,":first-child"),u.attr("class","basic label-container"),f&&u.attr("style",f)}else{const d=ub(0,0,n,h,l,c);u=a.insert("path",":first-child").attr("d",d).attr("class","basic label-container").attr("style",Nt(f)).attr("style",i)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-n/2}, ${-(h/2+c)})`),Z(t,u),o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+(t.padding??0)/1.5-(s.y-(s.top??0))})`),t.intersect=function(d){const g=q.rect(t,d),m=g.x-(t.x??0);if(l!=0&&(Math.abs(m)(t.height??0)/2-c)){let y=c*c*(1-m*m/(l*l));y>0&&(y=Math.sqrt(y)),y=c-y,d.y-(t.y??0)>0&&(y=-y),g.y+=y}return g},a}p(dd,"cylinder");async function fd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=s.width+t.padding,l=s.height+t.padding,c=l*.2,h=-n/2,u=-l/2-c/2,{cssStyles:f}=t,d=U.svg(a),g=G(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:h,y:u+c},{x:-h,y:u+c},{x:-h,y:-u},{x:h,y:-u},{x:h,y:u},{x:-h,y:u},{x:-h,y:u+c}],y=d.polygon(m.map(b=>[b.x,b.y]),g),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),o.attr("transform",`translate(${h+(t.padding??0)/2-(s.x-(s.left??0))}, ${u+c+(t.padding??0)/2-(s.y-(s.top??0))})`),Z(t,x),t.intersect=function(b){return q.rect(t,b)},a}p(fd,"dividedRectangle");async function pd(e,t){var f,d;const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,halfPadding:o}=await et(e,t,tt(t)),l=s.width/2+o+5,c=s.width/2+o;let h;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=U.svg(a),m=G(t,{roughness:.2,strokeWidth:2.5}),y=G(t,{roughness:.2,strokeWidth:1.5}),x=g.circle(0,0,l*2,m),b=g.circle(0,0,c*2,y);h=a.insert("g",":first-child"),h.attr("class",Nt(t.cssClasses)).attr("style",Nt(u)),(f=h.node())==null||f.appendChild(x),(d=h.node())==null||d.appendChild(b)}else{h=a.insert("g",":first-child");const g=h.insert("circle",":first-child"),m=h.insert("circle");h.attr("class","basic label-container").attr("style",i),g.attr("class","outer-circle").attr("style",i).attr("r",l).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0)}return Z(t,h),t.intersect=function(g){return D.info("DoubleCircle intersect",t,l,g),q.circle(t,l,g)},a}p(pd,"doublecircle");function gd(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=V(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",tt(t)).attr("id",t.domId??t.id),o=7,{cssStyles:n}=t,l=U.svg(s),{nodeBorder:c}=r,h=G(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const u=l.circle(0,0,o*2,h),f=s.insert(()=>u,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),Z(t,f),t.intersect=function(d){return D.info("filledCircle intersect",t,{radius:o,point:d}),q.circle(t,o,d)},s}p(gd,"filledCircle");async function md(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=s.width+(t.padding??0),l=n+s.height,c=n+s.height,h=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:u}=t,f=U.svg(a),d=G(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=ht(h),m=f.path(g,d),y=a.insert(()=>m,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return u&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),t.width=n,t.height=l,Z(t,y),o.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-l/2+(t.padding??0)/2+(s.y-(s.top??0))})`),t.intersect=function(x){return D.info("Triangle intersect",t,h,x),q.polygon(t,h,x)},a}p(md,"flippedTriangle");function yd(e,t,{dir:r,config:{state:i,themeVariables:a}}){const{nodeStyles:s}=V(t);t.label="";const o=e.insert("g").attr("class",tt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,(t==null?void 0:t.width)??0),c=Math.max(10,(t==null?void 0:t.height)??0);r==="LR"&&(l=Math.max(10,(t==null?void 0:t.width)??0),c=Math.max(70,(t==null?void 0:t.height)??0));const h=-1*l/2,u=-1*c/2,f=U.svg(o),d=G(t,{stroke:a.lineColor,fill:a.lineColor});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=f.rectangle(h,u,l,c,d),m=o.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),Z(t,m);const y=(i==null?void 0:i.padding)??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(x){return q.rect(t,x)},o}p(yd,"forkJoin");async function xd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const a=80,s=50,{shapeSvg:o,bbox:n}=await et(e,t,tt(t)),l=Math.max(a,n.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(s,n.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=c/2,{cssStyles:u}=t,f=U.svg(o),d=G(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=[{x:-l/2,y:-c/2},{x:l/2-h,y:-c/2},...ci(-l/2+h,0,h,50,90,270),{x:l/2-h,y:c/2},{x:-l/2,y:c/2}],m=ht(g),y=f.path(m,d),x=o.insert(()=>y,":first-child");return x.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),Z(t,x),t.intersect=function(b){return D.info("Pill intersect",t,{radius:h,point:b}),q.polygon(t,g,b)},o}p(xd,"halfRoundedRectangle");var pb=p((e,t,r,i,a)=>[`M${e+a},${t}`,`L${e+r-a},${t}`,`L${e+r},${t-i/2}`,`L${e+r-a},${t-i}`,`L${e+a},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function bd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=4,n=s.height+t.padding,l=n/o,c=s.width+2*l+t.padding,h=[{x:l,y:0},{x:c-l,y:0},{x:c,y:-n/2},{x:c-l,y:-n},{x:l,y:-n},{x:0,y:-n/2}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=U.svg(a),g=G(t,{}),m=pb(0,0,c,n,l),y=d.path(m,g);u=a.insert(()=>y,":first-child").attr("transform",`translate(${-c/2}, ${n/2})`),f&&u.attr("style",f)}else u=Ee(a,c,n,h);return i&&u.attr("style",i),t.width=c,t.height=n,Z(t,u),t.intersect=function(d){return q.polygon(t,h,d)},a}p(bd,"hexagon");async function Cd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.label="",t.labelStyle=r;const{shapeSvg:a}=await et(e,t,tt(t)),s=Math.max(30,(t==null?void 0:t.width)??0),o=Math.max(30,(t==null?void 0:t.height)??0),{cssStyles:n}=t,l=U.svg(a),c=G(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:o},{x:s,y:o}],u=ht(h),f=l.path(u,c),d=a.insert(()=>f,":first-child");return d.attr("class","basic label-container"),n&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",i),d.attr("transform",`translate(${-s/2}, ${-o/2})`),Z(t,d),t.intersect=function(g){return D.info("Pill intersect",t,{points:h}),q.polygon(t,h,g)},a}p(Cd,"hourglass");async function kd(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=V(t);t.labelStyle=a;const s=t.assetHeight??48,o=t.assetWidth??48,n=Math.max(s,o),l=i==null?void 0:i.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:u}=await et(e,t,"icon-shape default"),f=t.pos==="t",d=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=Er(t),x=-g/2,b=-d/2,k=t.label?8:0,v=U.svg(c),S=G(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=v.rectangle(x,b,g,d,S),T=Math.max(g,h.width),F=d+h.height+k,P=v.rectangle(-T/2,-F/2,T,F,{...S,fill:"transparent",stroke:"none"}),R=c.insert(()=>C,":first-child"),$=c.insert(()=>P);if(t.icon){const z=c.append("g");z.html(`${await yi(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const O=z.node().getBBox(),A=O.width,M=O.height,L=O.x,E=O.y;z.attr("transform",`translate(${-A/2-L},${f?h.height/2+k/2-M/2-E:-h.height/2-k/2-M/2-E})`),z.attr("style",`color: ${y.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-F/2:F/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),Z(t,$),t.intersect=function(z){if(D.info("iconSquare intersect",t,z),!t.label)return q.rect(t,z);const O=t.x??0,A=t.y??0,M=t.height??0;let L=[];return f?L=[{x:O-h.width/2,y:A-M/2},{x:O+h.width/2,y:A-M/2},{x:O+h.width/2,y:A-M/2+h.height+k},{x:O+g/2,y:A-M/2+h.height+k},{x:O+g/2,y:A+M/2},{x:O-g/2,y:A+M/2},{x:O-g/2,y:A-M/2+h.height+k},{x:O-h.width/2,y:A-M/2+h.height+k}]:L=[{x:O-g/2,y:A-M/2},{x:O+g/2,y:A-M/2},{x:O+g/2,y:A-M/2+d},{x:O+h.width/2,y:A-M/2+d},{x:O+h.width/2/2,y:A+M/2},{x:O-h.width/2,y:A+M/2},{x:O-h.width/2,y:A-M/2+d},{x:O-g/2,y:A-M/2+d}],q.polygon(t,L,z)},c}p(kd,"icon");async function _d(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=V(t);t.labelStyle=a;const s=t.assetHeight??48,o=t.assetWidth??48,n=Math.max(s,o),l=i==null?void 0:i.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:u}=await et(e,t,"icon-shape default"),f=20,d=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Er(t),b=U.svg(c),k=G(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=x.get("fill");k.stroke=v??y;const S=c.append("g");t.icon&&S.html(`${await yi(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const C=S.node().getBBox(),T=C.width,F=C.height,P=C.x,R=C.y,$=Math.max(T,F)*Math.SQRT2+f*2,z=b.circle(0,0,$,k),O=Math.max($,h.width),A=$+h.height+d,M=b.rectangle(-O/2,-A/2,O,A,{...k,fill:"transparent",stroke:"none"}),L=c.insert(()=>z,":first-child"),E=c.insert(()=>M);return S.attr("transform",`translate(${-T/2-P},${g?h.height/2+d/2-F/2-R:-h.height/2-d/2-F/2-R})`),S.attr("style",`color: ${x.get("stroke")??m};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-A/2:A/2-h.height})`),L.attr("transform",`translate(0,${g?h.height/2+d/2:-h.height/2-d/2})`),Z(t,E),t.intersect=function(B){return D.info("iconSquare intersect",t,B),q.rect(t,B)},c}p(_d,"iconCircle");async function wd(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=V(t);t.labelStyle=a;const s=t.assetHeight??48,o=t.assetWidth??48,n=Math.max(s,o),l=i==null?void 0:i.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:f}=await et(e,t,"icon-shape default"),d=t.pos==="t",g=n+u*2,m=n+u*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:b}=Er(t),k=-m/2,v=-g/2,S=t.label?8:0,C=U.svg(c),T=G(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const F=b.get("fill");T.stroke=F??x;const P=C.path(qe(k,v,m,g,5),T),R=Math.max(m,h.width),$=g+h.height+S,z=C.rectangle(-R/2,-$/2,R,$,{...T,fill:"transparent",stroke:"none"}),O=c.insert(()=>P,":first-child").attr("class","icon-shape2"),A=c.insert(()=>z);if(t.icon){const M=c.append("g");M.html(`${await yi(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const L=M.node().getBBox(),E=L.width,B=L.height,W=L.x,Y=L.y;M.attr("transform",`translate(${-E/2-W},${d?h.height/2+S/2-B/2-Y:-h.height/2-S/2-B/2-Y})`),M.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-$/2:$/2-h.height})`),O.attr("transform",`translate(0,${d?h.height/2+S/2:-h.height/2-S/2})`),Z(t,A),t.intersect=function(M){if(D.info("iconSquare intersect",t,M),!t.label)return q.rect(t,M);const L=t.x??0,E=t.y??0,B=t.height??0;let W=[];return d?W=[{x:L-h.width/2,y:E-B/2},{x:L+h.width/2,y:E-B/2},{x:L+h.width/2,y:E-B/2+h.height+S},{x:L+m/2,y:E-B/2+h.height+S},{x:L+m/2,y:E+B/2},{x:L-m/2,y:E+B/2},{x:L-m/2,y:E-B/2+h.height+S},{x:L-h.width/2,y:E-B/2+h.height+S}]:W=[{x:L-m/2,y:E-B/2},{x:L+m/2,y:E-B/2},{x:L+m/2,y:E-B/2+g},{x:L+h.width/2,y:E-B/2+g},{x:L+h.width/2/2,y:E+B/2},{x:L-h.width/2,y:E+B/2},{x:L-h.width/2,y:E-B/2+g},{x:L-m/2,y:E-B/2+g}],q.polygon(t,W,M)},c}p(wd,"iconRounded");async function Sd(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=V(t);t.labelStyle=a;const s=t.assetHeight??48,o=t.assetWidth??48,n=Math.max(s,o),l=i==null?void 0:i.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:f}=await et(e,t,"icon-shape default"),d=t.pos==="t",g=n+u*2,m=n+u*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:b}=Er(t),k=-m/2,v=-g/2,S=t.label?8:0,C=U.svg(c),T=G(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const F=b.get("fill");T.stroke=F??x;const P=C.path(qe(k,v,m,g,.1),T),R=Math.max(m,h.width),$=g+h.height+S,z=C.rectangle(-R/2,-$/2,R,$,{...T,fill:"transparent",stroke:"none"}),O=c.insert(()=>P,":first-child"),A=c.insert(()=>z);if(t.icon){const M=c.append("g");M.html(`${await yi(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const L=M.node().getBBox(),E=L.width,B=L.height,W=L.x,Y=L.y;M.attr("transform",`translate(${-E/2-W},${d?h.height/2+S/2-B/2-Y:-h.height/2-S/2-B/2-Y})`),M.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-$/2:$/2-h.height})`),O.attr("transform",`translate(0,${d?h.height/2+S/2:-h.height/2-S/2})`),Z(t,A),t.intersect=function(M){if(D.info("iconSquare intersect",t,M),!t.label)return q.rect(t,M);const L=t.x??0,E=t.y??0,B=t.height??0;let W=[];return d?W=[{x:L-h.width/2,y:E-B/2},{x:L+h.width/2,y:E-B/2},{x:L+h.width/2,y:E-B/2+h.height+S},{x:L+m/2,y:E-B/2+h.height+S},{x:L+m/2,y:E+B/2},{x:L-m/2,y:E+B/2},{x:L-m/2,y:E-B/2+h.height+S},{x:L-h.width/2,y:E-B/2+h.height+S}]:W=[{x:L-m/2,y:E-B/2},{x:L+m/2,y:E-B/2},{x:L+m/2,y:E-B/2+g},{x:L+h.width/2,y:E-B/2+g},{x:L+h.width/2/2,y:E+B/2},{x:L-h.width/2,y:E+B/2},{x:L-h.width/2,y:E-B/2+g},{x:L-m/2,y:E-B/2+g}],q.polygon(t,W,M)},c}p(Sd,"iconSquare");async function vd(e,t,{config:{flowchart:r}}){const i=new Image;i.src=(t==null?void 0:t.img)??"",await i.decode();const a=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=a/s;const{labelStyles:o}=V(t);t.labelStyle=o;const n=r==null?void 0:r.wrappingWidth;t.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(t.label?n??0:0,(t==null?void 0:t.assetWidth)??a),c=t.constraint==="on"&&t!=null&&t.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:(t==null?void 0:t.assetHeight)??s;t.width=Math.max(c,n??0);const{shapeSvg:u,bbox:f,label:d}=await et(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,b=U.svg(u),k=G(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=b.rectangle(m,y,c,h,k),S=Math.max(c,f.width),C=h+f.height+x,T=b.rectangle(-S/2,-C/2,S,C,{...k,fill:"none",stroke:"none"}),F=u.insert(()=>v,":first-child"),P=u.insert(()=>T);if(t.img){const R=u.append("image");R.attr("href",t.img),R.attr("width",c),R.attr("height",h),R.attr("preserveAspectRatio","none"),R.attr("transform",`translate(${-c/2},${g?C/2-h:-C/2})`)}return d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),F.attr("transform",`translate(0,${g?f.height/2+x/2:-f.height/2-x/2})`),Z(t,P),t.intersect=function(R){if(D.info("iconSquare intersect",t,R),!t.label)return q.rect(t,R);const $=t.x??0,z=t.y??0,O=t.height??0;let A=[];return g?A=[{x:$-f.width/2,y:z-O/2},{x:$+f.width/2,y:z-O/2},{x:$+f.width/2,y:z-O/2+f.height+x},{x:$+c/2,y:z-O/2+f.height+x},{x:$+c/2,y:z+O/2},{x:$-c/2,y:z+O/2},{x:$-c/2,y:z-O/2+f.height+x},{x:$-f.width/2,y:z-O/2+f.height+x}]:A=[{x:$-c/2,y:z-O/2},{x:$+c/2,y:z-O/2},{x:$+c/2,y:z-O/2+h},{x:$+f.width/2,y:z-O/2+h},{x:$+f.width/2/2,y:z+O/2},{x:$-f.width/2,y:z+O/2},{x:$-f.width/2,y:z-O/2+h},{x:$-c/2,y:z-O/2+h}],q.polygon(t,A,R)},u}p(vd,"imageSquare");async function Td(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),n=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=[{x:0,y:0},{x:o,y:0},{x:o+3*n/6,y:-n},{x:-3*n/6,y:-n}];let c;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=U.svg(a),f=G(t,{}),d=ht(l),g=u.path(d,f);c=a.insert(()=>g,":first-child").attr("transform",`translate(${-o/2}, ${n/2})`),h&&c.attr("style",h)}else c=Ee(a,o,n,l);return i&&c.attr("style",i),t.width=o,t.height=n,Z(t,c),t.intersect=function(u){return q.polygon(t,l,u)},a}p(Td,"inv_trapezoid");async function bi(e,t,r){const{labelStyles:i,nodeStyles:a}=V(t);t.labelStyle=i;const{shapeSvg:s,bbox:o}=await et(e,t,tt(t)),n=Math.max(o.width+r.labelPaddingX*2,(t==null?void 0:t.width)||0),l=Math.max(o.height+r.labelPaddingY*2,(t==null?void 0:t.height)||0),c=-n/2,h=-l/2;let u,{rx:f,ry:d}=t;const{cssStyles:g}=t;if(r!=null&&r.rx&&r.ry&&(f=r.rx,d=r.ry),t.look==="handDrawn"){const m=U.svg(s),y=G(t,{}),x=f||d?m.path(qe(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);u=s.insert(()=>x,":first-child"),u.attr("class","basic label-container").attr("style",Nt(g))}else u=s.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",a).attr("rx",Nt(f)).attr("ry",Nt(d)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return Z(t,u),t.calcIntersect=function(m,y){return q.rect(m,y)},t.intersect=function(m){return q.rect(t,m)},s}p(bi,"drawRect");async function Ld(e,t){const{shapeSvg:r,bbox:i,label:a}=await et(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),a.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),Z(t,s),t.intersect=function(l){return q.rect(t,l)},r}p(Ld,"labelRect");async function Bd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=Math.max(s.width+(t.padding??0),(t==null?void 0:t.width)??0),n=Math.max(s.height+(t.padding??0),(t==null?void 0:t.height)??0),l=[{x:0,y:0},{x:o+3*n/6,y:0},{x:o,y:-n},{x:-(3*n)/6,y:-n}];let c;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=U.svg(a),f=G(t,{}),d=ht(l),g=u.path(d,f);c=a.insert(()=>g,":first-child").attr("transform",`translate(${-o/2}, ${n/2})`),h&&c.attr("style",h)}else c=Ee(a,o,n,l);return i&&c.attr("style",i),t.width=o,t.height=n,Z(t,c),t.intersect=function(u){return q.polygon(t,l,u)},a}p(Bd,"lean_left");async function Ad(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=Math.max(s.width+(t.padding??0),(t==null?void 0:t.width)??0),n=Math.max(s.height+(t.padding??0),(t==null?void 0:t.height)??0),l=[{x:-3*n/6,y:0},{x:o,y:0},{x:o+3*n/6,y:-n},{x:0,y:-n}];let c;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=U.svg(a),f=G(t,{}),d=ht(l),g=u.path(d,f);c=a.insert(()=>g,":first-child").attr("transform",`translate(${-o/2}, ${n/2})`),h&&c.attr("style",h)}else c=Ee(a,o,n,l);return i&&c.attr("style",i),t.width=o,t.height=n,Z(t,c),t.intersect=function(u){return q.polygon(t,l,u)},a}p(Ad,"lean_right");function Md(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.label="",t.labelStyle=r;const a=e.insert("g").attr("class",tt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,o=Math.max(35,(t==null?void 0:t.width)??0),n=Math.max(35,(t==null?void 0:t.height)??0),l=7,c=[{x:o,y:0},{x:0,y:n+l/2},{x:o-2*l,y:n+l/2},{x:0,y:2*n},{x:o,y:n-l/2},{x:2*l,y:n-l/2}],h=U.svg(a),u=G(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=ht(c),d=h.path(f,u),g=a.insert(()=>d,":first-child");return s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${o/2},${-n})`),Z(t,g),t.intersect=function(m){return D.info("lightningBolt intersect",t,m),q.polygon(t,c,m)},a}p(Md,"lightningBolt");var gb=p((e,t,r,i,a,s,o)=>[`M${e},${t+s}`,`a${a},${s} 0,0,0 ${r},0`,`a${a},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+o}`,`a${a},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),mb=p((e,t,r,i,a,s,o)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${a},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+o}`,`a${a},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),yb=p((e,t,r,i,a,s)=>[`M${e-r/2},${-i/2}`,`a${a},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function Ed(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0),t.width??0),l=n/2,c=l/(2.5+n/50),h=Math.max(s.height+c+(t.padding??0),t.height??0),u=h*.1;let f;const{cssStyles:d}=t;if(t.look==="handDrawn"){const g=U.svg(a),m=mb(0,0,n,h,l,c,u),y=yb(0,c,n,h,l,c),x=G(t,{}),b=g.path(m,x),k=g.path(y,x);a.insert(()=>k,":first-child").attr("class","line"),f=a.insert(()=>b,":first-child"),f.attr("class","basic label-container"),d&&f.attr("style",d)}else{const g=gb(0,0,n,h,l,c,u);f=a.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",Nt(d)).attr("style",i)}return f.attr("label-offset-y",c),f.attr("transform",`translate(${-n/2}, ${-(h/2+c)})`),Z(t,f),o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+c-(s.y-(s.top??0))})`),t.intersect=function(g){const m=q.rect(t,g),y=m.x-(t.x??0);if(l!=0&&(Math.abs(y)(t.height??0)/2-c)){let x=c*c*(1-y*y/(l*l));x>0&&(x=Math.sqrt(x)),x=c-x,g.y-(t.y??0)>0&&(x=-x),m.y+=x}return m},a}p(Ed,"linedCylinder");async function $d(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=l/4,h=l+c,{cssStyles:u}=t,f=U.svg(a),d=G(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=[{x:-n/2-n/2*.1,y:-h/2},{x:-n/2-n/2*.1,y:h/2},...ze(-n/2-n/2*.1,h/2,n/2+n/2*.1,h/2,c,.8),{x:n/2+n/2*.1,y:-h/2},{x:-n/2-n/2*.1,y:-h/2},{x:-n/2,y:-h/2},{x:-n/2,y:h/2*1.1},{x:-n/2,y:-h/2}],m=f.polygon(g.map(x=>[x.x,x.y]),d),y=a.insert(()=>m,":first-child");return y.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),y.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-n/2+(t.padding??0)+n/2*.1/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),Z(t,y),t.intersect=function(x){return q.polygon(t,g,x)},a}p($d,"linedWaveEdgedRect");async function Fd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=5,h=-n/2,u=-l/2,{cssStyles:f}=t,d=U.svg(a),g=G(t,{}),m=[{x:h-c,y:u+c},{x:h-c,y:u+l+c},{x:h+n-c,y:u+l+c},{x:h+n-c,y:u+l},{x:h+n,y:u+l},{x:h+n,y:u+l-c},{x:h+n+c,y:u+l-c},{x:h+n+c,y:u-c},{x:h+c,y:u-c},{x:h+c,y:u},{x:h,y:u},{x:h,y:u+c}],y=[{x:h,y:u+c},{x:h+n-c,y:u+c},{x:h+n-c,y:u+l},{x:h+n,y:u+l},{x:h+n,y:u},{x:h,y:u}];t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const x=ht(m),b=d.path(x,g),k=ht(y),v=d.path(k,{...g,fill:"none"}),S=a.insert(()=>v,":first-child");return S.insert(()=>b,":first-child"),S.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),o.attr("transform",`translate(${-(s.width/2)-c-(s.x-(s.left??0))}, ${-(s.height/2)+c-(s.y-(s.top??0))})`),Z(t,S),t.intersect=function(C){return q.polygon(t,m,C)},a}p(Fd,"multiRect");async function Dd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=l/4,h=l+c,u=-n/2,f=-h/2,d=5,{cssStyles:g}=t,m=ze(u-d,f+h+d,u+n-d,f+h+d,c,.8),y=m==null?void 0:m[m.length-1],x=[{x:u-d,y:f+d},{x:u-d,y:f+h+d},...m,{x:u+n-d,y:y.y-d},{x:u+n,y:y.y-d},{x:u+n,y:y.y-2*d},{x:u+n+d,y:y.y-2*d},{x:u+n+d,y:f-d},{x:u+d,y:f-d},{x:u+d,y:f},{x:u,y:f},{x:u,y:f+d}],b=[{x:u,y:f+d},{x:u+n-d,y:f+d},{x:u+n-d,y:y.y-d},{x:u+n,y:y.y-d},{x:u+n,y:f},{x:u,y:f}],k=U.svg(a),v=G(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=ht(x),C=k.path(S,v),T=ht(b),F=k.path(T,v),P=a.insert(()=>C,":first-child");return P.insert(()=>F),P.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",i),P.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-(s.width/2)-d-(s.x-(s.left??0))}, ${-(s.height/2)+d-c/2-(s.y-(s.top??0))})`),Z(t,P),t.intersect=function(R){return q.polygon(t,x,R)},a}p(Dd,"multiWaveEdgedRectangle");async function Od(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=V(t);t.labelStyle=i,t.useHtmlLabels||zt(It())||(t.centerLabel=!0);const{shapeSvg:o,bbox:n,label:l}=await et(e,t,tt(t)),c=Math.max(n.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(n.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),u=-c/2,f=-h/2,{cssStyles:d}=t,g=U.svg(o),m=G(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(u,f,c,h,m),x=o.insert(()=>y,":first-child");return x.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",d),a&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",a),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Z(t,x),t.intersect=function(b){return q.rect(t,b)},o}p(Od,"note");var xb=p((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Rd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=s.width+t.padding,n=s.height+t.padding,l=o+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=U.svg(a),g=G(t,{}),m=xb(0,0,l),y=d.path(m,g);u=a.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&u.attr("style",f)}else u=Ee(a,l,l,h),u.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&u.attr("style",i),Z(t,u),t.calcIntersect=function(d,g){const m=d.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],x=q.polygon(d,y,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(d){return this.calcIntersect(t,d)},a}p(Rd,"question");async function Id(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0),(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0),(t==null?void 0:t.height)??0),c=-n/2,h=-l/2,u=h/2,f=[{x:c+u,y:h},{x:c,y:0},{x:c+u,y:-h},{x:-c,y:-h},{x:-c,y:h}],{cssStyles:d}=t,g=U.svg(a),m=G(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=ht(f),x=g.path(y,m),b=a.insert(()=>x,":first-child");return b.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(${-u/2},0)`),o.attr("transform",`translate(${-u/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Z(t,b),t.intersect=function(k){return q.polygon(t,f,k)},a}p(Id,"rect_left_inv_arrow");async function Pd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;let a;t.cssClasses?a="node "+t.cssClasses:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),o=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await De(n,c,t.labelStyle,!0,!0);let u={width:0,height:0};if(zt(pt())){const F=h.children[0],P=ot(h);u=F.getBoundingClientRect(),P.attr("width",u.width),P.attr("height",u.height)}D.info("Text 2",l);const f=l||[],d=h.getBBox(),g=await De(n,Array.isArray(f)?f.join("
    "):f,t.labelStyle,!0,!0),m=g.children[0],y=ot(g);u=m.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height);const x=(t.padding||0)/2;ot(g).attr("transform","translate( "+(u.width>d.width?0:(d.width-u.width)/2)+", "+(d.height+x+5)+")"),ot(h).attr("transform","translate( "+(u.width(D.debug("Rough node insert CXC",R),$),":first-child"),C=s.insert(()=>(D.debug("Rough node insert CXC",R),R),":first-child")}else C=o.insert("rect",":first-child"),T=o.insert("line"),C.attr("class","outer title-state").attr("style",i).attr("x",-u.width/2-x).attr("y",-u.height/2-x).attr("width",u.width+(t.padding||0)).attr("height",u.height+(t.padding||0)),T.attr("class","divider").attr("x1",-u.width/2-x).attr("x2",u.width/2+x).attr("y1",-u.height/2-x+d.height+x).attr("y2",-u.height/2-x+d.height+x);return Z(t,C),t.intersect=function(F){return q.rect(t,F)},s}p(Pd,"rectWithTitle");async function Nd(e,t){const r={rx:5,ry:5,labelPaddingX:((t==null?void 0:t.padding)||0)*1,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return bi(e,t,r)}p(Nd,"roundedRect");async function zd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=(t==null?void 0:t.padding)??0,l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=-s.width/2-n,u=-s.height/2-n,{cssStyles:f}=t,d=U.svg(a),g=G(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:h,y:u},{x:h+l+8,y:u},{x:h+l+8,y:u+c},{x:h-8,y:u+c},{x:h-8,y:u},{x:h,y:u},{x:h,y:u+c}],y=d.polygon(m.map(b=>[b.x,b.y]),g),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container").attr("style",Nt(f)),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),o.attr("transform",`translate(${-l/2+4+(t.padding??0)-(s.x-(s.left??0))},${-c/2+(t.padding??0)-(s.y-(s.top??0))})`),Z(t,x),t.intersect=function(b){return q.rect(t,b)},a}p(zd,"shadedProcess");async function Wd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=-n/2,h=-l/2,{cssStyles:u}=t,f=U.svg(a),d=G(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=[{x:c,y:h},{x:c,y:h+l},{x:c+n,y:h+l},{x:c+n,y:h-l/2}],m=ht(g),y=f.path(m,d),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),x.attr("transform",`translate(0, ${l/4})`),o.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))}, ${-l/4+(t.padding??0)-(s.y-(s.top??0))})`),Z(t,x),t.intersect=function(b){return q.polygon(t,g,b)},a}p(Wd,"slopedRect");async function qd(e,t){const r={rx:0,ry:0,labelPaddingX:t.labelPaddingX??((t==null?void 0:t.padding)||0)*2,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return bi(e,t,r)}p(qd,"squareRect");async function Hd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=s.height+t.padding,n=s.width+o/4+t.padding,l=o/2,{cssStyles:c}=t,h=U.svg(a),u=G(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=[{x:-n/2+l,y:-o/2},{x:n/2-l,y:-o/2},...ci(-n/2+l,0,l,50,90,270),{x:n/2-l,y:o/2},...ci(n/2-l,0,l,50,270,450)],d=ht(f),g=h.path(d,u),m=a.insert(()=>g,":first-child");return m.attr("class","basic label-container outer-path"),c&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",c),i&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",i),Z(t,m),t.intersect=function(y){return q.polygon(t,f,y)},a}p(Hd,"stadium");async function jd(e,t){return bi(e,t,{rx:5,ry:5})}p(jd,"state");function Yd(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=V(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:o,stateBorder:n,nodeBorder:l}=r,c=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),h=U.svg(c),u=G(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=h.circle(0,0,14,{...u,stroke:o,strokeWidth:2}),d=n??l,g=h.circle(0,0,5,{...u,fill:d,stroke:d,strokeWidth:2,fillStyle:"solid"}),m=c.insert(()=>f,":first-child");return m.insert(()=>g),s&&m.selectAll("path").attr("style",s),a&&m.selectAll("path").attr("style",a),Z(t,m),t.intersect=function(y){return q.circle(t,7,y)},c}p(Yd,"stateEnd");function Ud(e,t,{config:{themeVariables:r}}){const{lineColor:i}=r,a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let s;if(t.look==="handDrawn"){const n=U.svg(a).circle(0,0,14,Ly(i));s=a.insert(()=>n),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Z(t,s),t.intersect=function(o){return q.circle(t,7,o)},a}p(Ud,"stateStart");async function Gd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=((t==null?void 0:t.padding)||0)/2,n=s.width+t.padding,l=s.height+t.padding,c=-s.width/2-o,h=-s.height/2-o,u=[{x:0,y:0},{x:n,y:0},{x:n,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:n+8,y:0},{x:n+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if(t.look==="handDrawn"){const f=U.svg(a),d=G(t,{}),g=f.rectangle(c-8,h,n+16,l,d),m=f.line(c,h,c,h+l,d),y=f.line(c+n,h,c+n,h+l,d);a.insert(()=>m,":first-child"),a.insert(()=>y,":first-child");const x=a.insert(()=>g,":first-child"),{cssStyles:b}=t;x.attr("class","basic label-container").attr("style",Nt(b)),Z(t,x)}else{const f=Ee(a,n,l,u);i&&f.attr("style",i),Z(t,f)}return t.intersect=function(f){return q.polygon(t,u,f)},a}p(Gd,"subroutine");async function Vd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),n=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=-o/2,c=-n/2,h=.2*n,u=.2*n,{cssStyles:f}=t,d=U.svg(a),g=G(t,{}),m=[{x:l-h/2,y:c},{x:l+o+h/2,y:c},{x:l+o+h/2,y:c+n},{x:l-h/2,y:c+n}],y=[{x:l+o-h/2,y:c+n},{x:l+o+h/2,y:c+n},{x:l+o+h/2,y:c+n-u}];t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const x=ht(m),b=d.path(x,g),k=ht(y),v=d.path(k,{...g,fillStyle:"solid"}),S=a.insert(()=>v,":first-child");return S.insert(()=>b,":first-child"),S.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),Z(t,S),t.intersect=function(C){return q.polygon(t,m,C)},a}p(Vd,"taggedRect");async function Xd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=l/4,h=.2*n,u=.2*l,f=l+c,{cssStyles:d}=t,g=U.svg(a),m=G(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...ze(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],x=-n/2+n/2*.1,b=-f/2-u*.4,k=[{x:x+n-h,y:(b+l)*1.4},{x:x+n,y:b+l-u},{x:x+n,y:(b+l)*.9},...ze(x+n,(b+l)*1.3,x+n-h,(b+l)*1.5,-l*.03,.5)],v=ht(y),S=g.path(v,m),C=ht(k),T=g.path(C,{...m,fillStyle:"solid"}),F=a.insert(()=>T,":first-child");return F.insert(()=>S,":first-child"),F.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),F.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),Z(t,F),t.intersect=function(P){return q.polygon(t,y,P)},a}p(Xd,"taggedWaveEdgedRectangle");async function Zd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=Math.max(s.width+t.padding,(t==null?void 0:t.width)||0),n=Math.max(s.height+t.padding,(t==null?void 0:t.height)||0),l=-o/2,c=-n/2,h=a.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",o).attr("height",n),Z(t,h),t.intersect=function(u){return q.rect(t,u)},a}p(Zd,"text");var bb=p((e,t,r,i,a,s)=>`M${e},${t} a${a},${s} 0,0,1 0,${-i} l${r},0 a${a},${s} 0,0,1 0,${i} M${r},${-i} a${a},${s} 0,0,0 0,${i} l${-r},0`,"createCylinderPathD"),Cb=p((e,t,r,i,a,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${a},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${a},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),kb=p((e,t,r,i,a,s)=>[`M${e+r/2},${-i/2}`,`a${a},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD");async function Kd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o,halfPadding:n}=await et(e,t,tt(t)),l=t.look==="neo"?n*2:n,c=s.height+l,h=c/2,u=h/(2.5+c/50),f=s.width+u+l,{cssStyles:d}=t;let g;if(t.look==="handDrawn"){const m=U.svg(a),y=Cb(0,0,f,c,u,h),x=kb(0,0,f,c,u,h),b=m.path(y,G(t,{})),k=m.path(x,G(t,{fill:"none"}));g=a.insert(()=>k,":first-child"),g=a.insert(()=>b,":first-child"),g.attr("class","basic label-container"),d&&g.attr("style",d)}else{const m=bb(0,0,f,c,u,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Nt(d)).attr("style",i),g.attr("class","basic label-container"),d&&g.selectAll("path").attr("style",d),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-f/2}, ${c/2} )`),o.attr("transform",`translate(${-(s.width/2)-u-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Z(t,g),t.intersect=function(m){const y=q.rect(t,m),x=y.y-(t.y??0);if(h!=0&&(Math.abs(x)(t.width??0)/2-u)){let b=u*u*(1-x*x/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=u-b,m.x-(t.x??0)>0&&(b=-b),y.x+=b}return y},a}p(Kd,"tiltedCylinder");async function Qd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=s.width+t.padding,n=s.height+t.padding,l=[{x:-3*n/6,y:0},{x:o+3*n/6,y:0},{x:o,y:-n},{x:0,y:-n}];let c;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=U.svg(a),f=G(t,{}),d=ht(l),g=u.path(d,f);c=a.insert(()=>g,":first-child").attr("transform",`translate(${-o/2}, ${n/2})`),h&&c.attr("style",h)}else c=Ee(a,o,n,l);return i&&c.attr("style",i),t.width=o,t.height=n,Z(t,c),t.intersect=function(u){return q.polygon(t,l,u)},a}p(Qd,"trapezoid");async function Jd(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=60,n=20,l=Math.max(o,s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(n,s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),{cssStyles:h}=t,u=U.svg(a),f=G(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const d=[{x:-l/2*.8,y:-c/2},{x:l/2*.8,y:-c/2},{x:l/2,y:-c/2*.6},{x:l/2,y:c/2},{x:-l/2,y:c/2},{x:-l/2,y:-c/2*.6}],g=ht(d),m=u.path(g,f),y=a.insert(()=>m,":first-child");return y.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",h),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),Z(t,y),t.intersect=function(x){return q.polygon(t,d,x)},a}p(Jd,"trapezoidalPentagon");async function tf(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=t.useHtmlLabels||zt(pt()),l=s.width+(t.padding??0),c=l+s.height,h=l+s.height,u=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-c}],{cssStyles:f}=t,d=U.svg(a),g=G(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=ht(u),y=d.path(m,g),x=a.insert(()=>y,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return f&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),t.width=l,t.height=c,Z(t,x),o.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${c/2-(s.height+(t.padding??0)/(n?2:1)-(s.y-(s.top??0)))})`),t.intersect=function(b){return D.info("Triangle intersect",t,u,b),q.polygon(t,u,b)},a}p(tf,"triangle");async function ef(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=l/8,h=l+c,{cssStyles:u}=t,d=70-n,g=d>0?d/2:0,m=U.svg(a),y=G(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-n/2-g,y:h/2},...ze(-n/2-g,h/2,n/2+g,h/2,c,.8),{x:n/2+g,y:-h/2},{x:-n/2-g,y:-h/2}],b=ht(x),k=m.path(b,y),v=a.insert(()=>k,":first-child");return v.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c-(s.y-(s.top??0))})`),Z(t,v),t.intersect=function(S){return q.polygon(t,x,S)},a}p(ef,"waveEdgedRectangle");async function rf(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s}=await et(e,t,tt(t)),o=100,n=50,l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=l/c;let u=l,f=c;u>f*h?f=u/h:u=f*h,u=Math.max(u,o),f=Math.max(f,n);const d=Math.min(f*.2,f/4),g=f+d*2,{cssStyles:m}=t,y=U.svg(a),x=G(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:-u/2,y:g/2},...ze(-u/2,g/2,u/2,g/2,d,1),{x:u/2,y:-g/2},...ze(u/2,-g/2,-u/2,-g/2,d,-1)],k=ht(b),v=y.path(k,x),S=a.insert(()=>v,":first-child");return S.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),Z(t,S),t.intersect=function(C){return q.polygon(t,b,C)},a}p(rf,"waveRectangle");async function af(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await et(e,t,tt(t)),n=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=5,h=-n/2,u=-l/2,{cssStyles:f}=t,d=U.svg(a),g=G(t,{}),m=[{x:h-c,y:u-c},{x:h-c,y:u+l},{x:h+n,y:u+l},{x:h+n,y:u-c}],y=`M${h-c},${u-c} L${h+n},${u-c} L${h+n},${u+l} L${h-c},${u+l} L${h-c},${u-c} M${h-c},${u} L${h+n},${u} M${h},${u-c} L${h},${u+l}`;t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const x=d.path(y,g),b=a.insert(()=>x,":first-child");return b.attr("transform",`translate(${c/2}, ${c/2})`),b.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),o.attr("transform",`translate(${-(s.width/2)+c/2-(s.x-(s.left??0))}, ${-(s.height/2)+c/2-(s.y-(s.top??0))})`),Z(t,b),t.intersect=function(k){return q.polygon(t,m,k)},a}p(af,"windowPane");async function qn(e,t){var ut,at,xt,st;const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:nt}=It(),{background:ct}=nt,mt={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ct}`]};await qn(e,mt)}const i=It();t.useHtmlLabels=i.htmlLabels;let a=((ut=i.er)==null?void 0:ut.diagramPadding)??10,s=((at=i.er)==null?void 0:at.entityPadding)??6;const{cssStyles:o}=t,{labelStyles:n,nodeStyles:l}=V(t);if(r.attributes.length===0&&t.label){const nt={rx:0,ry:0,labelPaddingX:a,labelPaddingY:a*1.5};Ae(t.label,i)+nt.labelPaddingX*20){const nt=u.width+a*2-(m+y+x+b);m+=nt/S,y+=nt/S,x>0&&(x+=nt/S),b>0&&(b+=nt/S)}const T=m+y+x+b,F=U.svg(h),P=G(t,{});t.look!=="handDrawn"&&(P.roughness=0,P.fillStyle="solid");let R=0;g.length>0&&(R=g.reduce((nt,ct)=>nt+((ct==null?void 0:ct.rowHeight)??0),0));const $=Math.max(C.width+a*2,(t==null?void 0:t.width)||0,T),z=Math.max((R??0)+u.height,(t==null?void 0:t.height)||0),O=-$/2,A=-z/2;h.selectAll("g:not(:first-child)").each((nt,ct,mt)=>{const Ct=ot(mt[ct]),bt=Ct.attr("transform");let St=0,ne=0;if(bt){const $e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(bt);$e&&(St=parseFloat($e[1]),ne=parseFloat($e[2]),Ct.attr("class").includes("attribute-name")?St+=m:Ct.attr("class").includes("attribute-keys")?St+=m+y:Ct.attr("class").includes("attribute-comment")&&(St+=m+y+x))}Ct.attr("transform",`translate(${O+a/2+St}, ${ne+A+u.height+s/2})`)}),h.select(".name").attr("transform","translate("+-u.width/2+", "+(A+s/2)+")");const M=F.rectangle(O,A,$,z,P),L=h.insert(()=>M,":first-child").attr("style",o.join("")),{themeVariables:E}=It(),{rowEven:B,rowOdd:W,nodeBorder:Y}=E;d.push(0);for(const[nt,ct]of g.entries()){const Ct=(nt+1)%2===0&&ct.yOffset!==0,bt=F.rectangle(O,u.height+A+(ct==null?void 0:ct.yOffset),$,ct==null?void 0:ct.rowHeight,{...P,fill:Ct?B:W,stroke:Y});h.insert(()=>bt,"g.label").attr("style",o.join("")).attr("class",`row-rect-${Ct?"even":"odd"}`)}let H=F.line(O,u.height+A,$+O,u.height+A,P);h.insert(()=>H).attr("class","divider"),H=F.line(m+O,u.height+A,m+O,z+A,P),h.insert(()=>H).attr("class","divider"),k&&(H=F.line(m+y+O,u.height+A,m+y+O,z+A,P),h.insert(()=>H).attr("class","divider")),v&&(H=F.line(m+y+x+O,u.height+A,m+y+x+O,z+A,P),h.insert(()=>H).attr("class","divider"));for(const nt of d)H=F.line(O,u.height+A+nt,$+O,u.height+A+nt,P),h.insert(()=>H).attr("class","divider");if(Z(t,L),l&&t.look!=="handDrawn"){const nt=l.split(";"),ct=(st=nt==null?void 0:nt.filter(mt=>mt.includes("stroke")))==null?void 0:st.map(mt=>`${mt}`).join("; ");h.selectAll("path").attr("style",ct??""),h.selectAll(".row-rect-even path").attr("style",l)}return t.intersect=function(nt){return q.rect(t,nt)},h}p(qn,"erBox");async function dr(e,t,r,i=0,a=0,s=[],o=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${a})`).attr("style",o);t!==Lo(t)&&(t=Lo(t),t=t.replaceAll("",">"));const l=n.node().appendChild(await Me(n,t,{width:Ae(t,r)+100,style:o,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","")}let c=l.getBBox();if(We(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const u=ot(l);c=h.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}return c}p(dr,"addText");async function sf(e,t,r,i,a=r.class.padding??12){const s=i?0:3,o=e.insert("g").attr("class",tt(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,u=0,f=0,d=0;if(n=o.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await Zr(n,{text:`«${b}»`},0),u=n.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await Zr(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=o.insert("g").attr("class","members-group text");let m=0;for(const b of t.members){const k=await Zr(c,b,m,[b.parseClassifier()]);m+=k+s}d=c.node().getBBox().height,d").length,u.innerHTML.includes("")&&(h+=u.innerHTML.split("").length-1);const d=u.getElementsByTagName("img");if(d){const g=n.replace(/]*>/g,"").trim()==="";await Promise.all([...d].map(m=>new Promise(y=>{function x(){var b;if(m.style.display="flex",m.style.flexDirection="column",g){const k=((b=s.fontSize)==null?void 0:b.toString())??window.getComputedStyle(document.body).fontSize,S=parseInt(k,10)*5+"px";m.style.minWidth=S,m.style.maxWidth=S}else m.style.width="100%";y(m)}p(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}c=u.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&ot(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const u=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(u.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","0&&o.methods.length===0&&(y+=a*2);const x=-m/2,b=-y/2,k=d.rectangle(x-i,b-i-(f?i:o.members.length===0&&o.methods.length===0?-i/2:0),m+2*i,y+2*i+(f?i*2:o.members.length===0&&o.methods.length===0?-i:0),g),v=n.insert(()=>k,":first-child");v.attr("class","basic label-container");const S=v.node().getBBox();n.selectAll(".text").each(($,z,O)=>{var W;const A=ot(O[z]),M=A.attr("transform");let L=0;if(M){const H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(M);H&&(L=parseFloat(H[2]))}let E=L+b+i-(f?i:o.members.length===0&&o.methods.length===0?-i/2:0);s||(E-=4);let B=x;(A.attr("class").includes("label-group")||A.attr("class").includes("annotation-group"))&&(B=-((W=A.node())==null?void 0:W.getBBox().width)/2||0,n.selectAll("text").each(function(Y,H,ut){window.getComputedStyle(ut[H]).textAnchor==="middle"&&(B=0)})),A.attr("transform",`translate(${B}, ${E})`)});const C=n.select(".annotation-group").node().getBBox().height-(f?i/2:0)||0,T=n.select(".label-group").node().getBBox().height-(f?i/2:0)||0,F=n.select(".members-group").node().getBBox().height-(f?i/2:0)||0;if(o.members.length>0||o.methods.length>0||f){const $=d.line(S.x,C+T+b+i,S.x+S.width,C+T+b+i,g);n.insert(()=>$).attr("class","divider").attr("style",u)}if(f||o.members.length>0||o.methods.length>0){const $=d.line(S.x,C+T+F+b+a*2+i,S.x+S.width,C+T+F+b+i+a*2,g);n.insert(()=>$).attr("class","divider").attr("style",u)}if(o.look!=="handDrawn"&&n.selectAll("path").attr("style",u),v.select(":nth-child(2)").attr("style",u),n.selectAll(".divider").select("path").attr("style",u),t.labelStyle?n.selectAll("span").attr("style",t.labelStyle):n.selectAll("span").attr("style",u),!s){const $=RegExp(/color\s*:\s*([^;]*)/),z=$.exec(u);if(z){const O=z[0].replace("color","fill");n.selectAll("tspan").attr("style",O)}else if(c){const O=$.exec(c);if(O){const A=O[0].replace("color","fill");n.selectAll("tspan").attr("style",A)}}}return Z(t,v),t.intersect=function($){return q.rect(t,$)},n}p(nf,"classBox");async function of(e,t){var C,T;const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const a=t,s=t,o=20,n=20,l="verifyMethod"in t,c=tt(t),h=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let u;l?u=await ye(h,`<<${a.type}>>`,0,t.labelStyle):u=await ye(h,"<<Element>>",0,t.labelStyle);let f=u;const d=await ye(h,a.name,f,t.labelStyle+"; font-weight: bold;");if(f+=d+n,l){const F=await ye(h,`${a.requirementId?`ID: ${a.requirementId}`:""}`,f,t.labelStyle);f+=F;const P=await ye(h,`${a.text?`Text: ${a.text}`:""}`,f,t.labelStyle);f+=P;const R=await ye(h,`${a.risk?`Risk: ${a.risk}`:""}`,f,t.labelStyle);f+=R,await ye(h,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:""}`,f,t.labelStyle)}else{const F=await ye(h,`${s.type?`Type: ${s.type}`:""}`,f,t.labelStyle);f+=F,await ye(h,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,f,t.labelStyle)}const g=(((C=h.node())==null?void 0:C.getBBox().width)??200)+o,m=(((T=h.node())==null?void 0:T.getBBox().height)??200)+o,y=-g/2,x=-m/2,b=U.svg(h),k=G(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=b.rectangle(y,x,g,m,k),S=h.insert(()=>v,":first-child");if(S.attr("class","basic label-container").attr("style",i),h.selectAll(".label").each((F,P,R)=>{const $=ot(R[P]),z=$.attr("transform");let O=0,A=0;if(z){const B=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);B&&(O=parseFloat(B[1]),A=parseFloat(B[2]))}const M=A-m/2;let L=y+o/2;(P===0||P===1)&&(L=O),$.attr("transform",`translate(${L}, ${M+o})`)}),f>u+d+n){const F=b.line(y,x+u+d+n,y+g,x+u+d+n,k);h.insert(()=>F).attr("style",i)}return Z(t,S),t.intersect=function(F){return q.rect(t,F)},h}p(of,"requirementBox");async function ye(e,t,r,i=""){if(t==="")return 0;const a=e.insert("g").attr("class","label").attr("style",i),s=pt(),o=s.htmlLabels??!0,n=await Me(a,on(Mr(t)),{width:Ae(t,s)+50,classes:"markdown-node-label",useHtmlLabels:o,style:i},s);let l;if(o){const c=n.children[0],h=ot(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)h.textContent=h.textContent.replaceAll(">",">").replaceAll("<","{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 lf(e,t,{config:r}){var z,O;const{labelStyles:i,nodeStyles:a}=V(t);t.labelStyle=i||"";const s=10,o=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await et(e,t,tt(t)),h=t.padding||10;let u="",f;"ticket"in t&&t.ticket&&((z=r==null?void 0:r.kanban)!=null&&z.ticketBaseUrl)&&(u=(O=r==null?void 0:r.kanban)==null?void 0:O.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const d={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await ls(f,"ticket"in t&&t.ticket||"",d):{label:g,bbox:m}=await ls(n,"ticket"in t&&t.ticket||"",d);const{label:y,bbox:x}=await ls(n,"assigned"in t&&t.assigned||"",d);t.width=o;const b=10,k=(t==null?void 0:t.width)||0,v=Math.max(m.height,x.height)/2,S=Math.max(l.height+b*2,(t==null?void 0:t.height)||0)+v,C=-k/2,T=-S/2;c.attr("transform","translate("+(h-k/2)+", "+(-v-l.height/2)+")"),g.attr("transform","translate("+(h-k/2)+", "+(-v+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-x.width-2*s)+", "+(-v+l.height/2)+")");let F;const{rx:P,ry:R}=t,{cssStyles:$}=t;if(t.look==="handDrawn"){const A=U.svg(n),M=G(t,{}),L=P||R?A.path(qe(C,T,k,S,P||0),M):A.rectangle(C,T,k,S,M);F=n.insert(()=>L,":first-child"),F.attr("class","basic label-container").attr("style",$||null)}else{F=n.insert("rect",":first-child"),F.attr("class","basic label-container __APA__").attr("style",a).attr("rx",P??5).attr("ry",R??5).attr("x",C).attr("y",T).attr("width",k).attr("height",S);const A="priority"in t&&t.priority;if(A){const M=n.append("line"),L=C+2,E=T+Math.floor((P??0)/2),B=T+S-Math.floor((P??0)/2);M.attr("x1",L).attr("y1",E).attr("x2",L).attr("y2",B).attr("stroke-width","4").attr("stroke",_b(A))}}return Z(t,F),t.height=S,t.intersect=function(A){return q.rect(t,A)},n}p(lf,"kanbanItem");async function cf(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,halfPadding:o,label:n}=await et(e,t,tt(t)),l=s.width+10*o,c=s.height+8*o,h=.15*l,{cssStyles:u}=t,f=s.width+20,d=s.height+20,g=Math.max(l,f),m=Math.max(c,d);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const x=`M0 0 a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},${m*.1} a${h},${h} 1 0,0 ${g*.15},${m*.33} a${h*.8},${h*.8} 1 0,0 0,${m*.34} a${h},${h} 1 0,0 ${-1*g*.15},${m*.33} a${h},${h} 1 0,0 ${-1*g*.25},${m*.15} a${h},${h} 1 0,0 ${-1*g*.25},0 a${h},${h} 1 0,0 ${-1*g*.25},0 a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15} a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} H0 V0 Z`;if(t.look==="handDrawn"){const b=U.svg(a),k=G(t,{}),v=b.path(x,k);y=a.insert(()=>v,":first-child"),y.attr("class","basic label-container").attr("style",Nt(u))}else y=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Z(t,y),t.calcIntersect=function(b,k){return q.rect(b,k)},t.intersect=function(b){return D.info("Bang intersect",t,b),q.rect(t,b)},a}p(cf,"bang");async function hf(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,halfPadding:o,label:n}=await et(e,t,tt(t)),l=s.width+2*o,c=s.height+2*o,h=.15*l,u=.25*l,f=.35*l,d=.2*l,{cssStyles:g}=t;let m;const y=`M0 0 a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} a${u},${u} 1 0,1 ${l*.35},${l*.2} a${h},${h} 1 0,1 ${l*.15},${c*.35} a${d},${d} 1 0,1 ${-1*l*.15},${c*.65} a${u},${h} 1 0,1 ${-1*l*.25},${l*.15} a${f},${f} 1 0,1 ${-1*l*.5},0 a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15} a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35} a${d},${d} 1 0,1 ${l*.1},${-1*c*.65} H0 V0 Z`;if(t.look==="handDrawn"){const x=U.svg(a),b=G(t,{}),k=x.path(y,b);m=a.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Nt(g))}else m=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),Z(t,m),t.calcIntersect=function(x,b){return q.rect(x,b)},t.intersect=function(x){return D.info("Cloud intersect",t,x),q.rect(t,x)},a}p(hf,"cloud");async function uf(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,halfPadding:o,label:n}=await et(e,t,tt(t)),l=s.width+8*o,c=s.height+2*o,h=5,u=` M${-l/2} ${c/2-h} v${-c+2*h} q0,-${h} ${h},-${h} h${l-2*h} q${h},0 ${h},${h} v${c-2*h} q0,${h} -${h},${h} h${-l+2*h} q-${h},0 -${h},-${h} Z `,f=a.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",u);return a.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),a.append(()=>n.node()),Z(t,f),t.calcIntersect=function(d,g){return q.rect(d,g)},t.intersect=function(d){return q.rect(t,d)},a}p(uf,"defaultMindmapNode");async function df(e,t){const r={padding:t.padding??0};return Wn(e,t,r)}p(df,"mindmapCircle");var wb=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:qd},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Nd},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Hd},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Gd},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:dd},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Wn},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:cf},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:hf},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Rd},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:bd},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Ad},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Bd},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Qd},{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:Td},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:pd},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Zd},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:ad},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:zd},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Ud},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Yd},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:yd},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Cd},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:ld},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:cd},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:hd},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Md},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:ef},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:xd},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Kd},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Ed},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:ud},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:fd},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:tf},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:af},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:gd},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Jd},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:md},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Wd},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Dd},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Fd},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:id},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:od},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Xd},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Vd},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:rf},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Id},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:$d}],Sb=p(()=>{const t=[...Object.entries({state:jd,choice:sd,note:Od,rectWithTitle:Pd,labelRect:Ld,iconSquare:Sd,iconCircle:_d,icon:kd,iconRounded:wd,imageSquare:vd,anchor:rd,kanbanItem:lf,mindmapCircle:df,defaultMindmapNode:uf,classBox:nf,erBox:qn,requirementBox:of}),...wb.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(a=>[a,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),ff=Sb();function vb(e){return e in ff}p(vb,"isValidShape");var Da=new Map;async function pf(e,t,r){let i,a;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?ff[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),a=await s(i,t,r)}else a=await s(e,t,r),i=a;return t.tooltip&&a.attr("title",t.tooltip),Da.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(pf,"insertNode");var Ik=p((e,t)=>{Da.set(t.id,e)},"setNodeElem"),Pk=p(()=>{Da.clear()},"clear"),Nk=p(e=>{const t=Da.get(e.id);D.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),Tb=p((e,t,r,i,a,s)=>{t.arrowTypeStart&&dl(e,"start",t.arrowTypeStart,r,i,a,s),t.arrowTypeEnd&&dl(e,"end",t.arrowTypeEnd,r,i,a,s)},"addEdgeMarkers"),Lb={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},dl=p((e,t,r,i,a,s,o)=>{var u;const n=Lb[r];if(!n){D.warn(`Unknown arrow type: ${r}`);return}const l=n.type,h=`${a}_${s}-${l}${t==="start"?"Start":"End"}`;if(o&&o.trim()!==""){const f=o.replace(/[^\dA-Za-z]/g,"_"),d=`${h}_${f}`;if(!document.getElementById(d)){const g=document.getElementById(h);if(g){const m=g.cloneNode(!0);m.id=d,m.querySelectorAll("path, circle, line").forEach(x=>{x.setAttribute("stroke",o),n.fill&&x.setAttribute("fill",o)}),(u=g.parentNode)==null||u.appendChild(m)}}e.attr(`marker-${t}`,`url(${i}#${d})`)}else e.attr(`marker-${t}`,`url(${i}#${h})`)},"addEdgeMarker"),Bb=p(e=>{var t,r;return typeof e=="string"?e:(r=(t=pt())==null?void 0:t.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),ya=new Map,Ft=new Map,zk=p(()=>{ya.clear(),Ft.clear()},"clear"),Ur=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),Ab=p(async(e,t)=>{const r=pt();let i=zt(r);const{labelStyles:a}=V(t);t.labelStyle=a;const s=e.insert("g").attr("class","edgeLabel"),o=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Me(e,t.label,{style:Ur(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);o.node().appendChild(c),D.info("abc82",t,t.labelType);let h=c.getBBox(),u=h;if(i){const d=c.children[0],g=ot(c);h=d.getBoundingClientRect(),u=h,g.attr("width",h.width),g.attr("height",h.height)}else{const d=ot(c).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}o.attr("transform",Wr(u,i)),ya.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),g=d.insert("g").attr("class","inner"),m=await De(g,t.startLabelLeft,Ur(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],b=ot(m);y=x.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Wr(y,i)),Ft.get(t.id)||Ft.set(t.id,{}),Ft.get(t.id).startLeft=d,Kr(f,t.startLabelLeft)}if(t.startLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),g=d.insert("g").attr("class","inner"),m=await De(g,t.startLabelRight,Ur(t.labelStyle)||"",!1,!1);f=m,g.node().appendChild(m);let y=m.getBBox();if(i){const x=m.children[0],b=ot(m);y=x.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Wr(y,i)),Ft.get(t.id)||Ft.set(t.id,{}),Ft.get(t.id).startRight=d,Kr(f,t.startLabelRight)}if(t.endLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),g=d.insert("g").attr("class","inner"),m=await De(g,t.endLabelLeft,Ur(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],b=ot(m);y=x.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Wr(y,i)),d.node().appendChild(m),Ft.get(t.id)||Ft.set(t.id,{}),Ft.get(t.id).endLeft=d,Kr(f,t.endLabelLeft)}if(t.endLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),g=d.insert("g").attr("class","inner"),m=await De(g,t.endLabelRight,Ur(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],b=ot(m);y=x.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Wr(y,i)),d.node().appendChild(m),Ft.get(t.id)||Ft.set(t.id,{}),Ft.get(t.id).endRight=d,Kr(f,t.endLabelRight)}return c},"insertEdgeLabel");function Kr(e,t){zt(pt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(Kr,"setTerminalWidth");var Mb=p((e,t)=>{D.debug("Moving label abc88 ",e.id,e.label,ya.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=pt(),{subGraphTitleTotalMargin:a}=Bn(i);if(e.label){const s=ya.get(e.id);let o=e.x,n=e.y;if(r){const l=ce.calcLabelPosition(r);D.debug("Moving label "+e.label+" from (",o,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(o=l.x,n=l.y)}s.attr("transform",`translate(${o}, ${n+a/2})`)}if(e.startLabelLeft){const s=Ft.get(e.id).startLeft;let o=e.x,n=e.y;if(r){const l=ce.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=l.x,n=l.y}s.attr("transform",`translate(${o}, ${n})`)}if(e.startLabelRight){const s=Ft.get(e.id).startRight;let o=e.x,n=e.y;if(r){const l=ce.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=l.x,n=l.y}s.attr("transform",`translate(${o}, ${n})`)}if(e.endLabelLeft){const s=Ft.get(e.id).endLeft;let o=e.x,n=e.y;if(r){const l=ce.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=l.x,n=l.y}s.attr("transform",`translate(${o}, ${n})`)}if(e.endLabelRight){const s=Ft.get(e.id).endRight;let o=e.x,n=e.y;if(r){const l=ce.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=l.x,n=l.y}s.attr("transform",`translate(${o}, ${n})`)}},"positionEdgeLabel"),Eb=p((e,t)=>{const r=e.x,i=e.y,a=Math.abs(t.x-r),s=Math.abs(t.y-i),o=e.width/2,n=e.height/2;return a>=o||s>=n},"outsideNode"),$b=p((e,t,r)=>{D.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(t)} insidePoint : ${JSON.stringify(r)} node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,a=e.y,s=Math.abs(i-r.x),o=e.width/2;let n=r.xMath.abs(i-t.x)*l){let u=r.y{D.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],a=!1;return e.forEach(s=>{if(D.info("abc88 checking point",s,t),!Eb(t,s)&&!a){const o=$b(t,i,s);D.debug("abc88 inside",s,i,o),D.debug("abc88 intersection",o,t);let n=!1;r.forEach(l=>{n=n||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)?D.warn("abc88 no intersect",o,r):r.push(o),a=!0}else D.warn("abc88 outside",s,i),i=s,a||r.push(s)}),D.debug("returning points",r),r},"cutPathAtIntersect");function gf(e){const t=[],r=[];for(let i=1;i5&&Math.abs(s.y-a.y)>5||a.y===s.y&&s.x===o.x&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(gf,"extractCornerPoints");var pl=p(function(e,t,r){const i=t.x-e.x,a=t.y-e.y,s=Math.sqrt(i*i+a*a),o=r/s;return{x:t.x-o*i,y:t.y-o*a}},"findAdjacentPoint"),Fb=p(function(e){const{cornerPointPositions:t}=gf(e),r=[];for(let i=0;i10&&Math.abs(s.y-a.y)>=10){D.debug("Corner point fixing",Math.abs(s.x-a.x),Math.abs(s.y-a.y));const d=5;o.x===n.x?f={x:c{const i=e-t-r,a=2,s=2,o=a+s,n=Math.floor(i/o),l=Array(n).fill(`${a} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),Ob=p(function(e,t,r,i,a,s,o,n=!1){var L;const{handDrawnSeed:l}=pt();let c=t.points,h=!1;const u=a;var f=s;const d=[];for(const E in t.cssCompiledStyles)pu(E)||d.push(t.cssCompiledStyles[E]);D.debug("UIO intersect check",t.points,f.x,u.x),f.intersect&&u.intersect&&!n&&(c=c.slice(1,t.points.length-1),c.unshift(u.intersect(c[0])),D.debug("Last point UIO",t.start,"-->",t.end,c[c.length-1],f,f.intersect(c[c.length-1])),c.push(f.intersect(c[c.length-1])));const g=btoa(JSON.stringify(c));t.toCluster&&(D.info("to cluster abc88",r.get(t.toCluster)),c=fl(t.points,r.get(t.toCluster).node),h=!0),t.fromCluster&&(D.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(c,null,2)),c=fl(c.reverse(),r.get(t.fromCluster).node).reverse(),h=!0);let m=c.filter(E=>!Number.isNaN(E.y));const y=Bb(t.curve);y!=="rounded"&&(m=Fb(m));let x=ri;switch(y){case"linear":x=ri;break;case"basis":x=Cs;break;case"cardinal":x=ic;break;case"bumpX":x=Ql;break;case"bumpY":x=Jl;break;case"catmullRom":x=sc;break;case"monotoneX":x=uc;break;case"monotoneY":x=dc;break;case"natural":x=pc;break;case"step":x=gc;break;case"stepAfter":x=yc;break;case"stepBefore":x=mc;break;case"rounded":x=ri;break;default:x=Cs}const{x:b,y:k}=F0(t),v=mm().x(b).y(k).curve(x);let S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let C,T=y==="rounded"?mf(yf(m,t),5):v(m);const F=Array.isArray(t.style)?t.style:[t.style];let P=F.find(E=>E==null?void 0:E.startsWith("stroke:")),R="";t.animate&&(R="edge-animation-fast"),t.animation&&(R="edge-animation-"+t.animation);let $=!1;if(t.look==="handDrawn"){const E=U.svg(e);Object.assign([],m);const B=E.path(T,{roughness:.3,seed:l});S+=" transition",C=ot(B).select("path").attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")+(R?" "+R:"")).attr("style",F?F.reduce((Y,H)=>Y+";"+H,""):"");let W=C.attr("d");C.attr("d",W),e.node().appendChild(C.node())}else{const E=d.join(";"),B=F?F.reduce((xt,st)=>xt+st+";",""):"",W=(E?E+";"+B+";":B)+";"+(F?F.reduce((xt,st)=>xt+";"+st,""):"");C=e.append("path").attr("d",T).attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")+(R?" "+R:"")).attr("style",W),P=(L=W.match(/stroke:([^;]+)/))==null?void 0:L[1],$=t.animate===!0||!!t.animation||E.includes("animation");const Y=C.node(),H=typeof Y.getTotalLength=="function"?Y.getTotalLength():0,ut=Po[t.arrowTypeStart]||0,at=Po[t.arrowTypeEnd]||0;if(t.look==="neo"&&!$){const st=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?Db(H,ut,at):`0 ${ut} ${H-ut-at} ${at}`}; stroke-dashoffset: 0;`;C.attr("style",st+C.attr("style"))}}C.attr("data-edge",!0),C.attr("data-et","edge"),C.attr("data-id",t.id),C.attr("data-points",g),t.showPoints&&m.forEach(E=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",E.x).attr("cy",E.y)});let z="";(pt().flowchart.arrowMarkerAbsolute||pt().state.arrowMarkerAbsolute)&&(z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,z=z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),D.info("arrowTypeStart",t.arrowTypeStart),D.info("arrowTypeEnd",t.arrowTypeEnd),Tb(C,t,z,o,i,P);const O=Math.floor(c.length/2),A=c[O];ce.isLabelCoordinateInPath(A,C.attr("d"))||(h=!0);let M={};return h&&(M.updatedPath=c),M.originalPath=t.points,M},"insertEdge");function mf(e,t){if(e.length({...a}));if(e.length>=2&&Rt[t.arrowTypeStart]){const a=Rt[t.arrowTypeStart],s=e[0],o=e[1],{angle:n}=Vs(s,o),l=a*Math.cos(n),c=a*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Rt[t.arrowTypeEnd]){const a=Rt[t.arrowTypeEnd],s=e[i-1],o=e[i-2],{angle:n}=Vs(o,s),l=a*Math.cos(n),c=a*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(yf,"applyMarkerOffsetsToPoints");var Rb=p((e,t,r,i)=>{t.forEach(a=>{Qb[a](e,r,i)})},"insertMarkers"),Ib=p((e,t,r)=>{D.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Pb=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Nb=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),zb=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Wb=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),qb=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Hb=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),jb=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Yb=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Ub=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),Gb=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const a=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");a.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),a.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),Vb=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),Xb=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const a=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");a.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),a.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),Zb=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 L0,20`)},"requirement_arrow"),Kb=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Qb={extension:Ib,composition:Pb,aggregation:Nb,dependency:zb,lollipop:Wb,point:qb,circle:Hb,cross:jb,barb:Yb,only_one:Ub,zero_or_one:Gb,one_or_more:Vb,zero_or_more:Xb,requirement_arrow:Zb,requirement_contains:Kb},Jb=Rb,t1={common:pi,getConfig:It,insertCluster:nb,insertEdge:Ob,insertEdgeLabel:Ab,insertMarkers:Jb,insertNode:pf,interpolateToCurve:_n,labelHelper:et,log:D,positionEdgeLabel:Mb},hi={},xf=p(e=>{for(const t of e)hi[t.name]=t},"registerLayoutLoaders"),e1=p(()=>{xf([{name:"dagre",loader:p(async()=>await dt(()=>import("./D3y9anC-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),"loader")},{name:"cose-bilkent",loader:p(async()=>await dt(()=>import("./CwQYcPXW.js"),__vite__mapDeps([18,19,20,21]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");e1();var Wk=p(async(e,t)=>{if(!(e.layoutAlgorithm in hi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=hi[e.layoutAlgorithm];return(await r.loader()).render(e,t,t1,{algorithm:r.algorithm})},"render"),qk=p((e="",{fallback:t="dagre"}={})=>{if(e in hi)return e;if(t in hi)return D.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),bf="comm",Cf="rule",kf="decl",r1="@import",i1="@namespace",a1="@keyframes",s1="@layer",_f=Math.abs,Hn=String.fromCharCode;function wf(e){return e.trim()}function Yi(e,t,r){return e.replace(t,r)}function n1(e,t,r){return e.indexOf(t,r)}function gr(e,t){return e.charCodeAt(t)|0}function Br(e,t,r){return e.slice(t,r)}function xe(e){return e.length}function o1(e){return e.length}function Di(e,t){return t.push(e),e}var Oa=1,Ar=1,Sf=0,se=0,Tt=0,Fr="";function jn(e,t,r,i,a,s,o,n){return{value:e,root:t,parent:r,type:i,props:a,children:s,line:Oa,column:Ar,length:o,return:"",siblings:n}}function l1(){return Tt}function c1(){return Tt=se>0?gr(Fr,--se):0,Ar--,Tt===10&&(Ar=1,Oa--),Tt}function ue(){return Tt=se2||ui(Tt)>3?"":" "}function f1(e,t){for(;--t&&ue()&&!(Tt102||Tt>57&&Tt70&&Tt0&&(xe(T)-u||m===0&&g===47)&&Di(d>32?ml(T+";",i,r,u-1,l):ml(Yi(T," ","")+";",i,r,u-2,l),l);break;case 59:T+=";";default:if(Di(C=gl(T,t,r,c,h,a,n,k,v=[],S=[],u,s),s),b===123)if(h===0)Gi(T,t,C,C,v,s,u,n,S);else{switch(f){case 99:if(gr(T,3)===110)break;case 108:if(gr(T,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Gi(e,C,C,i&&Di(gl(e,C,C,0,0,a,n,k,a,v=[],u,S),S),a,S,u,n,i?v:S):Gi(T,C,C,C,[""],S,0,n,S)}}c=h=d=0,m=x=1,k=T="",u=o;break;case 58:u=1+xe(T),d=g;default:if(m0?1:(T+="\f",-1);break;case 44:n[c++]=(xe(T)-1)*x,x=1;break;case 64:Oe()===45&&(T+=cs(ue())),f=Oe(),h=u=xe(k=T+=g1(Ui())),b++;break;case 45:g===45&&xe(T)==2&&(m=0)}}return s}function gl(e,t,r,i,a,s,o,n,l,c,h,u){for(var f=a-1,d=a===0?s:[""],g=o1(d),m=0,y=0,x=0;m0?d[b]+" "+k:Yi(k,/&\f/g,d[b])))&&(l[x++]=v);return jn(e,t,r,a===0?Cf:n,l,c,h,u)}function y1(e,t,r,i){return jn(e,t,r,bf,Hn(l1()),Br(e,2,-2),0,i)}function ml(e,t,r,i,a){return jn(e,t,r,kf,Br(e,0,i),Br(e,i+1,-1),i,a)}function Zs(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),C1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./612YmpMR.js");return{diagram:t}},__vite__mapDeps([22,23,21]),import.meta.url);return{id:vf,diagram:e}},"loader"),k1={id:vf,detector:b1,loader:C1},_1=k1,Tf="flowchart",w1=p((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),S1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./CoHvh17m.js");return{diagram:t}},__vite__mapDeps([24,25,23,21,26,27,28]),import.meta.url);return{id:Tf,diagram:e}},"loader"),v1={id:Tf,detector:w1,loader:S1},T1=v1,Lf="flowchart-v2",L1=p((e,t)=>{var r,i,a;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((a=t==null?void 0:t.flowchart)==null?void 0:a.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),B1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./CoHvh17m.js");return{diagram:t}},__vite__mapDeps([24,25,23,21,26,27,28]),import.meta.url);return{id:Lf,diagram:e}},"loader"),A1={id:Lf,detector:L1,loader:B1},M1=A1,Bf="er",E1=p(e=>/^\s*erDiagram/.test(e),"detector"),$1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./By9IZPwN.js");return{diagram:t}},__vite__mapDeps([29,26,21,27,28]),import.meta.url);return{id:Bf,diagram:e}},"loader"),F1={id:Bf,detector:E1,loader:$1},D1=F1,Af="gitGraph",O1=p(e=>/^\s*gitGraph/.test(e),"detector"),R1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./BDG18TR1.js");return{diagram:t}},__vite__mapDeps([30,31,32,33,34,6,5,4,7,2,3,8,9,14,10,11,15,35,12,17,20,21]),import.meta.url);return{id:Af,diagram:e}},"loader"),I1={id:Af,detector:O1,loader:R1},P1=I1,Mf="gantt",N1=p(e=>/^\s*gantt/.test(e),"detector"),z1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./DnSL_6N-.js");return{diagram:t}},__vite__mapDeps([36,20,21,37,38,39,40]),import.meta.url);return{id:Mf,diagram:e}},"loader"),W1={id:Mf,detector:N1,loader:z1},q1=W1,Ef="info",H1=p(e=>/^\s*info/.test(e),"detector"),j1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./CdMvPzYr.js");return{diagram:t}},__vite__mapDeps([41,33,34,6,5,4,7,2,3,8,9,14,10,11,15,35,12,17,20]),import.meta.url);return{id:Ef,diagram:e}},"loader"),Y1={id:Ef,detector:H1,loader:j1},$f="pie",U1=p(e=>/^\s*pie/.test(e),"detector"),G1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./qJA_R-Pe.js");return{diagram:t}},__vite__mapDeps([42,31,33,34,6,5,4,7,2,3,8,9,14,10,11,15,35,12,17,20,21,43,44,39]),import.meta.url);return{id:$f,diagram:e}},"loader"),V1={id:$f,detector:U1,loader:G1},Ff="quadrantChart",X1=p(e=>/^\s*quadrantChart/.test(e),"detector"),Z1=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./SYUzGyh8.js");return{diagram:t}},__vite__mapDeps([45,21,37,38,39,40]),import.meta.url);return{id:Ff,diagram:e}},"loader"),K1={id:Ff,detector:X1,loader:Z1},Q1=K1,Df="xychart",J1=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),t2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./Cl9g7VsS.js");return{diagram:t}},__vite__mapDeps([46,21,39,44,37,38,40]),import.meta.url);return{id:Df,diagram:e}},"loader"),e2={id:Df,detector:J1,loader:t2},r2=e2,Of="requirement",i2=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),a2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./BNl0h4eM.js");return{diagram:t}},__vite__mapDeps([47,26,21,27]),import.meta.url);return{id:Of,diagram:e}},"loader"),s2={id:Of,detector:i2,loader:a2},n2=s2,Rf="sequence",o2=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),l2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./CGIUakMK.js");return{diagram:t}},__vite__mapDeps([48,23,21,32]),import.meta.url);return{id:Rf,diagram:e}},"loader"),c2={id:Rf,detector:o2,loader:l2},h2=c2,If="class",u2=p((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),d2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./BwATMaV-.js");return{diagram:t}},__vite__mapDeps([49,50,25,23,21,26,27]),import.meta.url);return{id:If,diagram:e}},"loader"),f2={id:If,detector:u2,loader:d2},p2=f2,Pf="classDiagram",g2=p((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),m2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./B_22ZBxV.js");return{diagram:t}},__vite__mapDeps([51,50,25,23,21,26,27]),import.meta.url);return{id:Pf,diagram:e}},"loader"),y2={id:Pf,detector:g2,loader:m2},x2=y2,Nf="state",b2=p((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),C2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./apjT66B3.js");return{diagram:t}},__vite__mapDeps([52,53,26,21,27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);return{id:Nf,diagram:e}},"loader"),k2={id:Nf,detector:b2,loader:C2},_2=k2,zf="stateDiagram",w2=p((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),S2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./gdiYiKWA.js");return{diagram:t}},__vite__mapDeps([54,53,26,21,27]),import.meta.url);return{id:zf,diagram:e}},"loader"),v2={id:zf,detector:w2,loader:S2},T2=v2,Wf="journey",L2=p(e=>/^\s*journey/.test(e),"detector"),B2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./DofzlwI6.js");return{diagram:t}},__vite__mapDeps([55,25,23,21,43]),import.meta.url);return{id:Wf,diagram:e}},"loader"),A2={id:Wf,detector:L2,loader:B2},M2=A2,E2=p((e,t,r)=>{D.debug(`rendering svg for syntax error `);const i=vm(t),a=i.append("g");i.attr("viewBox","0 0 2412 512"),Gl(i,100,512,!0),a.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"),a.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"),a.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"),a.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"),a.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"),a.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"),a.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"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),qf={draw:E2},$2=qf,F2={db:{},renderer:qf,parser:{parse:p(()=>{},"parse")}},D2=F2,Hf="flowchart-elk",O2=p((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),R2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./CoHvh17m.js");return{diagram:t}},__vite__mapDeps([24,25,23,21,26,27,28]),import.meta.url);return{id:Hf,diagram:e}},"loader"),I2={id:Hf,detector:O2,loader:R2},P2=I2,jf="timeline",N2=p(e=>/^\s*timeline/.test(e),"detector"),z2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./D_SpOcGe.js");return{diagram:t}},__vite__mapDeps([56,21,43]),import.meta.url);return{id:jf,diagram:e}},"loader"),W2={id:jf,detector:N2,loader:z2},q2=W2,Yf="mindmap",H2=p(e=>/^\s*mindmap/.test(e),"detector"),j2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./mDtrOgU0.js");return{diagram:t}},__vite__mapDeps([57,26,21,27]),import.meta.url);return{id:Yf,diagram:e}},"loader"),Y2={id:Yf,detector:H2,loader:j2},U2=Y2,Uf="kanban",G2=p(e=>/^\s*kanban/.test(e),"detector"),V2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./1hSgGEa5.js");return{diagram:t}},__vite__mapDeps([58,25]),import.meta.url);return{id:Uf,diagram:e}},"loader"),X2={id:Uf,detector:G2,loader:V2},Z2=X2,Gf="sankey",K2=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Q2=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./CD7AgA-4.js");return{diagram:t}},__vite__mapDeps([59,21,44,39]),import.meta.url);return{id:Gf,diagram:e}},"loader"),J2={id:Gf,detector:K2,loader:Q2},tC=J2,Vf="packet",eC=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),rC=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./kQcK2Dy-.js");return{diagram:t}},__vite__mapDeps([60,31,33,34,6,5,4,7,2,3,8,9,14,10,11,15,35,12,17,20]),import.meta.url);return{id:Vf,diagram:e}},"loader"),iC={id:Vf,detector:eC,loader:rC},Xf="radar",aC=p(e=>/^\s*radar-beta/.test(e),"detector"),sC=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./Dbe2mv4M.js");return{diagram:t}},__vite__mapDeps([61,31,33,34,6,5,4,7,2,3,8,9,14,10,11,15,35,12,17,20]),import.meta.url);return{id:Xf,diagram:e}},"loader"),nC={id:Xf,detector:aC,loader:sC},Zf="block",oC=p(e=>/^\s*block(-beta)?/.test(e),"detector"),lC=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./DByjOOMR.js");return{diagram:t}},__vite__mapDeps([62,25,17,10,2,3,4,5,6,7,8,9,11,21,1,12,28]),import.meta.url);return{id:Zf,diagram:e}},"loader"),cC={id:Zf,detector:oC,loader:lC},hC=cC,Kf="architecture",uC=p(e=>/^\s*architecture/.test(e),"detector"),dC=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./CsbKBAC5.js");return{diagram:t}},__vite__mapDeps([63,31,33,34,6,5,4,7,2,3,8,9,14,10,11,15,35,12,17,20,19,21]),import.meta.url);return{id:Kf,diagram:e}},"loader"),fC={id:Kf,detector:uC,loader:dC},pC=fC,Qf="ishikawa",gC=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),mC=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./WeAufMtV.js");return{diagram:t}},[],import.meta.url);return{id:Qf,diagram:e}},"loader"),yC={id:Qf,detector:gC,loader:mC},Jf="venn",xC=p(e=>/^\s*venn-beta/.test(e),"detector"),bC=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./CvRRIfj-.js");return{diagram:t}},__vite__mapDeps([64,21]),import.meta.url);return{id:Jf,diagram:e}},"loader"),CC={id:Jf,detector:xC,loader:bC},kC=CC,tp="treemap",_C=p(e=>/^\s*treemap/.test(e),"detector"),wC=p(async()=>{const{diagram:e}=await dt(async()=>{const{diagram:t}=await import("./dQZt1brs.js");return{diagram:t}},__vite__mapDeps([65,27,31,33,34,6,5,4,7,2,3,8,9,14,10,11,15,35,12,17,20,21,40,44,39]),import.meta.url);return{id:tp,diagram:e}},"loader"),SC={id:tp,detector:_C,loader:wC},yl=!1,Ia=p(()=>{yl||(yl=!0,Qi("error",D2,e=>e.toLowerCase().trim()==="error"),Qi("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{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:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),fs(P2,U2,pC),fs(_1,Z2,x2,p2,D1,q1,Y1,V1,n2,h2,M1,T1,q2,P1,T2,_2,M2,Q1,tC,iC,r2,hC,nC,yC,SC,kC))},"addDiagrams"),vC=p(async()=>{D.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Qe).map(async([r,{detector:i,loader:a}])=>{if(a)try{ys(r)}catch{try{const{diagram:s,id:o}=await a();Qi(o,s,i)}catch(s){throw D.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Qe[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){D.error(`Failed to load ${t.length} external diagrams`);for(const r of t)D.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),TC="graphics-document document";function ep(e,t){e.attr("role",TC),t!==""&&e.attr("aria-roledescription",t)}p(ep,"setA11yDiagramInfo");function rp(e,t,r,i){if(e.insert!==void 0){if(r){const a=`chart-desc-${i}`;e.attr("aria-describedby",a),e.insert("desc",":first-child").attr("id",a).text(r)}if(t){const a=`chart-title-${i}`;e.attr("aria-labelledby",a),e.insert("title",":first-child").attr("id",a).text(t)}}}p(rp,"addSVGa11yTitleDescription");var Ke,Ks=(Ke=class{constructor(t,r,i,a,s){this.type=t,this.text=r,this.db=i,this.parser=a,this.renderer=s}static async fromText(t,r={}){var c,h;const i=It(),a=en(t,i);t=Ty(t)+` `;try{ys(a)}catch{const u=mg(a);if(!u)throw new Fl(`Diagram ${a} not found.`);const{id:f,diagram:d}=await u();Qi(f,d)}const{db:s,parser:o,renderer:n,init:l}=ys(a);return o.parser&&(o.parser.yy=s),(c=s.clear)==null||c.call(s),l==null||l(i),r.title&&((h=s.setDiagramTitle)==null||h.call(s,r.title)),await o.parse(t),new Ke(a,t,s,o,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(Ke,"Diagram"),Ke),xl=[],LC=p(()=>{xl.forEach(e=>{e()}),xl=[]},"attachFunctions"),BC=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function ip(e){const t=e.match($l);if(!t)return{text:e,metadata:{}};let r=$0(t[1],{schema:E0})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}p(ip,"extractFrontMatter");var AC=p(e=>e.replace(/\r\n?/g,` `).replace(/]*)>/g,(t,r,i)=>""),"cleanupText"),MC=p(e=>{const{text:t,metadata:r}=ip(e),{displayMode:i,title:a,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:a,config:s,text:t}},"processFrontmatter"),EC=p(e=>{const t=ce.detectInit(e)??{},r=ce.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):(r==null?void 0:r.type)==="wrap"&&(t.wrap=!0),{text:fy(e),directive:t}},"processDirectives");function Yn(e){const t=AC(e),r=MC(t),i=EC(r.text),a=Ln(r.config,i.directive);return e=BC(i.text),{code:e,title:r.title,config:a}}p(Yn,"preprocessDiagram");function ap(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(ap,"toBase64");var $C=5e4,FC="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",DC="sandbox",OC="loose",RC="http://www.w3.org/2000/svg",IC="http://www.w3.org/1999/xlink",PC="http://www.w3.org/1999/xhtml",NC="100%",zC="100%",WC="border:0;margin:0;",qC="margin:0",HC="allow-top-navigation-by-user-activation allow-popups",jC='The "iframe" tag is not supported by your browser.',YC=["foreignobject"],UC=["dominant-baseline"];function Un(e){const t=Yn(e);return Zi(),$g(t.config??{}),t}p(Un,"processAndSetConfigs");async function sp(e,t){Ia();try{const{code:r,config:i}=Un(e);return{diagramType:(await op(r)).type,config:i}}catch(r){if(t!=null&&t.suppressErrors)return!1;throw r}}p(sp,"parse");var bl=p((e,t,r=[])=>` .${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),GC=p((e,t=new Map)=>{let r="";if(e.themeCSS!==void 0&&(r+=` ${e.themeCSS}`),e.fontFamily!==void 0&&(r+=` :root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=` :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const o=zt(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(n=>{go(n.styles)||o.forEach(l=>{r+=bl(n.id,l,n.styles)}),go(n.textStyles)||(r+=bl(n.id,"tspan",((n==null?void 0:n.textStyles)||[]).map(l=>l.replace("color","fill"))))})}return r},"createCssStyles"),VC=p((e,t,r,i)=>{const a=GC(e,r),s=Kg(t,a,e.themeVariables);return Zs(m1(`${i}{${s}}`),x1)},"createUserStyles"),XC=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Mr(i),i=i.replace(/
    /g,"
    "),i},"cleanUpSvgCode"),ZC=p((e="",t)=>{var a,s;const r=(s=(a=t==null?void 0:t.viewBox)==null?void 0:a.baseVal)!=null&&s.height?t.viewBox.baseVal.height+"px":zC,i=ap(`${e}`);return``},"putIntoIFrame"),Cl=p((e,t,r,i,a)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const o=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",RC);return a&&o.attr("xmlns:xlink",a),o.append("g"),e},"appendDivSvgG");function Qs(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(Qs,"sandboxedIframe");var KC=p((e,t,r,i)=>{var a,s,o;(a=e.getElementById(t))==null||a.remove(),(s=e.getElementById(r))==null||s.remove(),(o=e.getElementById(i))==null||o.remove()},"removeExistingElements"),QC=p(async function(e,t,r){var z,O,A,M,L,E;Ia();const i=Un(t);t=i.code;const a=It();D.debug(a),t.length>((a==null?void 0:a.maxTextSize)??$C)&&(t=FC);const s="#"+e,o="i"+e,n="#"+o,l="d"+e,c="#"+l,h=p(()=>{const W=ot(f?n:c).node();W&&"remove"in W&&W.remove()},"removeTempElements");let u=ot("body");const f=a.securityLevel===DC,d=a.securityLevel===OC,g=a.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const B=Qs(ot(r),o);u=ot(B.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=ot(r);Cl(u,e,l,`font-family: ${g}`,IC)}else{if(KC(document,e,l,o),f){const B=Qs(ot("body"),o);u=ot(B.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=ot("body");Cl(u,e,l)}let m,y;try{m=await Ks.fromText(t,{title:i.title})}catch(B){if(a.suppressErrorRendering)throw h(),B;m=await Ks.fromText("error"),y=B}const x=u.select(c).node(),b=m.type,k=x.firstChild,v=k.firstChild,S=(O=(z=m.renderer).getClasses)==null?void 0:O.call(z,t,m),C=VC(a,b,S,s),T=document.createElement("style");T.innerHTML=C,k.insertBefore(T,v);try{await m.renderer.draw(t,e,"11.13.0",m)}catch(B){throw a.suppressErrorRendering?h():$2.draw(t,e,"11.13.0"),B}const F=u.select(`${c} svg`),P=(M=(A=m.db).getAccTitle)==null?void 0:M.call(A),R=(E=(L=m.db).getAccDescription)==null?void 0:E.call(L);lp(b,F,P,R),u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",PC);let $=u.select(c).node().innerHTML;if(D.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),$=XC($,f,We(a.arrowMarkerAbsolute)),f){const B=u.select(c+" svg").node();$=ZC($,B)}else d||($=Sr.sanitize($,{ADD_TAGS:YC,ADD_ATTR:UC,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(LC(),y)throw y;return h(),{diagramType:b,svg:$,bindFunctions:m.db.bindFunctions}},"render");function np(e={}){var i;const t=At({},e);t!=null&&t.fontFamily&&!((i=t.themeVariables)!=null&&i.fontFamily)&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),Mg(t),t!=null&&t.theme&&t.theme in Le?t.themeVariables=Le[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Le.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?Ag(t):Pl();tn(r.logLevel),Ia()}p(np,"initialize");var op=p((e,t={})=>{const{code:r}=Yn(e);return Ks.fromText(r,t)},"getDiagramFromText");function lp(e,t,r,i){ep(t,e),rp(t,r,i,t.attr("id"))}p(lp,"addA11yInfo");var rr=Object.freeze({render:QC,parse:sp,getDiagramFromText:op,initialize:np,getConfig:It,setConfig:Nl,getSiteConfig:Pl,updateSiteConfig:Eg,reset:p(()=>{Zi()},"reset"),globalReset:p(()=>{Zi(vr)},"globalReset"),defaultConfig:vr});tn(It().logLevel);Zi(It());var JC=p((e,t,r)=>{D.warn(e),Tn(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),cp=p(async function(e={querySelector:".mermaid"}){try{await tk(e)}catch(t){if(Tn(t)&&D.error(t.str),te.parseError&&te.parseError(t),!e.suppressErrors)throw D.error("Use the suppressErrors option to suppress these errors"),t}},"run"),tk=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=rr.getConfig();D.debug(`${e?"":"No "}Callback function found`);let a;if(r)a=r;else if(t)a=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");D.debug(`Found ${a.length} diagrams`),(i==null?void 0:i.startOnLoad)!==void 0&&(D.debug("Start On Load: "+(i==null?void 0:i.startOnLoad)),rr.updateSiteConfig({startOnLoad:i==null?void 0:i.startOnLoad}));const s=new ce.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let o;const n=[];for(const l of Array.from(a)){if(D.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;o=l.innerHTML,o=Lu(ce.entityDecode(o)).trim().replace(/
    /gi,"
    ");const h=ce.detectInit(o);h&&D.debug("Detected early reinit: ",h);try{const{svg:u,bindFunctions:f}=await fp(c,o,l);l.innerHTML=u,e&&await e(c),f&&f(l)}catch(u){JC(u,n,te.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),hp=p(function(e){rr.initialize(e)},"initialize"),ek=p(async function(e,t,r){D.warn("mermaid.init is deprecated. Please use run instead."),e&&hp(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await cp(i)},"init"),rk=p(async(e,{lazyLoad:t=!0}={})=>{Ia(),fs(...e),t===!1&&await vC()},"registerExternalDiagrams"),up=p(function(){if(te.startOnLoad){const{startOnLoad:e}=rr.getConfig();e&&te.run().catch(t=>D.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document{if(!hs){for(hs=!0;xa.length>0;){const e=xa.shift();if(e)try{await e()}catch(t){D.error("Error executing queue",t)}}hs=!1}},"executeQueue"),ak=p(async(e,t)=>new Promise((r,i)=>{const a=p(()=>new Promise((s,o)=>{rr.parse(e,t).then(n=>{s(n),r(n)},n=>{var l;D.error("Error parsing",n),(l=te.parseError)==null||l.call(te,n),o(n),i(n)})}),"performCall");xa.push(a),dp().catch(i)}),"parse"),fp=p((e,t,r)=>new Promise((i,a)=>{const s=p(()=>new Promise((o,n)=>{rr.render(e,t,r).then(l=>{o(l),i(l)},l=>{var c;D.error("Error parsing",l),(c=te.parseError)==null||c.call(te,l),n(l),a(l)})}),"performCall");xa.push(s),dp().catch(a)}),"render"),sk=p(()=>Object.keys(Qe).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),te={startOnLoad:!0,mermaidAPI:rr,parse:ak,render:fp,init:ek,run:cp,registerExternalDiagrams:rk,registerLayoutLoaders:xf,initialize:hp,parseError:void 0,contentLoaded:up,setParseErrorHandler:ik,detectType:en,registerIconPacks:Fx,getRegisteredDiagramsMetadata:sk},Hk=te;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution */export{wk as $,bk as A,Jr as B,be as C,zp as D,nm as E,Ln as F,Il as G,It as H,xy as I,E0 as J,vm as K,dm as L,Eo as M,Mo as N,Lk as O,_k as P,vk as Q,Sk as R,Ck as S,ln as T,it as U,Tk as V,kk as W,cr as X,Ak as Y,Bk as Z,p as _,tm as a,_g as a0,ai as a1,yk as a2,Ba as a3,cy as a4,zg as a5,Ul as a6,Lo as a7,mm as a8,Cs as a9,Ob as aA,Mb as aB,Ab as aC,Ox as aD,Ll as aE,fm as aF,mk as aG,yi as aH,Fx as aI,$x as aJ,ru as aK,J0 as aL,V as aM,pu as aN,ty as aO,tu as aP,N0 as aQ,z0 as aR,W0 as aS,P0 as aT,H0 as aU,Np as aV,kn as aW,ly as aX,oy as aY,yy as aa,Vg as ab,di as ac,j as ad,J as ae,Vl as af,nb as ag,pf as ah,Nk as ai,F0 as aj,zt as ak,Me as al,Wr as am,Bn as an,cu as ao,Mr as ap,fu as aq,U as ar,Hk as as,j0 as at,Jb as au,Pk as av,zk as aw,Rk as ax,Z as ay,Ik as az,Jg as b,pt as c,Gl as d,At as e,Ae as f,rm as g,de as h,R0 as i,pi as j,uu as k,D as l,fi as m,xk as n,qk as o,im as p,am as q,Wk as r,em as s,$0 as t,ce as u,vb as v,ky as w,Mk as x,Sr as y,Qg as z};